community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Directory: Read From a Different Directory Based on Day

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

Quasar
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

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


 

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