- Posts: 965
- Thank you received: 218
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Puzzling equation: does it not work with hidden questions?
- tammo
- Topic Author
- Offline
- Official LimeSurvey Partner
Less
More
7 years 9 months ago #138125
by tammo
Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
Puzzling equation: does it not work with hidden questions? was created by tammo
In the attached survey:
q1: Do you like ice cream?
-- Yes, always (code 100)
-- Sometimes (code 50)
-- No (code 0)
q2: Do you often eat ice cream? (only shown when previous answer was "Sometimes" of "Yes, always")
Relevance: !is_empty(q1) && q1 ne 0
-- Always (code 100)
-- Often (code 66)
-- Regularly (code 33)
-- Never (code 0)
q3: equation that should show "0" (zero) when q1 == 0 and otherwise: (q1+q2)/2
Using: {if(q1==0,q1,(q1+q2)/2)}
But it never shows "0". When I always show q1 (relevance =1), then it will work.
Does this mean that you cannot use hidden questions in equations?
Does anyone know a workaround?
See attached .lss and
lime25test.toolsforresearch.com/index.ph...553?lang=nl-informal
q1: Do you like ice cream?
-- Yes, always (code 100)
-- Sometimes (code 50)
-- No (code 0)
q2: Do you often eat ice cream? (only shown when previous answer was "Sometimes" of "Yes, always")
Relevance: !is_empty(q1) && q1 ne 0
-- Always (code 100)
-- Often (code 66)
-- Regularly (code 33)
-- Never (code 0)
q3: equation that should show "0" (zero) when q1 == 0 and otherwise: (q1+q2)/2
Using: {if(q1==0,q1,(q1+q2)/2)}
But it never shows "0". When I always show q1 (relevance =1), then it will work.
Does this mean that you cannot use hidden questions in equations?
Does anyone know a workaround?
See attached .lss and
lime25test.toolsforresearch.com/index.ph...553?lang=nl-informal
Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
Attachments:
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13597
- Thank you received: 2487
7 years 9 months ago #138140
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Puzzling equation: does it not work with hidden questions?
Usage of NAOK ....
manual.limesurvey.org/Expression_Manager#Usage_of_NAOK
else q2 disable all equation.
Tested : limesurvey.sondages.pro/715553
manual.limesurvey.org/Expression_Manager#Usage_of_NAOK
ThenWhen you put some variable from question in any equation : if this question (or subquestion) is hidden by condition : this disable all equation.
Code:
{if(q1==0,q1,(q1+q2.NAOK)/2)}
Tested : limesurvey.sondages.pro/715553
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The following user(s) said Thank You: tammo
The topic has been locked.
- tammo
- Topic Author
- Offline
- Official LimeSurvey Partner
Less
More
- Posts: 965
- Thank you received: 218
7 years 9 months ago #138146
by tammo
Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
Replied by tammo on topic Puzzling equation: does it not work with hidden questions?
Thanks Denis!
Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The topic has been locked.