- Posts: 5
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Setting Multiply Choice Values?
- minerva1961
- Topic Author
- Offline
- New Member
Less
More
5 years 5 months ago #176088
by minerva1961
Setting Multiply Choice Values? was created by minerva1961
Hi everyone.
Struggling with Expression Manager, there's a very steep learning curve at the start. I'm trying to help one of the researchers here with her project but getting nowhere fast and the online manual isn't very friendly.
She wants to look at Exercise Routines specifically BIKE, I've pasted 3 (of the nearly 40 choices) below
SQ-1: bicycling, stationary, 161-200 watts, vigorous effort
SQ-2: bicycling, stationary, 201-270 watts, very vigorous effort
SQ-3: bicycling, stationary, 51-89 watts, light-to-moderate effort
It's anticipated users will select at least a few of the fields.
How do I give each choice a numeric valve that I can sum in a textbox after the question? I'm sure this must be a FAQ somewhere but my coffee isn't doing it's job..
I've went down a lot of dead-ends yesterday (Validation/Assessment) but not making any headway.
The nice simple BMI example works perfectly on my survey but I'm struggling with this.
Any pointers would be much appreciated.
And my frazzled brain thinks the {sum} should be something like this
{sum(BIKE_SQ-1,BIKE_SQ-2, BIKE_SQ-3)}
but I'm sure that's wrong as well.
TVMIA
Derek
Struggling with Expression Manager, there's a very steep learning curve at the start. I'm trying to help one of the researchers here with her project but getting nowhere fast and the online manual isn't very friendly.
She wants to look at Exercise Routines specifically BIKE, I've pasted 3 (of the nearly 40 choices) below
SQ-1: bicycling, stationary, 161-200 watts, vigorous effort
SQ-2: bicycling, stationary, 201-270 watts, very vigorous effort
SQ-3: bicycling, stationary, 51-89 watts, light-to-moderate effort
It's anticipated users will select at least a few of the fields.
How do I give each choice a numeric valve that I can sum in a textbox after the question? I'm sure this must be a FAQ somewhere but my coffee isn't doing it's job..
I've went down a lot of dead-ends yesterday (Validation/Assessment) but not making any headway.
The nice simple BMI example works perfectly on my survey but I'm struggling with this.
Any pointers would be much appreciated.
And my frazzled brain thinks the {sum} should be something like this
{sum(BIKE_SQ-1,BIKE_SQ-2, BIKE_SQ-3)}
but I'm sure that's wrong as well.
TVMIA
Derek
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
5 years 5 months ago #176095
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Setting Multiply Choice Values?
Maybe something like this:
Code:
{sum(if(BIKE_SQ1 == 'Y', 200, 0), if(BIKE_SQ2 == 'Y', 270, 0), if(BIKE_SQ3 == 'Y', 89, 0))}
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- minerva1961
- Topic Author
- Offline
- New Member
Less
More
- Posts: 5
- Thank you received: 0
5 years 5 months ago #176170
by minerva1961
Replied by minerva1961 on topic Setting Multiply Choice Values?
THANK YOU! That's really very very helpful!
Great stuff
Great stuff
The topic has been locked.