Alteryx Designer Desktop Discussions

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

Union with Header Name in the output

Alteryxexpert
8 - Asteroid

I'm Doing a union of 4 output of a Alteryx workflow and need to write it into excel file, for this I need to populate the header names of all the four data in the final output.

 

Is this feasible in Alteryx?

 

Output Data Looks like below. 4 are 4 different outputs(20+Columns) which need to be merged with column names and written to a excel file.

ItemSubproduct20232024202520262028
OfficeMouse156651
OfficeKeyboard156651
OfficeMonitor156651
FurnChair156651
FurnTable156651
       
       
       
       
       
Item1Subproduct20232024202520262028
OfficeMouse156651
OfficeKeyboard156651
OfficeMonitor156651
FurnChair156651
FurnTable156651
       
       
       
       
       
Item2Subproduct20232024202520262028
OfficeMouse156651
OfficeKeyboard156651
OfficeMonitor156651
FurnChair156651
FurnTable156651
       
       
       
       
       
Item3Subproduct20232024202520262028
OfficeMouse156651
OfficeKeyboard156651
OfficeMonitor156651
FurnChair156651
FurnTable156651

 

 

2 REPLIES 2
Qiu
21 - Polaris
21 - Polaris

@Alteryxexpert 
Maybe we can try the option of "Manually Configure Fields" in the Union tool as below.

0429-Alteryxexpert.png

Rhys_Cooper
8 - Asteroid

Hi @Alteryxexpert  thank you for your question. I have attatched a workflow with my solution with a small example using two sheets you want to union along with the headers. It is a dynamic solution such that you should be able to expand this to as many sheets you have, especially if you package it into a batch macro ( can provide help on this too if needed). I have done it for stacking the same sheet for simplicity hence the repeated numbers in the output, natrually you would replace this with 4 input streams.

 

Steps per sheet:

1. extract the headers using the fields info tool, cross tab to get them horizontal again

2. union the headers (to be used at the top of the next sheet) to the bottom of the prior sheet

 

Steps for unioned sheets:

1. union all these processed sheets on top of eachother

2. add a field using the append fields tool to track which number it is in the series.

3. use the multirow formula tool to calculate each sheets appropriate series number

 

Dynamically renaming the Item field header to reflect the series number

1. use the formula tool to append the series number from the "series identifier" column

2. drop the series indentifer column as it is no longer needed

 

Screenshot 2024-04-29 093055.png

 

 

 

Labels