Welcome to the LimeSurvey Community Forum

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

Array filter setup

  • iuriem
  • iuriem's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 7 months ago #172982 by iuriem
Array filter setup was created by iuriem
I have a survey with two questions: 1) the first is an Array (Numbers) question type with six checkbox answers for the X-Scale subquestions (multiflexible_checkbox 1) and 2) the second is a List (radio) question type.

What I want is to use the second question to filter only the Y-Scale subquestions (life events) checked as "Happened to me" (the very first checkbox). Right now are filtered absolutely all subquestions regardless of the chosen answer.

I searched all the past day in the manual and in the forum, but I did not understand how I can fix this. Can someone help me to solve this?

I attached a simplified version of my survey (only two checkboxes per line).
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 7 months ago #172985 by Joffm
Replied by Joffm on topic Array filter setup
Hi,
unfortunately you didn't tell us the version you are using.

Well, it's always the same procedure:

1. create a multipunch question with the same codes and items (hidden) I called it "mevents".
2. create a question of type "equation". Check the checkboxes that refer to the answer "A1" of your array by this equation .
{mevents_SQ01=if(events_SQ01_A1==1,"Y","")}
{mevents_SQ02=if(events_SQ02_A1==1,"Y","")}
...

Explanation:
You know that in an array(numbers) with checkbox design the checked boxes are stored as "1".
And you know that in multiple questions checked subquestions are stored as "Y".
So, if the checkbox in question "events", subquestion "SQ01" and answeroption "A1" is equal "1"
then subquestion "SQ01" of question "mevents" is set to "Y", else stays blank.

Then you can use "mevents" as array filter of the next question.

Example:

File Attachment:

File Name: limesurvey...9399.lss
File Size:80 KB


Best regards
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: iuriem
The topic has been locked.
  • iuriem
  • iuriem's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 7 months ago #172987 by iuriem
Replied by iuriem on topic Array filter setup
Joffm, thank you very much!

A very good explanation. Now I understand the logic behind of this type scenario.

Sorry for the version, it is the 3.14.5+180815, probably I need an update.

Best wishes,
Iurie
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose