Expand my Community achievements bar.

How can I combine these multiple IF statements for use in a calculated field?

Avatar

Level 9
How can I combine these multiple IF statements for use in a calculated field? IF({What is your line of business?}="PSG","PSG"), IF({What is your line of business?}="RPS","RPS"), IF({What is your line of business?}="GOV","GOV"), IF({What is your line of business?}="FUT","FUT"), IF({What is your line of business?}="CORP","CORP") I just want one value to display in the calculated field = either PSG, RPS, GOV, CORP, or FUT. Any suggestions?
3 Replies

Avatar

Level 9
For anyone that stumbles upon this later, here was the answer: IF({What is your line of business?}="PSG","PSG", IF({What is your line of business?}="RPS","RPS", IF({What is your line of business?}="GOV","GOV", IF({What is your line of business?}="FUT","FUT", IF({What is your line of business?}="CORP","CORP")))))

Avatar

Community Advisor
Glad you got it going Christina, Assuming this is a dropdown, since your formula effectively checks the value of the "What is your line of business?" parameter than then returns that value, I wonder if the formula could simply have instead been ={DE:What is your line of business?} which I believe would yield the same result. If there is some other reason to use a formula (e.g. I sometimes do so to consolidate dropdowns values into broader categories), the formula you're using would make a better starting point, but in that case, I'd also suggest you add a final else value as a safety net clause , for when (eventually) some new dropdown option is added, as a reminder that this formula needs to then be updated accordingly: IF({What is your line of business?}="PSG","PSG", IF({What is your line of business?}="RPS","RPS", IF({What is your line of business?}="GOV","GOV", IF({What is your line of business?}="FUT","FUT", IF({What is your line of business?}="CORP","CORP" ,"UNKNOWN" ))))) Regards, Doug Doug Den Hoed - AtAppStore

Hi Doug, related to your solution above, is there a way to return the value(s) from one multi-select custom field that lives in a group of multi-select custom fields? For example, {DE:What is your line of business?} and {DE:What is your favorite color} and {DE:What is your pet's name?} sit on the same project form, and only one is required to be filled out, so we would only need return the value(s) that were selected from that one field?