Alteryx Designer Desktop Discussions

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

Dynamically change file with multiple tabs

peterg97
7 - Meteor

Hi, 

 

I am building a workflow, and it will need updated every month with the new file. I will be manipulating the data from 2 seperate  tabs in the file, and then joining it together. I would like this to be as dynamic as possible for when someone else has to use it, for example when they run as analytic app, they will just have to select the new file path and the rest will work itself. At the moment, if I run as analytic app, I can choose the file path but after I run, the directory hasn't changed. Ideally, if there is a way to dynamically select a file and then have separate processes for the different tabs, that would work best. Any ideas?

 

Thanks!

 

 peterg97_0-1608656039984.png

 

6 REPLIES 6

Hi @peterg97 

 

You can continue to use "Directory" then you can :

 

1- Perhaps add a "Filter" tool to select the desired file based on its name. For example if it includes month name, you can use a formula that dynamically looks at today's date to find last month.

 

2- You can add a "Sort" based on last write time/creation time (newest to oldest) and with a Sample tool of 1, you will be sure you are looking at the most updated file.

 

These are some ideas.. Hope that helps. Cheers!

peterg97
7 - Meteor

Hi @christine_assaad

 

Thanks for helping out! Unfortunately he file folder won't be the same for each month; Each month will have its own overarching folder, with this file being one of a few in the individual folder. I think my ideal way would be to not use a directory, but instead, just update the file, but then that brings up the issue of having to input that file twice in order to work on the 2 tabs. 

 

Kind Regards, 

Peter. 

pedrodrfaria
13 - Pulsar

Hi @peterg97 

 

I have attached an example of what you can do:

You insert the file and select to output the sheet names, we then build the file path for both sheet names and then separate them into two different workflows using the sample ( you can use the filter to apply name filtering logic) and then this macro (included in the workflow) to load both files (it covers all schemas for xlsx). This macro can be updated to digest other files, would just need to update the macro from inside. Let me know if you have any questions.

pedrodrfaria_0-1608675966574.png

 

Pedro.

 

peterg97
7 - Meteor

Hi @pedrodrfaria, 

 

Thanks for the help! Unfortunately I cannot open the workflow that you attached (I think my Alteryx is out of date for it). For me, the input file is coming up as a table, not query (see below), and the formula is showing as an error (see below). Any guidance would be really appreciated, i'm new to this!

 

Kind Regards, 

Peter. 

 

peterg97_0-1608716116900.pngpeterg97_1-1608716134825.png

 

pedrodrfaria
13 - Pulsar

I have added below some pictures to walk you through the configuration of each building block. I also added the macro i mentioned. If you are having problems opening up a workflow that was built with a different version of Alteryx, you can right click it, open as a notepad, find where it says the version the workflow was built and update to your version, save it and try reopening the workflow inside of alteryx and you should be successful. 

pedrodrfaria_5-1608726250809.png

 

 

 

pedrodrfaria_0-1608726198265.png

pedrodrfaria_1-1608726208110.png

pedrodrfaria_2-1608726215677.png

pedrodrfaria_3-1608726225224.png

 

pedrodrfaria_4-1608726241035.png

 

 

 

 

peterg97
7 - Meteor

Hi @pedrodrfaria, 

 

Works perfectly! Thanks for your help, I really appreciate it!

 

 

Labels