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

Formula Multiple condition

Devika
8 - Asteroid

Hello,

 

Please help me with the formula.

Condition description

New column to be created with condition that Seccode1 should be equal to Sedol and if sedol is missing then Isin and also if Isin and Sedol both missing then Cusip.

 

Input Input Input Output 
Isin     Sedol     Cusip     Secode1
US3140QKGB85 3140QKGB8US3140QKGB85
SE0005676608BPXR9R2W77537SD6BPXR9R2
BMG9156K1018BF5BLM1G9156K101BF5BLM1
BMG9156K1018BF5BLM1G9156K101BF5BLM1
AU0000157067BNNVRL0Q9269W108BNNVRL0
  901384107901384107
KYG8875G1029BY9D3L9G8875G102BY9D3L9
  U81522AG6U81522AG6
2 REPLIES 2
SPetrie
13 - Pulsar

An if elseif should work

if !IsEmpty([Sedol]) then [Sedol] elseif !IsEmpty([Isin])then [Isin] else [Cusip] endif

SPetrie_0-1680818871442.png

SPetrie_1-1680818930273.png

 

 

martinding
13 - Pulsar

Hi @Devika,

 

The formula @SPetrie provided is perfect!

 

To help you understand how IF-ELSEIF-ELSE works, I've provided another example, where all the conditions are positive (e.g. no "!"/not).

martinding_0-1680822868176.png

 

 

Note, the ordering is very important.

The statements are evaluated from top to bottom. So for example, if we wrote

"IF ISEMPTY([Sedol]) THEN [Isin] " first, then it will give a different result.

martinding_0-1680823210594.png

 

 

 

 

Labels