Welcome to the LimeSurvey Community Forum

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

Why do numberic variables work but not "A1" in a decision tree?

  • bulgin
  • bulgin's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
5 years 4 months ago #177944 by bulgin
Following the suggestions for redirecting URL based on values, I see that the following formula works:

{if(firstquestion == 1, equation1, equation2)}

but the following does not (yes, I have changed the values in the "Text Elements" and questions)

{if(firstquestion == A1, equation1, equation2)}

Thank you.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 4 months ago - 5 years 4 months ago #177948 by DenisChenu
Code:
{if(firstquestion == "A1", equation1, equation2)}

Remind to always look at survey logic file : it's done for this … and here it show the error.
manual.limesurvey.org/Check_question_logic

manual.limesurvey.org/Show_logic_file

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.
Last edit: 5 years 4 months ago by DenisChenu.
The following user(s) said Thank You: holch
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 4 months ago #177959 by holch
To add to Denis:

1 is an integer ==> firstquestion == 1 is OK.
A1 is a string ==> you need "".

But as far as I remember of my time when I programmed in PHP and JS a bit more, this is also the case for other programming / scripting languages and might throw an error there too.

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.
  • bulgin
  • bulgin's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
5 years 4 months ago #177968 by bulgin
thanks. I tried with the quotation marks and still didn't work. But the numbers work and I can work with that.

Is there a way to system-wide make questions as numbers instead of A1, A2, etc.?

I comforted updated yesterday so I do have the latest.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 4 months ago #177974 by DenisChenu
If it don't work it's a major issue that must be fixed ,

But maybe there are another things …
If you are sure it don't work : please report the issue …

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 topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose