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

Alteryx Designer Desktop Discussions

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

Get multiple columns for all the paranthesis within brackets

maygoyal
5 - Atom

Hello,

 

I want to extract all the data from within IF(G2<10,H2,IF(E2<F2,H2,C2)) so as two columns are created from the two closed brackets. One would give 'G2<10,H2,IF(E2<F2,H2,C2)' and the next would give IF(E2<F2,H2,C2).

 

How can I perform the same?

2 REPLIES 2
Yoshiro_Fujimori
15 - Aurora

(Edited for more simplicity)

 

Hi @maygoyal ,

 

I interpret your Excel formula as the below Truth Table.

G2<10E2<F2Column1Column2
TRUETRUEH2H2
TRUEFALSEH2C2
FALSETRUEH2H2
FALSEFALSEC2C2

 

Unlike Excel, Alteryx deals with the data for each row, not for specific cells.

So I prepared the input data as below, so that all the pattens in the truth table are covered.

Yoshiro_Fujimori_2-1683464184509.png

 

Expressions in Formula tool

Column1 = IF [G] < 10 THEN [H] ELSEIF [E] <[F] THEN [H] ELSE [C] ENDIF

Column2 = IF [E] < [F] THEN [H] ELSE [C] ENDIF

 

Output

Yoshiro_Fujimori_1-1683464064278.png

 

I hope this helps. Good luck.

RobertOdera
13 - Pulsar

Hi, @maygoyal 

 

It's best if you provide a sample 😎

 

Kindly see the below - I hope you find it helpful. Cheers.

 

1st Column given by 

IF G <10 THEN H
ELSEIF E <F THEN H
ELSE C
ENDIF

 

2nd Column given by

IF E <F THEN H
ELSE C
ENDIF

 

RobertOdera_0-1683470374801.png

 

From the logic, it seems that 1st is always equivalent to 2nd.

Labels
Top Solution Authors