Multiple Conditions in Formula
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi,
I am trying to use multiple "IF" formulas on a data set but it is only picking up the last formula (ICCT4 - as seen in results window)
SOS!
Solved! Go to Solution.
- Labels:
- Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
You can use a switch formula: Switch(Value,Default,Case1,Result1,...,CaseN,ResultN) instead of multiple if.
https://help.alteryx.com/2018.2/Reference/Functions.htm
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@WilliamR wrote:You can use a switch formula: Switch(Value,Default,Case1,Result1,...,CaseN,ResultN) instead of multiple if.
https://help.alteryx.com/2018.2/Reference/Functions.htm
Hi William,
Thanks for getting back to me.
How would the Switch formula work as I can't seem to figure out what the Default, CaseN fields would include?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
You can also use ELSEIF.
So you could put all 4 of those into one:
IF [Zeus] = "265" THEN "ICCT1" ELSEIF [Zeus] = "266" THEN "ICCT2" ELSEIF [Zeus] = "290" THEN "ICCT3" ELSEIF [Zeus] = "190" THEN "ICCT4" ELSE "pending" ENDIF
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @emiafshar,
the syntax would be
Switch([Zeus],Null(),265,"ICCT1",266,"ICCT2",290,"ICCT3",....)
The Default value is used in the case where there is no associated value for one record, the default value would be used, so you can replace Null() by the value you want in this case.
Hope this help.
