Welcome to the LimeSurvey Community Forum

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

How can I implement multiple filters on subquestions?

  • rockyist
  • rockyist's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
1 year 5 months ago #245504 by rockyist
Your LimeSurvey version: Version 5.6.14+230403
Own server or LimeSurvey hosting:
Survey theme/template:
==================
Hello guys, 

Recently, I've been using multiple question answers to filter the following sub-questions. My idea is explained below:

I will first ask about individual capabilities, e.g., Walking ability, cycle ability, vehicle ownership and driver's license. The travel mode will only be displayed in the Irrelevant Question if the following conditions are met:
  • Walking (if the respondents choose "no" in the WalkingAbility Question)
  • Private bike (if the respondents choose ("yes" in the CycleAbility Question AND bike/e-bike in the vehicle ownership question). However, the CycleAbility question is also displayed conditionally. If the respondent chooses "Never" for both bike and shared bike in the frequency question, we will ask whether they can cycle or not. So we should also take into account the case when CycleAbility is hidden. The same for shared bikes and shared e-bikes.)
  • Shared bike (if the respondents choose "yes" in the CycleAbility Question)
  • Shared E-bike (if the respondents choose "yes" in the CycleAbility Question)
  • Private scooter (if the respondents choose ("yes" in the CycleAbility Question AND "SQ01"/"SQ02" in the DriverLicense Question AND "SQ005" in the VehicleOwnership Question))
  • Shared scooter (if the respondents choose ("yes" in the CycleAbility Question AND "SQ01"/"SQ02" in the DriverLicense Question))
  • Private car as driver (if the respondents choose "SQ01" in the DriverLicense Question AND "SQ004" in the VehicleOwnership Question)
  • Shared car as driver (if the respondents choose "SQ01" in the DriverLicense Question
Then the travel modes that are not chosen by respondents in the Irrelevant Question will be displayed in the next Preference Question. 
And ReasonNotUsing Question will ask about shared modes which are chosen in the Irrelevant Question (implying the respondents will never use these shared modes).
The implementation of consecutive filters and the design of multiple conditions are really difficult for me. And I'll appreciate it if you can help me with this problem and tell me: how will LimeSurvey platform identify the priority when there are several conditional operators (and, or). 

Best,
 

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 5 months ago #245506 by Joffm
Hi, there are some initial mistakes.
You see CycleAbility is only asked if I answered "Frequency (bike) with "Never"
But CycleAbility is a condition to show "bike, etc. in "Irrelevant"
There were some variables that were not defined (ín your provided part of the survey)
And you used "Irrelevant" as "array filter" though it is a question of type "array"

But as far as I understand your logic it should be like this
 

File Attachment:

File Name: limesurvey...8621.lss
File Size:244 KB


Joffm

how will LimeSurvey platform identify the priority when there are several conditional operators (and, or). 

This is as we learned it at school. 
[url] www.limesurvey.org/manual/ExpressionScri...ntation/en#Operators [/url]

 

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

Please Log in to join the conversation.

  • rockyist
  • rockyist's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
1 year 5 months ago #245508 by rockyist
Hello Joffm, 

Thank you for your reply. I deleted the condition of the CycleAbility question and now make it work in the Irrelevant Question. 

But another problem was raised. Shared scooter and shared car as a driver will not be displayed in the Irrelevant question if I choose no driver license. But these two options will leak to the preference question. The array filter doesn't work on the hidden subquestion. What should I do if I want to hide shared scooter and shared car as a driver in the preference question?

On the other hand, shared scooter will not be displayed in the NotUsingReason question due to the hide in Irrelevant Question. What should I do if I want to show shared scooter in the NotUsingReason question? [The lss file is attach below]

Luqi
 

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 5 months ago - 1 year 5 months ago #245511 by Joffm
Wlthout driver license I see this in the survey I sent
 
and with this selection this.
 
What do you want to be displayed in this case?
And don't forget, "shared car (as a passenger)" is not included in your assignment. With intention? 

Joffm

 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 1 year 5 months ago by Joffm.

Please Log in to join the conversation.

  • rockyist
  • rockyist's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
1 year 5 months ago #245514 by rockyist
Hello Joffm, 

In your case, I hope the displayed modes are: Bus, Tram, Train and Metro. I don't want the hidden mode (shared scooter, shared car as a driver) to appear here. 
For the last screenshot, I hope the displayed travel modes are: shared bike, shared e-bike, shared car as a passenger, shared scooter and shared car as driver (the last two are the hidden mode in Irrelevant Question)

Best

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 5 months ago #245515 by Joffm
Why do you insert a subquestion relevance in "IrrelavantCopy" if you set the values by the equation?
 
Remove it

And change the assignment to
{IrrelavantCopy_SQ1=if(WalkingAbilityCopy=="Y","Y","")}
{IrrelavantCopy_SQ2=if(CycleAbilityCopy=="N","Y","")}


 

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

Please Log in to join the conversation.

  • rockyist
  • rockyist's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
1 year 5 months ago #245532 by rockyist
Hello Joffm, 

Thanks for your reminder. I will update my assignment and remove the relevance equations in the Irrelevant question. And I'm looking forward to your reply for my last question posted yesterday afternoon.

Best,

 

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose