Alteryx Designer

Find answers, ask questions, and share expertise about Alteryx Designer.
Register for the upcoming Live Community Q&A Session - and don't forget to submit your questions for @DeanS regarding the future role of analytics here.
SOLVED

2 files - adding additional row with column names and adding new columns in the same time

Highlighted
5 - Atom

Hi,

 

I am new - of course I am - that is why I ask this question.

I have an issue with combining 2 files together - an example attached.

1 file contains multiple columns that have names and some rows with numbers/text in them

2nd file is a 2 row file. It contains the same names of the columns as the 1st file, plus some more columns with names. Also the second file contains another row - 2nd row are "explanations" for the column names in the 1st row.

 

The trick is to combine them together in a way to have all the names from the second file, all the explanations from the second file and also - the hardest part for me now - to move the data that is in the 1st file under specific name, to the proper name/column - that will be added/used from the second file.

 

If Anyone could help - I would be grateful.

Br, Maciej

 

Highlighted
9 - Comet

Well I'm 0-and-1 on recommending Union as an approach tonight but this seems to replicate your output. Depending on the requirements, may be able to use a Dynamic Rename (Developer Tools) if the values from the second file aren't needed in the data. Key thing may be setting the output order in the union. 

 

Output Order.png

 

Example output and workflow (also attached):

 

Example Workflow.png

Highlighted
8 - Asteroid

Hi,

This can be achieved by using a simple Union Tool configured to match by name of the field. Attached workflow for your reference.

 

Regards

Benn

 

P.S: In case this solves your query, kindly mark as solution.

 

Highlighted
5 - Atom

Hi,

Thx for the reply.

This would be good if column order was not important. But here it is - column names and the xplanations in the output should be as in 2nd file.

So the data from the 1st file - needs to be reorganized in order to fit the layout from the 2nd file... 

Highlighted
5 - Atom

Hi,

 

Thx for the answer. This workflow is really complicated Are all those steps necessary in order to compile the output as presented in my example ?

Highlighted
8 - Asteroid

Hi @MaciejL ,

Apologies for the error. I had accidentally uploaded a different workflow that I had created to bring an absolutely unstructured data into an analyzable form., hence the complication in the workflow. 

 

The workflow for your query was actually a very simple one, similar to what @mattreynolds had posted earlier. Attached below is my actual workflow for your query.

 

Bennel_Wilson_0-1589972770701.png

 

 

Regards

Benn.

 

P.S: If this solves your query, kindly mark it as Solution. 

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

Hi @MaciejL,

 

This is possible with a little bit of transformation:

 

Jonathan-Sherman_0-1589972803523.png

 

 

If this solves your issue please mark the answer as correct, if not let me know! I've attached my workflow for you to download if needed.

 

Regards,

Jonathan

Highlighted
5 - Atom

Thx,

 

At this point it is too complicated for me - of course this is a solution - but I will go with the simpler one from Benn

Labels