Welcome to the LimeSurvey Community Forum

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

Quota for hidden question based on an short text answer

  • almashah
  • almashah's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
3 years 8 months ago #204233 by almashah
Thank you,

It is capitalized and assigned positions but I do not know why the "if statement" ({if(position < 10,"West",if(position < 22,"East",if(position < 35,"ABC","DEF")))} is always giving DEF
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 8 months ago #204234 by holch
Without seeing your code it is difficult to understand why.

At the moment seems like the conditions are never met, thus DEF is the only result. So you need to check your equation, e.g. if there is any error highlighted.

Add a LSS file with only the relevant questions to this post, then we can have a look and see what you have done and where the problem is.

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.
  • almashah
  • almashah's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
3 years 8 months ago #204239 by almashah
Please find a copy of the questions attached.

Best regards
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 8 months ago #204240 by holch
I have asked for a LSS file. Please do not provide LSQ or LSG files. Why?

1. They are language sensitive. They can only be imported into a survey with the same language
2. Problems can arise from general survey configurations
3. If we always have to create a new survey and groups to import LSQ files to help in the forum, this will increase the time spend on doing so, which could be better invested in helping others.

So, please create a copy of your survey, exclude all parts that are not relevant for the problem and then export it as LSS.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The following user(s) said Thank You: almashah
The topic has been locked.
  • almashah
  • almashah's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
3 years 8 months ago #204241 by almashah
Thank you, please find it attached. Much appreicated
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 8 months ago #204242 by Joffm
Hi,
1. You use "Assign.value". You shouldn't use "Assign" as question code. Use a different Code and it will be fine

And something else:
a. Why is your first question multiple? I can agree AND not agree.

b. If you had used numeric codes in SE01 "1,2,3,4,5,6" your relevance equation of Q1 would be shorter (SE01.NAOK gt 1)

c. Your regexp in Q1 seem to have a trailing blank. Please revise. Might be because of export and import.

d. Did you use the condition builder? We do not use this anymore. Expression Manager is more flexible and powerful.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: almashah
The topic has been locked.
  • almashah
  • almashah's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
3 years 8 months ago #204275 by almashah
Thank you Joffm,

I changed the "Assign" code to different ones I tried "Q5" and then "zer" but the problem still there.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 8 months ago #204281 by Joffm
Remove any tags <p></p> from your equations.









Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: almashah
The topic has been locked.
  • almashah
  • almashah's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
3 years 8 months ago #204303 by almashah
Thank you Joffm for your continuous and detailed help. It works perfectly now.
The topic has been locked.
  • almashah
  • almashah's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
3 years 8 months ago #204304 by almashah
Are having these issues would cause problems later on when respondents take the survey?

Best regards
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 8 months ago - 3 years 8 months ago #204309 by Joffm
Which issues?

Your problem was that there was not only the function in the question text but some more HTML.
Instead of
{strpos("..",Q1)}
there was
{strpos("..",Q1)}

<p> </p>


Therefore the result of the equation was not e.g.
"47"
but
"47 " (with a blank at the end).

So your IF-statement couldn't work correctly.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 3 years 8 months ago by Joffm.
The following user(s) said Thank You: almashah
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 8 months ago #204313 by tpartner
To be safe, you can use the trim() function to clean up the value - manual.limesurvey.org/ExpressionScript_-...#Access_to_functions

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: almashah
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose