Welcome to the LimeSurvey Community Forum

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

Single Choice to be shown based on some filter

  • scene143
  • scene143's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
3 years 8 months ago #203187 by scene143
Hi,

I have a single choice question like this.

Maruti
BMW
Hyundai
Honda
Audi

But client want to show Maruti and BMW only for US country. Can anyone help me how to hide those 2 codes for other countries?
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 8 months ago - 3 years 8 months ago #203188 by tpartner
Replied by tpartner on topic Single Choice to be shown based on some filter
There is no direct answer relevance for single choice questions so you have two options...

1) Create a separate question for the US.

2) Insert a hidden multiple-choice question. Toggle the checkboxes in that question with a hidden equation question. Place an array filter on your single-choice, based on the hidden multi-choice. Search the forums - Joffm has given many example of this method.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 3 years 8 months ago by tpartner.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 8 months ago #203190 by Joffm
In this case I'd recommend to set the default answers of the hidden multiple question to "checked".
Then you have only two assignments to uncheck "Maruti" and "BMW" if country=="US".
Something like
{M1_1=if(country=="US","","Y"}
...

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: tpartner
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 8 months ago #203248 by holch

Then you have only two assignments to uncheck "Maruti" and "BMW" if country=="US".
Something like
{M1_1=if(country=="US","","Y"}

As far as I understood you want to uncheck if country is NOT =="US".

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 8 months ago #203255 by Joffm
Oh, so sorry,
it takes too much time between reading and writing something.

Of course it has to be:
{M1_1=if(country=="US","Y",""} because you want to display these brands only if country is "US".
...

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose