We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Need help in creating a formula for IF Else statement

jatienza
8 - Asteroid

Hi Team,

 

I have this data below and just need a formula like If Else Statement to come up with the Output as shown below. The formula should not limit only to Job_3_value and Job_3_title. It would also allow if there are job_4_value or job_5_value, etc.

 

RecordJob_1_valueJob_1_titleJob_2_valueJob_1_titleJob_3_valueJob_3_title
A1Manager0 0 
B0 0 1Instructor
C0 1Director0 

 

Output:

Job Title
Manager
Instructor
Director

 

Thanks,

Jaime

8 REPLIES 8
Luke_C
17 - Castor
17 - Castor

Hi @jatienza 

 

I wouldn't use an if statement to do this given the variability in how many columns it needs to handle. I'd recommend something like this:

 

  1. Transpose the data (this will handle any new columns in the future)
  2. Filter to 'title' records with a value.

You can then update further via a select tool to reduce/rename the columns

 

Luke_C_0-1671830831729.png

 

 

Felipe_Ribeir0
16 - Nebula

Hi @jatienza 

 

One way of doing this

 

Felipe_Ribeir0_0-1671831024768.png

 

jatienza
8 - Asteroid

Hi!

 

Sorry I think this is the correct raw data. So if the value is 1 then it will get the correct job title. It should allow if there are additional column for job_4_ value, etc.

 

RecordJob_1_valueJob_1_titleJob_2_valueJob_1_titleJob_3_valueJob_3_title
A1Manager0Specialist0Loan Processor
B0Programmer0Supervisor1Instructor
C0CEO1Director0Supervisor

 

Output

Job Title
Manager
Instructor
Director

 

Thanks,

Jaime

PanPP
Alteryx Alumni (Retired)

Hi @jatienza 

 

I have provided a sample WF.

Luke_C
17 - Castor
17 - Castor

Hi @jatienza 

 

Here's two ways - one with the make columns tool and one with the multirow formula tool to flag records that have the '1' in the value column.

 

Luke_C_0-1671831798332.png

 

 

Felipe_Ribeir0
16 - Nebula

Hi @jatienza 

 

One way of doing this

 

Felipe_Ribeir0_0-1671831972528.png

 

jatienza
8 - Asteroid

Thanks a lot for your help guys...

 

binuacs
21 - Polaris

@jatienza One way of doing this

 

binuacs_1-1671833564665.png

 

 

Labels
Top Solution Authors