Alteryx Designer Desktop Discussions

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

Alteryx beginner - IF THEN formula

RNSEG
7 - Meteor

Hello, 

 

I am attempting to create a function where a certain column (column Name: Switches) consists of numeric values (either 0, Positive Value, or Negative Value) 

 

I am having troubles trying to complete the formula where any rows that have a positive value in the Switches column are added to the Column: Contributions and the negative amounts are then added to the Column: Redemptions. 

 

Could i please get assistance on this? Thank you in advance.

2 REPLIES 2
SPetrie
13 - Pulsar

Easiest way is to apply one formula to each of the Redemptions and Contributions columns.

For the Contributions column, for example, your formula would be

if [Switches]>0 then [Contributions]+[Switches] else [Contributions] endif

Check if switches has a value greater than 0 and add it to the value in the contributions row, its the value is not greater than 0 then leave it as whatever is curently in the contributions column.

If you prefer a more Excel style formula, you can also use IIF([Switches]>0,[Contributions]+[Switches],[Contributions])

Do the same thing for Redemptions but checking for less than 0.

I used both types of formulas in my formula tool example here.

SPetrie_1-1681414870680.png

 

SPetrie_0-1681414849497.png

 

RNSEG
7 - Meteor

Thank you very much - this helped perfectly!

Labels