Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Multiple IF statement

allwynbazil
8 - Asteroid

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

5 REPLIES 5
ShankerV
17 - Castor

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

Christina_H
14 - Magnetar

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])

binuacs
20 - Arcturus

@allwynbazil 

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())
allwynbazil
8 - Asteroid

Thanks Chriatina for quick turnaround. Works fine😊

allwynbazil
8 - Asteroid

Thanks @binuacs. Solution with IIF here. Appreciate your help.

Labels