Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Community is experiencing an influx of spam. As we work toward a solution, please use the 'Notify Moderator' option on the ellipsis menu to flag inappropriate posts.

Alteryx Designer Desktop Discussions

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

Input Excel Table where file name contains either one or another string

pohrt
8 - Asteroid

I have a folder with several Excel Files (more than 2).

There are 2 options for the Excel File that I want to import as Import Data.

 

1) Excel File name contains "*GERMANY*" and Sheet name is "Blatt 1" OR

2) Excel File name contains "*AUSTRALIA*" and Sheet name is "Sheet 1"

 

Only ONE of these 2 Excel Sheets is ever in that folder.

I want Alteryx to use the one that is there as INPUT Data.

(I know how to use Asterisk to import an Excel Table with "contains in file name" but these are 2 different Excel Sheets) 

 

Can this be done automatically?

Hope this makes sense?

 

Thanks, 

Petra

4 REPLIES 4
Qiu
21 - Polaris
21 - Polaris

@pohrt 

Since you already know how to use Asterisk to import an Excel Table, how about import all the data in that folder.

Then use a filter tool to filter by File and Sheet Name.

GaneshBo
Alteryx
Alteryx

Hi @pohrt ,

 

This is a great use case for batch macro. In my folder, I have the following files with the respective sheet names that you have mentioned: 

GaneshBo_0-1610425222579.png

 

In order to read in the files with different sheet names at the same time, you'll need the following string for each of the files. This is how Alteryx reads in the Excel files with specific sheets. 

GaneshBo_1-1610425589163.png

 

You would do this by using the directory tool and formula tool, after which you can use the batch macro and read in all your files.

GaneshBo_2-1610425665685.png

I hope this helps! Attached is the sample workflow with the macro.

 

Best,

Ganesh

 

pohrt
8 - Asteroid

Hello Qiu,

 

thanks for your quick reply. I could give that a try ... still there might be lots of Excel Sheets in that Folder with all sorts of different Column setups.

I would take some time. then I still need to ask the question with the filter: Does this big file contains GERMANY or AUSTRALIA?

 

I will play with this but was hoping that I did not have to import all Data from all Excel Sheets.

 

Thanks, 

Petra

Qiu
21 - Polaris
21 - Polaris

@pohrt 
Lets do the filtering before importing the data.

0112-pohrt.PNG

Labels