Welcome to the LimeSurvey Community Forum

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

Grouping open-ended questions

More
2 years 6 months ago #240625 by waytoformal
Hello, I've been trying to somehow group open-ended questions into bigger groups. For example I have an open-ended numeric (age) question and when a person answers I want to store all the people into groups of 16-24, 25-34 etc.
 
Is there a way to do that? 


Thanks. 

Please Log in to join the conversation.

More
2 years 6 months ago #240633 by Joffm
Replied by Joffm on topic Grouping open-ended questions
Create a (hidden) question of type "equation".
Let's call it "agegroup"
With:
{if(age<25,1,if(age<35,2,if(age<45,3,if(age<55,4,5))))}
The IF-function has the following syntax
if(test,result_if_true,result_if_false)
And you can nest  it.
Now you get in the variable "agegroup" 5 groups. Adapt to your needs.

Here I assumed that the first (numerical) question doesn't allow ages below 16

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose