Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Set base directory for workflow without using a macro

jay_chang
8 - Asteroid

I am trying to figure out what should (in my mind) be a relatively simple problem and can't seem to figure this out.

 

I have a workflow with roughly 12 different input files that will be run on a monthly basis.  Each input file is different from the others.  However, they will all be stored in the same common directory AND they will each have the same name from one month to the next.  So, as an example:

 

File_Foo.xlsx

File_Bar.xlsx

File_Bar.xlsx

File_Keep.xlsx

 

will have the same names from one month to the next.  However, they will be stored in different directories each month.  Is there a way for me to update just ONE tool so that it sets the directory for all the input files at once?  I tried a user variable but that didn't seem to work.  and the Directory input file seems to assume that either all the files are the same layout or just smashes them on top of each other without any care for the different structures within each file.

 

How can I do this?

7 REPLIES 7
JoBen
11 - Bolide

Hi @jay_chang, you could use just one input tool. If you configure the input tool like below (assuming all your files are referencing the same sheet), this should be able to do what you need.

 

Help1.PNG

patrick_digan
17 - Castor
17 - Castor

@jay_chang  What didn't work with the user variables? You could create a user constant with the filepath and then reference that in the input tools like: %Question.FilePathVariable%\File_Foo.xlsx. Alternatively, you could also use a text input to hold your filepath and then convert your 12 inputs to 12 dynamic inputs which all grab the file name from the text input.

jay_chang
8 - Asteroid

Ugh.  Unfortunately, each file will have different sheet names.  Also, one file has 5 different sheets and each sheet has to go into a different sub path of the workflow.

jay_chang
8 - Asteroid

I couldn't find documentation on how to use environmental variables.

 

Could you elaborate on the 2nd suggestion?  That sounds like what I was trying to do but couldn't get to work.

patrick_digan
17 - Castor
17 - Castor

Here's the help doc on how to use constants: https://help.alteryx.com/current/Constants.htm

 

For the dynamic input, I've attached an example. You basically set the Input Data Source Template to a valid file (like C:\folder\foo bar.xlsx) so it can get the right metadata. Then you just need to feed in the new path. I've just typed the path in a text input. Then in the dynamic input, you just use the modify SQL query box and replace C:\folder\ with you filename from Field1 (C:\folder2\). You would basically just convert all of you standard input tools to dynamic input tools and replace the filepath with the filepath specified in your text input.

jay_chang
8 - Asteroid

Thank you.  Let me play around with these two items...

jay_chang
8 - Asteroid

Thank you.  The example flow helped immensely.  This seems to be workable for my situation.  It never would have occurred to me that "Modify SQL" would have non-SQL capabilities.

Labels