Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Multiple IF Statements

quims
8 - Asteroid

Hi Alteryx Community,

 

I'm Quims and new to Atlteryx, i would like to seek an advise on how to place IFs correctly in a formula function.

 

My Statements are:

If [Revenue] is equal or less than 0 then [Allocation] will be same as [Revenue]

If [Expense] is equal or less than 0 then [Allocation] will be same as [Expense]

If [Revenue] [Expense] is greater than 0 then [Allocation] will calculate based on formula i stated.

 

Default formula:

([Total Revenue]*[Expense])/[Total Expense]

 

Thanks in advna

4 REPLIES 4
MarqueeCrew
20 - Arcturus
20 - Arcturus

@quims ,

 

 how about trying this:

 

If [Revenue] <= 0 then [Revenue]

ELSEIF [Expense] <= 0 then [Expense]

ELSEIF [Revenue] > 0 AND [Expense] > 0 then 

([Total Revenue]*[Expense])/[Total Expense]

ELSE

Null()

ENDIF

 

 CHEERS,

 

 mark

 

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
afv2688
16 - Nebula
16 - Nebula

Hello @quims ,

 

You can use these:

 

Untitled.png

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Regards

quims
8 - Asteroid

Thank you, @afv2688,

 

Sorry, this should be my actual results when do it manually.

quims_0-1580375950007.png

 

SN# 1 and 2 is formula by default but when applying it to SN# 3, 4 and 5, shouldn't 0 in Allocation column. I want it to reflect in Allocation column the number from Expense and Revenue if i got 0 results whether in Total Revenue or Total Expense Columns.

 

 

quims
8 - Asteroid

@

 

Labels