Welcome to the LimeSurvey Community Forum

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

Grouping answers from previous question

More
8 years 3 months ago #155134 by saifshaikh
hello,

can I group answers of a question to another hidden question in database.

Eg.

Q1 Pleae specify Customer type?

1 Owner
2 Tenant
3 Investor
4 Office employee
5 Domestic visitor
6 Regional visitor
7 International visitor

Q2 Based on Q1

1 Resident (If Q1 = 1, 2 & 3)
2 Office (If Q1 = 4 )
3 Visitor (If Q1 = 5,6,7 )

Thanks
Saif
The topic has been locked.
More
8 years 3 months ago #155138 by tpartner
You can use the Expression Manager assignment operator to set a select-radio question depending on the answers to Q1 - www.limesurvey.org/manual/Expression_Man..._Assignment_Operator

1) Place Q2 in a group following the Q1 group.

2) Give Q2 a CSS class "hidden" (assuming you want to hide it).

3) Place a hidden equation type question directly after Q2 with this as the question value:
Code:
{Q2=if(Q1< 4, 1, if(Q1== 4, 2, 3))}

Sample survey attached (I have left Q2 visible so you can see the results):

File Attachment:

File Name: limesurvey...5-23.lss
File Size:17.32 KB

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
8 years 3 months ago #155140 by saifshaikh
Thanks Tony, that perfectly works.
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose