Hello everyone,
I am stuck on creating a nested “if” statement for survey123 calculation. Here is my workflow: I have a “select multiple” question and I want to capture on a separate field a integer value depending on the selection (see attached pic). For example, selecting A, B or C will get a value of 1; selecting D or E will get a value of 2’ and F a value of 3. The problem is that I don’t know how to set-up the condition to assign 2 when D or E are selected even if any of the ABC are also selected, or value of 3 if F is selected and any of the other values are also selected. Thanks for any suggestion on how to accomplish this!
JB
Solved! Go to Solution.
I think I figured it out!. Here is the "if" nested statement that I created just in case anyone have the same need! I had to set the statement on reverse to work!
if(selected(${lettertype},'F'),3, if(selected(${letterwtype},'E') or selected(${lettertype},'D’),2, if(selected(${lettertype},'C') or selected(${lettertype},'B') or selected(${lettertype},'A'),1,"0")))
Thanks,
JB
I think I figured it out!. Here is the "if" nested statement that I created just in case anyone have the same need! I had to set the statement on reverse to work!
if(selected(${lettertype},'F'),3, if(selected(${letterwtype},'E') or selected(${lettertype},'D’),2, if(selected(${lettertype},'C') or selected(${lettertype},'B') or selected(${lettertype},'A'),1,"0")))
Thanks,
JB