Alteryx Designer Desktop Discussions

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

Create new column header if not found.

fikrizahari
8 - Asteroid

Hi,

Greetings !

I would like to know whether there is tools / formula to create a new column title/header, if it cannot be found before.
The reason is : final output require the show all column title.

Below is the example ( assume the table from client ) :

Employee NameMonthly SalaryWagetypeAmount
Angeline4349.17House Allowance300
Bruce7722.43House Allowance300
Charlotte10483.33House Allowance300
Dallot7558.69WFH Allowance100
Eugene10483.33WFH Allowance100
Friore14016.9WFH Allowance100
Glaze14016.9WFH Allowance100
Heather4158.33WFH Allowance100
Angeline4349.17Lunch Allowance50
Bruce7722.43Lunch Allowance50
Charlotte10483.33Dental Reimbursement51
Charlotte10483.33Dental Reimbursement71
Dallot7558.69Dental Reimbursement43
Eugene10483.33Dental Reimbursement56



Currently, i only use 'Cross Tab' and 'Formula' tools to get below result :

Employee NameMonthly SalaryDental_ReimbursementHouse_AllowanceLunch_AllowanceWFH_AllowanceAnnual BonusPhone Allowance
Charlotte10483.33122300  00
Friore14016.9   10000
Bruce7722.43 30050 00
Eugene10483.3356  10000
Heather4158.33   10000
Dallot7558.6943  10000
Glaze14016.9   10000
Angeline4349.17 30050 00



The issue : there is possibility that the input file contain amount for 'Phone Allowance' and 'Annual bonus'.
In that case, I do not want the formula tools to create 'Phone Allowance' and 'Annual bonus'.

Thanks in advance !

1 REPLY 1
ArnaldoSandoval
12 - Quasar

Hi fikrizahari,

 

There is already a macro to add missing columns, it was developed 10 years ago, and here is its documentation: Alteryx: Ensuring fields are in a data stream ; now when

 

I tried to implement it in your workflow, I did not need it 😳 but it could be I missunderstood your question, anyhow, this is workflow screenshot:

 

This is how I introduced the Annual Bonus and Phone Allowance columns:

2023_04_03_Create_New_Column_01.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

..

This is the workflow supporting these new columns, no need to impelement the macro

2023_04_03_Create_New_Column_02.png

 

HTH

Arnaldo

 

 

 

Labels