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

More
5 days 6 hours ago #177944 by bulgin
bulgin created the topic: Why do numberic variables work but not "A1" in a decision tree?
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.

Please Log in or Create an account to join the conversation.

More
5 days 5 hours ago - 5 days 5 hours ago #177948 by DenisChenu
DenisChenu replied the topic: Why do numberic variables work but not "A1" in a decision tree?
{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 (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .
Last Edit: 5 days 5 hours ago by DenisChenu.
The following user(s) said Thank You: holch

Please Log in or Create an account to join the conversation.

More
5 days 5 hours ago #177959 by holch
holch replied the 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.

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Please Log in or Create an account to join the conversation.

More
5 days 4 hours ago #177968 by bulgin
bulgin replied the 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.

Please Log in or Create an account to join the conversation.

More
5 days 3 hours ago #177974 by DenisChenu
DenisChenu replied the 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 …

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!