- Posts: 1
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Usage of expresions
- Testrestorest
- Topic Author
- Offline
- New Member
Less
More
6 years 7 months ago #157515
by Testrestorest
Usage of expresions was created by Testrestorest
Hello, everyone! I am new to LimeSurvey, can someone please help me with following expressions:
If question "11" is "a" and if question "21" is "a" then question "22" will not show
If question "12" is not "a" not "d" and question "24" is not "f" then question "28" will not show
If question "24" is "g" then question "30" will show
If question "1" is "a" then questions "7", "8","18", "24-31" will be skipped
If question "2" is 'b' question "11" will be locked with "a"
if question "3" is 'd' then question '6' will display different text and possible answers
if question "4" is 'd' then question '6' will display different text
if question "5" is 'd' then question '6' will display different answers
If question "11" is "a" and if question "21" is "a" then question "22" will not show
If question "12" is not "a" not "d" and question "24" is not "f" then question "28" will not show
If question "24" is "g" then question "30" will show
If question "1" is "a" then questions "7", "8","18", "24-31" will be skipped
If question "2" is 'b' question "11" will be locked with "a"
if question "3" is 'd' then question '6' will display different text and possible answers
if question "4" is 'd' then question '6' will display different text
if question "5" is 'd' then question '6' will display different answers
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12790
- Thank you received: 3940
6 years 7 months ago - 6 years 7 months ago #157521
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Usage of expresions
Hi,
if you are going to use a lot of expressions, you should have read the section about expressions in the manual
and studied the sample surveys, e.g. manual.limesurvey.org/images/d/de/Ls2_em_tailoring.lss
Well, just one hint:
Relevance of Q22 set to: (Q11!="a") AND (Q21!="a"))
Use something like:
{if(Q4.NAOK=="b", "This is answer text 1", "This is the other answer text")}
single response question don't have relevance of answer options you have to create different questions and display them according to the answer in the other question), multi response questions have.
Best regards
Joffm
if you are going to use a lot of expressions, you should have read the section about expressions in the manual
and studied the sample surveys, e.g. manual.limesurvey.org/images/d/de/Ls2_em_tailoring.lss
Well, just one hint:
Assuming Q11 and Q21 are single response and "a" is the code of the answer option:If question "11" is "a" and if question "21" is "a" then question "22" will not show
Relevance of Q22 set to: (Q11!="a") AND (Q21!="a"))
More or less analogue.If question "12" is not "a" not "d" and question "24" is not "f" then question "28" will not show
If question "24" is "g" then question "30" will show
If question "1" is "a" then questions "7", "8","18", "24-31" will be skipped
??? If the "a" is forced and single response, Don't show the question, set the "a" in an equation like {Q11="a"}If question "2" is 'b' question "11" will be locked with "a"
See manual.limesurvey.org/Expression_Manager#Tailoring.2FPipingIf question "4" is 'd' then question '6' will display different text
Use something like:
{if(Q4.NAOK=="b", "This is answer text 1", "This is the other answer text")}
If only the wording of the answers is changed, again Tailoring/Piping, else it depends on the question type:if question "3" is 'd' then question '6' will display different text and possible answers
if question "5" is 'd' then question '6' will display different answers
single response question don't have relevance of answer options you have to create different questions and display them according to the answer in the other question), multi response questions have.
Best regards
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 6 years 7 months ago by Joffm.
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12790
- Thank you received: 3940
6 years 7 months ago #157530
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Usage of expresions
Short addition:
To be more exact:
{Q11=(if(Q2=="b","a",22))}
See here:
www.limesurvey.org/forum/can-i-do-this-w...d-on-previous-answer
Joffm
If question "2" is 'b' question "11" will be locked with "a"
To be more exact:
{Q11=(if(Q2=="b","a",22))}
See here:
www.limesurvey.org/forum/can-i-do-this-w...d-on-previous-answer
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.