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

Directory: Read From a Different Directory Based on Day

poles1c
8 - Asteroid

Hi,

 

Is there a way in Alteryx to dynamically change which directory you read a list of files from using the directory tool? For example, if it is Tuesday I want to read from Directory A, if it is Monday I want to read from Directory B. If the directory tool cannot not meet this need is there some other tool or tools I should be using to meet this goal?

 

Thanks!

 

Courtney

3 REPLIES 3
Joe_Mako
12 - Quasar

How about the attached Macro?

 

It uses the Action tool set to "Update Value with Formula", with the "Directory - Value" selected, the formula that you can edit by clicking on the "..." buttom at the bottom is:

 

Switch(DateTimeFormat(DateTimeToday(),"%A"),"C:\",
"Monday","C:\Monday",
"Tuesday","C:\Tuesday",
"Wednesday","C:\Wednesday",
"Thursday","C:\Thursday",
"Friday","C:\Friday",
"Saturday","C:\Saturday",
"Sunday","C:\Sunday")

 

action formula.png

poles1c
8 - Asteroid

Thank you!!!


@Joe_Mako wrote:

How about the attached Macro?

 

It uses the Action tool set to "Update Value with Formula", with the "Directory - Value" selected, the formula that you can edit by clicking on the "..." buttom at the bottom is:

 

Switch(DateTimeFormat(DateTimeToday(),"%A"),"C:\",
"Monday","C:\Monday",
"Tuesday","C:\Tuesday",
"Wednesday","C:\Wednesday",
"Thursday","C:\Thursday",
"Friday","C:\Friday",
"Saturday","C:\Saturday",
"Sunday","C:\Sunday")

 

action formula.png


 

KenMoorhead
7 - Meteor

@Joe_Mako wrote:

How about the attached Macro?

 

It uses the Action tool set to "Update Value with Formula", with the "Directory - Value" selected, the formula that you can edit by clicking on the "..." buttom at the bottom is:

 

Switch(DateTimeFormat(DateTimeToday(),"%A"),"C:\",
"Monday","C:\Monday",
"Tuesday","C:\Tuesday",
"Wednesday","C:\Wednesday",
"Thursday","C:\Thursday",
"Friday","C:\Friday",
"Saturday","C:\Saturday",
"Sunday","C:\Sunday")

 

action formula.png


It had never occurred to me use an action tool by itself for handling some internal logic, without another interface tool attached. I love this!

Labels