Alteryx Designer Desktop Discussions

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

Union the data based on the field name

Kaustubh17
8 - Asteroid

Hi team,

 

I have data in the Alteryx in the below format of the headers.

 

CategoryUnitPlant1Apr-23May-23Jun-23Plant2Apr-23May-23Jun-23

 

 and so on till Plant14

 

I want the union the data based on Plant 1 , Plant 2 and So on.

 

Below is the result format.

 

CategoryUnitPlant1Apr-23May-23Jun-23Jul-23Aug-23Sep-23FY 24
AXABCAny value      
BYABC       
CZABC       
CategoryUnitPlant2Apr-23May-23Jun-23Jul-23Aug-23Sep-23FY 24

 

 

And so on till Plant 14.

 

 

I have approximate 14 Plants so i want the union of each plant below each other.. Please let me know if you have any questions.

 

Best Regards,

Kaustubh

9 REPLIES 9
KGT
10 - Fireball

Easiest way is to bring the data in with headers in the first row (option in the input tool) and then 14 select tools running parallel followed by union and dynamic rename (could be Dynamic renames, then union depending on data consistentency)

 

The better way I can visualise this is by tagging the headers.

  1. Sample the first row, just so there's less data and tag the headers using transpose and formula
  2. Transpose the dataset and clean it up and then a multi-row to label the plant.
  3. Join the new headers back on to the cleansed/transposed dataset
  4. Filter and crosstab (filter isn't needed, just used to clean up data for the concatenate.

AlteryxGui_0RcJ2rylBw.png

 

There are many other ways including Dynamic Selects and macros, but I think Transpose and cross-tab are your friends here.

apathetichell
19 - Altair

This isn't really what Alteryx is designed for. You could output each plant on a seperate sheet dynamically - or you could use table/layout/union/summarize/render to put them horizontally on the same excel.

 

If I had to do what you are looking at though - the two ways would be create a column for plant id. create a new header row. append your header row. dynamically take fieldnames form header row. convert types as needed since everything is now a string. drop uneeded column.

 

way 2- something with a batch macro/union where I run for each plantid group and change the header value dynamically.

Kaustubh17
8 - Asteroid

Hi @KGT 

I applied the below steps but the output is not desired thanks for you valuable input.  the result which i am getting which is random rows. but i am looking for the result, which just move the each plant segregated data below each out the format, alignment should be same. Please let me know if you have any other way. I am sharing the result format below.

CategoryUnitPlant1AprMayJunJulAugSepFY
AXa       
BYa       
CategoryUnitPlant2AprMayJunJulAugSepFY
AXb      

 

BYb       

 

and so on i have over all 14 Plant Same category same Unit, but values are different.

 

Please let me know if you have any question.

 

Best Regards,

Kaustubh

apathetichell
19 - Altair

post some sample data with the sample schema.

KGT
10 - Fireball

I'm not sure what you're after... the solution I posted on the last post takes the data from:

 

AlteryxGui_ttDNyL18Ri.png

 

And transforms it to this:

 

AlteryxGui_3ujVQS0ePs.png

 

You can always put other steps in the middle or at the end to rename the fields if needed. If it's different to that, then I would need to see something clearer about what the issue is.

Kaustubh17
8 - Asteroid

HI @KGT ,

 

The below result is in correct format, did you use the same workflow to create the result. Or you create another flow? Because the result which you shared is correct.

 

Please let me know the process behind that

 

Best Regards,

Kaustubh

Pang_Hee_Choy
12 - Quasar

@Kaustubh17  can you confirm the input format and output format?

i think we confuse on what is the input and output. 

 

here my try,

 

with input:

Screenshot 2024-07-15 165325.png

and output:

Screenshot 2024-07-15 165339.png

 

workflow:

Screenshot 2024-07-15 165508.png

macro:

Screenshot 2024-07-15 165518.png

Kaustubh17
8 - Asteroid

Hi @apathetichell 

Please find the Attached excel with input sheet and output sheet.

 

Please let me know if you require any other things from my end.

 

Best Regards,

Kaustubh

Kaustubh17
8 - Asteroid

Hi @Pang_Hee_Choy 

 

Please find the attached excel with input format and output format.

 

Please let me know if you need any other thing from my end.

 

Best Regards,

Kaustubh

Labels