- Posts: 185
- Thank you received: 11
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
- Topic Author
- Offline
- Elite Member
Less
More
5 years 4 months ago #177944
by bulgin
Why do numberic variables work but not "A1" in a decision tree? was created 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.
{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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13597
- Thank you received: 2487
5 years 4 months ago - 5 years 4 months ago #177948
by DenisChenu
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.
Replied by DenisChenu on topic Why do numberic variables work but not "A1" in a decision tree?
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11639
- Thank you received: 2737
5 years 4 months ago #177959
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Why do numberic variables work but not "A1" in a decision tree?
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.
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
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 185
- Thank you received: 11
5 years 4 months ago #177968
by bulgin
Replied by bulgin on topic Why do numberic variables work but not "A1" in a decision tree?
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.
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13597
- Thank you received: 2487
5 years 4 months ago #177974
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 Why do numberic variables work but not "A1" in a decision tree?
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 …
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.