Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Union Two Data Table With All Field Names not Matching

DataPirate26
10 - Fireball

I want to Union two Data Table, File 1 and File 2. These two data tables have Field names where few of them are same and few of the field names are not. Now the union of the two tables should be such as the common field name should come in the same Vertical column but for both tables the header should be present as shown in the sample Output. The basic moto is to compare the data of File 1 and File 2 and calculate the difference of the Hours Given. 

8 REPLIES 8
atcodedog05
22 - Nova
22 - Nova

Hi @DataPirate26 

 

Are you saying you 2 want tables come one below other. Your explanation and expected output is really confusing. 

DataPirate26
10 - Fireball

Yes the two table will come one below other but two table are not having all the Field names in common so we cannot Union By Name. Also I need the Column Header for both Tables As shown in the Output , only thing is the common fields should be in the same vertical column.

 

As attached in the screenshot below the date 1/11/2021 should come in the same vertical column.

apathetichell
18 - Pollux

Hi. Yes. you do want to union by name. You need to make sure that you have it set up to output all fields and to ignore and continue processing records when fields differ...

DataPirate26
10 - Fireball

If i do Auto Configure by name then I won't get the Headers for the 2nd file that is the challenge. I want to stack both the tables one above the other and both the tables should have their Headers only thing is that the common Headers should be be in the same Vertical Column. If you see the sample image I have mentioned what is the main requirement. 

apathetichell
18 - Pollux

Are you talking about headers which are inside of your data - so they aren't column headers - they are like excel headers inside of your data like record 1 has some info that you are calling a header?  You get field names when you auto configure by name if you output all fields - so because that's not working for you - I assume you are talking about data which is in the actual datastream but you are calling headers. Post some data - you can do what you want - but you'll need to provide some sample data with what you want. It sounds like the easiest way will be to recordid the first group- and then record id the second group starting after. Then you can sort and the "headers" will be at the first record id in the second group.... I don't think you'll be able to use the data for much though.

DataPirate26
10 - Fireball

Yes the Headers Inside my data I am talking about and that is how after transforming the data I have got the output. So basically Those Headers are coming from File 2 if you see the Input Tab which I have shared there are 2 files ( File 1 and File 2). Those 2 needs to be appended one above the other and the Headers should also be there for both.

 

Only challenge is The common Headers Fields should be in the same Vertical Columns Keeping the Headers for both the tables. Is there a way that can be done ?

 

apathetichell
18 - Pollux

As mentioned. post some data. The easiest way is to set up union for manually configured fields and then you can align them as you want.

DataPirate26
10 - Fireball

Sir I have already Posted the Input sample data set and the output sample data set still providing one more time. File 1 is input 1 and File 2 is Input 2 as mentioned in the Input Data tab. 

 

The Output Tab shows how the output will look. If there are 52 fields we can't manually configure it no that is the challenge. Is there any other way to align the common fields in the same vertical column. 

 

Attached below is the sample data. 

Labels