- Posts: 8
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Equals sum value over 2 separate questions?
- AmirahR247
- Topic Author
- Offline
- New Member
Less
More
1 month 1 week ago #258574
by AmirahR247
Equals sum value over 2 separate questions? was created by AmirahR247
Please help us help you and fill where relevant:
Your LimeSurvey version: [see right hand bottom of your LimeSurvey admin screen]
Own server or LimeSurvey hosting:
Survey theme/template:
==================
Hi there,
Is there a way to have a maximum sum value over 2 separate questions?
The first question is a numerical input & asks the percentage of main milk brand usage (Milk 1), the next question is a multiple numerical input and asks the percentage of other milk brand usage (Milk 2, Milk 3 etc.).
How can I get the total usage percentage to not exceed 100%? So if in Q1 Milk 1 = 60%, in Q2 Milk 2 + Milk 3 should be forced to sum to 40% (Q2 should be 100%-Q1)
Thanks
Your LimeSurvey version: [see right hand bottom of your LimeSurvey admin screen]
Own server or LimeSurvey hosting:
Survey theme/template:
==================
Hi there,
Is there a way to have a maximum sum value over 2 separate questions?
The first question is a numerical input & asks the percentage of main milk brand usage (Milk 1), the next question is a multiple numerical input and asks the percentage of other milk brand usage (Milk 2, Milk 3 etc.).
How can I get the total usage percentage to not exceed 100%? So if in Q1 Milk 1 = 60%, in Q2 Milk 2 + Milk 3 should be forced to sum to 40% (Q2 should be 100%-Q1)
Thanks
Please Log in to join the conversation.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13648
- Thank you received: 2491
1 month 1 week ago #258575
by DenisChenu
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.
Replied by DenisChenu on topic Equals sum value over 2 separate questions?
On Q2 : {sum(Q1.NAOK,Q2.NAOK) < le 100}
manual.limesurvey.org/Question_type_-_Nu...28em_validation_q.29
manual.limesurvey.org/Question_type_-_Nu...28em_validation_q.29
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.
Please Log in to join the conversation.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
1 month 1 week ago - 1 month 1 week ago #258581
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 Equals sum value over 2 separate questions?
If Q2 is a multi-numeric, I think its validation equation should be:
Or:
Code:
sum(Q1, self) <= 100
Or:
Code:
sum(Q1, that.Q2) <= 100
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 1 month 1 week ago by tpartner.
The following user(s) said Thank You: DenisChenu
Please Log in to join the conversation.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11660
- Thank you received: 2742
1 month 1 week ago #258585
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Equals sum value over 2 separate questions?
Why not putting all milk brands into 1 multiple numerical question? For sure would be a lot more userfriendly for the respondent to fill and you can show how much they have already distributed from the 100%.
1. Main milk brand
2. Second brand
3. Third brand...
1. Main milk brand
2. Second brand
3. Third brand...
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Please Log in to join the conversation.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13648
- Thank you received: 2491
1 month 1 week ago #258587
by DenisChenu
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.
Replied by DenisChenu on topic Equals sum value over 2 separate questions?
Yes ! You're right !If Q2 is a multi-numeric, I think its validation equation should be:
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.
Please Log in to join the conversation.