Alteryx Designer Desktop Discussions

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

How to loop within the value in the drop down list in alteryx apps

Inactive User
Not applicable

Hi, I am trying to build an alteryx app that read different excel (ie. Test 202101, Test 202102 and Test 202103)

 

for the current workflow, I only can read one excel at one time (eg. I choose "202101" in the drop down list, then Test 202101.xlsx will be shown)

 

but my desire workflow is, loop to read multiple excel with one input only (ie. i choose "from: 202101" and "to: 202103" in the drop down list, then "Test 202101.xlsx" would be read first, next "Test 202102.xlsx" would be input, and at last "Test 202103" would be read)

 

I think this is related to the loop concept? but I tried multiple time but still fail. Is there anyone can give me some recommendation or solution, please? thank you (hope my question is clear, haha

 

comecomeon_0-1670139925566.png

 

4 REPLIES 4
DawnDuong
13 - Pulsar
13 - Pulsar

Hi @Inactive User 

I think using "From" and "To" like this is likely not going to give you an elegant solution, and potentially not repeatable even if it works, because you are comparing the file names which sometimes may not follow consistent naming logic. This is not to mention that comparing String is non-trivial in Alteryx and you probably need to build a Macro.

 

For a more robust UI, I suggest that you use chained app that split this into 2 steps:

1) Step 1: Use a folder browse tool to generate a list of file names in your specified folder

2) Step 2: Use the output from Step 1 as input to Step 2 where you can via a ListBox Interface Tool select the files that you want to process.

Hope this helps.

Dawn.

 

 

Inactive User
Not applicable

thanks for the reply, sorry, i'm not really understand the suggestion

my current workflow and output is like this, Test 202101.xlsx is read. 

comecomeon_0-1670152782208.png

comecomeon_1-1670152897469.png

 

But my problem is there will be many input (eg, 202101, 202102, 202103, etc), which is the same workflow with "202101", 

the step is repeatitive

so I'm thinking how to build a alteryx apps that only need one click, instead of running the apps multiple times. thanks

 

DawnDuong
13 - Pulsar
13 - Pulsar

hi @Inactive User 

 

Let me try to answer a different way. 

 

Firstly, if you don't need to dynamically select the first and last file. That is, if you need to run all the files in a folder, check out this post.

https://community.alteryx.com/t5/Engine-Works/The-Ultimate-Alteryx-Holiday-gift-of-2015-Read-ALL-Excel-Macro/ba-p/9988

You can build it into an app by adding a Folder Browse tool element.

 

Secondly, if you really need to dynamically select which files you want to process, chain app is likely the best way. If you have not used chain app before, this is a good place to start https://community.alteryx.com/t5/Interactive-Lessons/Chaining-Analytic-Apps/ta-p/243120

- Browse Folder Tool allows user which folder they want to select and extract all the file names there.

DawnDuong_0-1670162486318.png

- The List Box Tool allows you to select one or more files to run the process.

DawnDuong_1-1670162549871.png

Both these tools have a one-workflow example which you can right-click to access.

After you select the Files that you want to process, you can use batch macros - for more information you can check it out here https://community.alteryx.com/t5/Interactive-Lessons/tkb-p/interactive-lessons/label-name/Macros

 

Dawn.

 

 

Inactive User
Not applicable

thanks for the detailed reply!

 

i understand about the chained app, folder browse and list box function

but I'm just wondering, because my current workflow include several type of input file (constant file, and dependent file such as Test 202101.xlsx), 

 

and the output and output name are different among each workflow run, for example

first run (drop down list input =202101): the output is "output 202101.xlsx"

second run (drop down list input =202102): the output is "output 202102.xlsx"

 

so is it possible to do it with one alteryx apps (ie. no need to execute the alteryx apps several times)

thanks so much

Labels