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?
2 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

Level 10
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