Do you use Alteryx in a language other than English? If so, we want to hear from you! Please help us improve the international experience of our products by participating in this 5 minute survey.

We are updating the requirements for Community registration. As of 7/21/21 all users will be required to register a phone number with their My Alteryx accounts. If you have already registered, you will be prompted on your next login to add your phone number.

Alteryx Designer Discussions

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

Union Two Data Table With All Field Names not Matching

soumyadipsarkar26
7 - Meteor

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
18 - Pollux

Hi @soumyadipsarkar26 

 

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

soumyadipsarkar26
7 - Meteor

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
15 - Aurora

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...

soumyadipsarkar26
7 - Meteor

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
15 - Aurora

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.

soumyadipsarkar26
7 - Meteor

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
15 - Aurora

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.

soumyadipsarkar26
7 - Meteor

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