Multiple IF statement
- 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
Team,
I would like to write an if or IIF statement in the alteryx formula and am unsure how to fix it.
=IF([Extend_Price]<>"",(IF([MultiYearDisc]<>"",IF([ReInst_Fee]<>"",([Extend_Price]+[ReInst_Fee] - [MultiYearDisc]),([Ext_ReinstFee]- [MultiYearDisc])),IF([ReInst_Fee] <>"",([Extend_Price] + [ReInst_Fee]),([Extend_Price])))),"")
Appreciate your help.
Regards,
Alwin
Solved! Go to Solution.
- Labels:
- Data Investigation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @allwynbazil
Based on the input shared it can achieved in Alteryx with the help of Formula or Multirow tool. That will be based on the dataset and logic to derive the solution.
Could you please share the sample data for columns [Extend_Price] [ReInst_Fee] [MultiYearDisc] [Ext_ReinstFee]
Can figure out the best possible tool (Formula or Multirow tool) to get the result.
Many thanks
Shanker V
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I think this does what you need. I've assumed the fields are numerical, so used IsNull rather than <>""
IF IsNull([Extend_Price]) THEN Null()
ELSEIF !IsNull([MultiYearDisc]) AND IsNull([ReInst_Fee]) THEN [Ext_ReinstFee]
ELSE [Extend_Price] ENDIF
+ IIF(IsNull([ReInst_Fee]),0,[ReInst_Fee])
- IIF(IsNull([MultiYearDisc]),0,[MultiYearDisc])
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
IIF(!isEmpty([Extend_Price]),(IIF(!isEmpty([MultiYearDisc]),IIF(!isEmpty([ReInst_Fee]),([Extend_Price]+[ReInst_Fee] - [MultiYearDisc]),([Ext_ReinstFee]- [MultiYearDisc])),IF([!isEmpty(ReInst_Fee]),([Extend_Price] + [ReInst_Fee]),([Extend_Price])))),Null())
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks Chriatina for quick turnaround. Works fine😊
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks @binuacs. Solution with IIF here. Appreciate your help.
