Welcome to the LimeSurvey Community Forum

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

Usage of expresions

  • Testrestorest
  • Testrestorest's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 2 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
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 2 months ago - 7 years 2 months ago #157521 by Joffm
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. www.limesurvey.org/manual/images/d/de/Ls2_em_tailoring.lss

Well, just one hint:

If question "11" is "a" and if question "21" is "a" then question "22" will not show

Assuming Q11 and Q21 are single response and "a" is the code of the answer option:
Relevance of Q22 set to: (Q11!="a") AND (Q21!="a"))

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

More or less analogue.

If question "2" is 'b' question "11" will be locked with "a"

??? If the "a" is forced and single response, Don't show the question, set the "a" in an equation like {Q11="a"}

If question "4" is 'd' then question '6' will display different text

See www.limesurvey.org/manual/Expression_Manager#Tailoring.2FPiping
Use something like:
{if(Q4.NAOK=="b", "This is answer text 1", "This is the other answer text")}

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

If only the wording of the answers is changed, again Tailoring/Piping, else it depends on the question type:
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: 7 years 2 months ago by Joffm.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 2 months ago #157530 by Joffm
Replied by Joffm on topic Usage of expresions
Short addition:

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.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose