Alteryx Designer Desktop Discussions

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

Using File name (ie. Sheet), Row and column position to spread Value columns in a table

lavorarchi
7 - Meteor

Hi I am working on a flow where I am taking data from individuals sheets of an Excel file and then trying to "re-construct" a table with a selective number of columns from each sheet based on a particular column header available within each sheet. So far I have got as far as this:

 

FileNameRowNumColumnNumValue
C:\Users\...xlsx|||Sheet114Sub 1
C:\Users\...xlsx|||Sheet124GBP
C:\Users\...xlsx|||Sheet142Sales
C:\Users\...xlsx|||Sheet14410000

 

I now need to stack each sheet on top of another so it looks like this:

 

 Sheet1Sub 1
 Sheet1GBP
SalesSheet110000

 

The position and label for Sub 1 is likely to be different in other sheets. So although it is titled Sub 1 in this scenario, in another file it might be called Sub 2.

 

Thank you all in advance.

5 REPLIES 5
messi007
15 - Aurora
15 - Aurora

@lavorarchi,

 

Could you share a workflow with a sample data in order 🙂

It will help to provide a solution.

 

Regards,

lavorarchi
7 - Meteor

Hi @messi007 thank you. Please find attached sample data and flow as required. 

OllieClarke
15 - Aurora
15 - Aurora

Hey @lavorarchi 

I'm not sure I fully understood your problem, but you can use a cross-tab tool to reconstruct a table using the column number and row number to place your values

OllieClarke_0-1614075938679.png

If you rename these fields with a dynamic rename tool taking field names from first row of data, then you end up with this: 

OllieClarke_1-1614075986647.png

If you have multiple sheets though, then it might be better to not rename the columns:

OllieClarke_2-1614076057835.png

 

Hope that helps,

 

Ollie

 

OllieClarke
15 - Aurora
15 - Aurora

Hi @lavorarchi 

Using your data a batch macro is actually the best approach

OllieClarke_0-1614077516590.png

the batch macro looks like this:

OllieClarke_1-1614077584120.png

The formula tool updating the recordID might need a bit of tweaking if there are more sheets with a different structure, but it worked well for the data you provided.

 

Hope that helps, Ollie

 

lavorarchi
7 - Meteor

Thank you ever so much. I am just trying to make sense of your two approaches. But looking good. Much appreciated. 

Labels