How to combine two or more conditional statement in one function?

1860
2
Jump to solution
10-11-2017 07:38 AM
AdministratorAGOL_ODIMM
New Contributor III

Situation:

Q1. Select one question with answers A, B, C, D

Q2. integer or hidden question, calculate using conditional statement: if(selected(${Q1},'A'),1,10) OR if(selected(${Q1},'B'),3,10)

giving points in Q2 depending on the response in Q1

A=1

B=2

C,D =10

How to combine this two conditional statement in one function?

0 Kudos
1 Solution

Accepted Solutions
NickDierks
New Contributor III

You should be able to nest your if/then statements: if(selected(${Q1},'A'),1, if(selected(${Q1},'B'),3,10))

This will run your second if/then as the else case of your first if/then, and if neither condition is met, then the second else case is the final result.

View solution in original post

2 Replies
NickDierks
New Contributor III

You should be able to nest your if/then statements: if(selected(${Q1},'A'),1, if(selected(${Q1},'B'),3,10))

This will run your second if/then as the else case of your first if/then, and if neither condition is met, then the second else case is the final result.

AdministratorAGOL_ODIMM
New Contributor III

It works, thx a lot Nick!

0 Kudos