- Posts: 7
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
How to refer to several questions in same if condition
- UnserFranz
- Topic Author
- Offline
- New Member
Less
More
5 years 7 months ago #173868
by UnserFranz
How to refer to several questions in same if condition was created by UnserFranz
Hi,
how may I refer to several questions (answer codes of several questions) in the same if condition?
example:
A respondent answered q1, q2, and q3 with answer 2.
May I put some equation like "{if(q1, q2, q3 == 2, 'result 2', 'other result')}" in a follow-up question?
Or do I have to refer to each question specifically?
Thanks a lot
how may I refer to several questions (answer codes of several questions) in the same if condition?
example:
A respondent answered q1, q2, and q3 with answer 2.
May I put some equation like "{if(q1, q2, q3 == 2, 'result 2', 'other result')}" in a follow-up question?
Or do I have to refer to each question specifically?
Thanks a lot
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11639
- Thank you received: 2737
5 years 7 months ago #173872
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 How to refer to several questions in same if condition
You will most probably have to use AND to join this. Here are a few examples similar to what you want to do.
manual.limesurvey.org/Expression_Manager...ons_.3D.3E_Relevance
This should do the trick, I guess (not tested).
manual.limesurvey.org/Expression_Manager...ons_.3D.3E_Relevance
Code:
{if(q1==2 && q2==2 && q3==2, "result 2", "other result)}
This should do the trick, I guess (not tested).
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.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11639
- Thank you received: 2737
5 years 7 months ago #173873
by holch
should work as well, I guess.
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 How to refer to several questions in same if condition
Code:
{if(q1==2 AND q2==2 AND q3==2, "result 2", "other result)}
should work as well, I guess.
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.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13597
- Thank you received: 2487
5 years 7 months ago #173893
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 How to refer to several questions in same if condition
Or :side:
:evil:
manual.limesurvey.org/Expression_Manager#Access_to_Functions
Code:
{if(coutif("2",q1.NAOK, q2.NAOK, q3.NAOK) == 3, "result 2", "other result)}
manual.limesurvey.org/Expression_Manager#Access_to_Functions
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: UnserFranz
The topic has been locked.
- UnserFranz
- Topic Author
- Offline
- New Member
Less
More
- Posts: 7
- Thank you received: 0
5 years 6 months ago #174222
by UnserFranz
Replied by UnserFranz on topic How to refer to several questions in same if condition
Attachments:
The topic has been locked.
- jelo
- Offline
- Platinum Member
Less
More
- Posts: 5033
- Thank you received: 1257
5 years 6 months ago #174234
by jelo
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic How to refer to several questions in same if condition
countifop allows to use a operator. countif only matches values.
E.g. countifop("<",2015,year1,year2,year3) is counting years before 2015.
E.g. countifop("<",2015,year1,year2,year3) is counting years before 2015.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The following user(s) said Thank You: holch, UnserFranz
The topic has been locked.
- UnserFranz
- Topic Author
- Offline
- New Member
Less
More
- Posts: 7
- Thank you received: 0
5 years 6 months ago #174244
by UnserFranz
Replied by UnserFranz on topic How to refer to several questions in same if condition
Oooh! That's cool
The topic has been locked.