Welcome to the LimeSurvey Community Forum

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

Grouping answers from previous question

  • saifshaikh
  • saifshaikh's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
6 years 9 months ago #155134 by saifshaikh
Grouping answers from previous question was created 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.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 9 months ago #155138 by tpartner
Replied by tpartner on topic Grouping answers from previous question
You can use the Expression Manager assignment operator to set a select-radio question depending on the answers to Q1 - manual.limesurvey.org/Expression_Manager..._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 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.
  • saifshaikh
  • saifshaikh's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
6 years 9 months ago #155140 by saifshaikh
Replied by saifshaikh on topic Grouping answers from previous question
Thanks Tony, that perfectly works.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose