- Posts: 116
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Equation with if nested problem
- stevelegare
- Topic Author
- Offline
- Premium Member
Less
More
9 years 3 months ago #115786
by stevelegare
Equation with if nested problem was created by stevelegare
I have a IF nested statement like these and I can't show the default email.
Do you know why ?
q5 and q6 are dropdown lists.
{
if(q5 != '1', 'defaultemail',(
if(q6 == '1', 'email1',
if(q6 == '2', 'email2',
if(q6 == '3', 'email3',
if(q6 == '4', 'email4',
if(q6 == '5', 'email5',
if(q6 == '6', 'email6',
if(q6 == '7', 'email7',
if(q6 == '8', 'email8',
if(q6 == '9', 'email9',
if(q6 == '10', 'email10','default@fmed.ulaval.ca'
))))))))))))
}
Do you know why ?
q5 and q6 are dropdown lists.
{
if(q5 != '1', 'defaultemail',(
if(q6 == '1', 'email1',
if(q6 == '2', 'email2',
if(q6 == '3', 'email3',
if(q6 == '4', 'email4',
if(q6 == '5', 'email5',
if(q6 == '6', 'email6',
if(q6 == '7', 'email7',
if(q6 == '8', 'email8',
if(q6 == '9', 'email9',
if(q6 == '10', 'email10','default@fmed.ulaval.ca'
))))))))))))
}
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10611
- Thank you received: 3690
9 years 2 months ago - 9 years 2 months ago #115799
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 Equation with if nested problem
I think you may have an extra set of brackets in there:
Code:
{ if(q5 != '1', 'defaultemail', if(q6 == '1', 'email1', if(q6 == '2', 'email2', if(q6 == '3', 'email3', if(q6 == '4', 'email4', if(q6 == '5', 'email5', if(q6 == '6', 'email6', if(q6 == '7', 'email7', if(q6 == '8', 'email8', if(q6 == '9', 'email9', if(q6 == '10', 'email10','default@example.com' ))))))))))) }
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 9 years 2 months ago by tpartner.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13907
- Thank you received: 2546
9 years 2 months ago #115800
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 Equation with if nested problem
And { + line feed deactivate EM.
Code:
{if(q5 != '1', 'defaultemail', if(q6 == '1', 'email1', if(q6 == '2', 'email2', if(q6 == '3', 'email3', if(q6 == '4', 'email4', if(q6 == '5', 'email5', if(q6 == '6', 'email6', if(q6 == '7', 'email7', if(q6 == '8', 'email8', if(q6 == '9', 'email9', if(q6 == '10', 'email10','default@example.com' )))))))))))}
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.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10611
- Thank you received: 3690
9 years 2 months ago - 9 years 2 months ago #115802
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 Equation with if nested problem
I think it's best to avoid line-breaks entirely. I just put them in examples for clarity.And { + line feed deactivate EM.
.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 9 years 2 months ago by tpartner.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13907
- Thank you received: 2546
9 years 2 months ago #115804
by DenisChenu
In genral i use a lot of line break
And more sometimes i use something like this:
Just to allow the last , and the lat line.
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 Equation with if nested problem
Hi,tpartner wrote:
I think it's best to avoid line-breaks entirely. I just put them in examples for clarity.And { + line feed deactivate EM.
.
In genral i use a lot of line break
And more sometimes i use something like this:
Code:
{sum( ... a lot of line, all ending by , .... 0)}
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.