Welcome to the LimeSurvey Community Forum

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

Using array filters or expressions when question type is drop down list

  • LimeUserTest
  • LimeUserTest's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 2 months ago - 5 years 2 months ago #179655 by LimeUserTest
I have a survey of two questions :


Question 1: Where are you from ? (of type drop down list)

- United states
- Belgium


Question 2: How much is your salary ? (of type drop down list)

- 5000 $/€
- more than 5000 $/€

The answer options of the second questions are shown in the currency with respect to the country chosen in question 1. Since I don't want to create many conditional questions with different currencies (current solution). I am trying to find a way to change them by using an expression.
Another solution was to use this expression in the answer options 5000 {if ( Q1=='A1' , '$' ,'€')} as in the attached file.
This solution would work if the type of question is Multiple choice but would not work for the drop down list unfortunately cause apparently this is a bug in Lime Survey.
Is there any other expression to try ? Or a Java script code to do that ?

File Attachment:

File Name: limesurvey...test.lss
File Size:16 KB
Last edit: 5 years 2 months ago by LimeUserTest.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 2 months ago #179660 by DenisChenu

LimeUserTest wrote: If the type of question is Multiple choice but would not work for the drop down list unfortunately cause apparently this is a bug in Lime Survey.
Is there any other expression to try ? Or a Java script code to do that ?

Not a bug, since we can not update drop down via javascript in same way : Expression in fdropdown use static variable .

You can use Radio list if it's same page.
In another page : it's OK if you are in 3.15.5 (or 6).

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The following user(s) said Thank You: LimeUserTest
The topic has been locked.
  • LimeUserTest
  • LimeUserTest's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 2 months ago #179665 by LimeUserTest
Thank you !
But in my case I need to use the drop down type. I don't want to go throw a radio list cause this is a requirement. I understand from your reply that there is no way to do it with the drop down list even in Java Script ?
Thanks again
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 2 months ago #179672 by DenisChenu
Yes, you can use a dropdow and update value with JS, but it's REALLY more hard …

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 2 months ago #179772 by Joffm
Hi,
here you get an example.
Well, base language is italian, but this only affects the buttons, etc.

[hr]



File Attachment:

File Name: limesurvey...7575.lss
File Size:21 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: DenisChenu, LimeUserTest
The topic has been locked.
  • LimeUserTest
  • LimeUserTest's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 2 months ago #179846 by LimeUserTest
Hi Joffm,
that makes sense and is working thank you. But I am wondering why isn't it working in case the question number 1 and number 2 are in the same group ?!
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 2 months ago - 5 years 2 months ago #179850 by holch

Hi I am using free plan of Lime survey which shows that 25 responses can be recorded per month. I have calculated my survey participants and it makes 28 responses , so can I still use this free plan or I have to buy the basic plan?

This has nothing to do with this thread. Please ask this in your own thread.

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

Last edit: 5 years 2 months ago by holch.
The following user(s) said Thank You: DenisChenu
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 2 months ago #179852 by tpartner

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: DenisChenu
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 2 months ago #179855 by Joffm
Hi,

But I am wondering why isn't it working in case the question number 1 and number 2 are in the same group ?!

Because I ran it "group by group".
If you say "question by question" it can be in the same group.

The important thing is that the two questions are NOT on the same screen.

Best regards
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • LimeUserTest
  • LimeUserTest's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 2 months ago #179863 by LimeUserTest
Yes, but unfortunately I need them to be on the same screen and that's the point!!
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose