Alteryx Designer Desktop Discussions

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

Can't figure out how to input directory / specific sheet and rename columns

slaurel
8 - Asteroid

I could really use some assistance with something I thought was straightforward, but it is not working for me. Greatly appreciate it!

 

I have a directory with roughly 25 files and they all have one common sheet called "Summary". However, a couple of the files do not have the sheet, so I need my workflow to disregard files with no "Summary" tab. I tried inputting a directory and using a dynamic input + filter and it errored no matter what I tried. Do I need a macro as well?

 

The second part of this is that I need to transform my data. after all of the summary tab data is stacked (with a field for filename so we can differentiate). Here is the tricky part.

 

1. I need the value in G2 (highlighted in red) from each file, but it is way at the top and the format of these files will always come in the same, so I cannot manually move it. I do not need any of the other blank cells surrounding it. It will always be in G2. 

2. The column headers start at row 51 but some of them are separated into multiple cells (like Employee health values. Employee is in row 51, health is in 52 and the other part of the phrase is in 53. 

3. I have to rename all of these column headers based on their original name because in some of the files, the column positions are slightly off (names will always be the same). For example in this file, "Food" starts in Column L, but in another file it may start in column K. so that is why it is important they are being read correctly despite some of them being on multiple lines. (I highlighted in green what the columns should be renamed to. This row will NOT be part of the normal files.)

 

Feel free to create 2-3 files with random data (same columns) to test

 

Example.JPG

1 REPLY 1
binuacs
20 - Arcturus

@slaurel use a batch macro to read your sheet names from the directory, filter-out only the summary tab, then use another batch macro to read the content of the files (which will read only from the summary sheet)

 

for the rest of the usecase provide a sample input file and expected output file

image.png

Labels