Relevance coding not working?

More
1 year 6 months ago #177125 by PaulMRFGR
Hey!

So at the start of the survey, we have an equation question which gives each respondent a random number between 1-6. The question is called randnumber

if(is_empty(randnumber), rand(1, 6), randnumber)

Some questions in the survey only show for some respondents (depending on which random number they got at the start). I've set up the relevance on each question accordingly:

randnumber==1
randnumber==2
randnumber==3
randnumber==4
randnumber==5
randnumber==6

However, the relevance doesn't seem to work and it's skipping these questions where the relevance coding is setup? What am I doing wrong?

Thank you.

Please Log in to join the conversation.

LimeSurvey Partners
More
1 year 6 months ago #177127 by holch
Replied by holch on topic Relevance coding not working?
Have you checked if randnumber contains a number?

Besides this: Which version of LS are you using?

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Please Log in to join the conversation.

More
1 year 6 months ago #177128 by holch
Replied by holch on topic Relevance coding not working?
Have a look at the demo on Limesurvey.org. I have created a questionnaire called "Randomtest". Works perfectly.

Also here as attachment.

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds
Attachments:

Please Log in to join the conversation.

More
1 year 6 months ago #177161 by PaulMRFGR
Hey,

Thanks so much for the reply - this worked! I used your survey and managed to work out that it was actually something really stupid (I'd left in a colon on my equation which meant that the random numbers were coming out as :3 etc, so the relevance of randnumber==3 wasn't picking it up)..

Thank you again!

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now