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
  • tammo's Avatar Topic Author
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
7 years 9 months ago #138125 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

File Attachment:

File Name: limesurvey...3(1).lss
File Size:17 KB


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 9 months ago #138140 by DenisChenu
Usage of NAOK ....
manual.limesurvey.org/Expression_Manager#Usage_of_NAOK

When you put some variable from question in any equation : if this question (or subquestion) is hidden by condition : this disable all equation.

Then
Code:
{if(q1==0,q1,(q1+q2.NAOK)/2)}
else q2 disable all equation.

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
  • tammo's Avatar Topic Author
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
7 years 9 months ago #138146 by tammo
Thanks Denis!


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose