Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Relevance coding not working?

  • PaulMRFGR
  • PaulMRFGR's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 4 months ago #177125 by PaulMRFGR
Relevance coding not working? was created 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.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 4 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 answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 4 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 answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • PaulMRFGR
  • PaulMRFGR's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 4 months ago #177161 by PaulMRFGR
Replied by PaulMRFGR on topic Relevance coding not working?
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!
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose