Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

If Formula = Adding 2 Columns together

NadiaFS
7 - Meteor

Hi Community

 

I am trying to use an IF formula to Add 2 Columns together if certain criteria are met. 

 

The output seems to only give me the 'Asset Value' number if the criteria are met, as opposed to summing the two (Asset Value + Right_Asset Value). I only want it in this particular instance. 

 

Any help modifying this formula to get it to work would be much appreciated. 

 

If([Filer] = "LIBC" and [Name of Exposure] = "Fannie Mae" )THEN
([Asset Value]+[Right_Asset Value]) ELSE
[Right_Asset Value]
ENDIF

 

 

4 REPLIES 4
ShankerV
17 - Castor

Hi @NadiaFS 

 

Try the below, 

 

IF ([Filer] = "LIBC" and [Name of Exposure] = "Fannie Mae" )

THEN [Asset Value]

ELSE ([Asset Value]+[Right_Asset Value])
ENDIF

 

Note: If I had understood the request correctly, when the condition is met only the value of [Asset Value] needs to be displayed.

If the condition fails, then it need to sum [Asset Value]+[Right_Asset Value]

NadiaFS
7 - Meteor

Hi @ShankerV 

 

It is the opposite. So if the conditions are met, then we need to Sum the 2 columns, if not met, then just use the original column.

 

It seems to just take the first part of the Sum formula, being it switches the number from 'Right_Asset Value" to "Asset Value" if the criteria are met as opposed to summing the two values. I am not sure how to adjust the formula to get it to work. 

Aryasuta_Panda
7 - Meteor

Hi NadiaFS, The formula works for me. Please find attached.

 

Thank you.

ShankerV
17 - Castor

Hi @NadiaFS 

 

Try the below, it will help to convert into integer and perform the sum.

 

IF ([Filer] = "LIBC" and [Name of Exposure] = "Fannie Mae" )

THEN tonumber([Asset Value]) + tonumber([Right_Asset Value])

ELSE tonumber([Right_Asset Value])
ENDIF

 

Hope this helps to resolve your issue!!!

Note: If it still persists, can you please share the sample screenshot of the values with error

Labels