Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Dynamic Input based on Months

sanketkatoch05
8 - Asteroid

I'm trying to use a dynamic input tool wherein the Alteryx should select a file based on current month, i.e. 

if the current month is 'Feb' then select the file - 'Feb - 3'

if the current month is 'Mar' then select the file - 'Mar - 4'

If the current month is 'Jun' then select the file - 'Jun - 4'

 

The trivia here is that only the Feb month's file has '3' in it, else all the months contain 4. 

5 REPLIES 5
mceleavey
17 - Castor
17 - Castor

Hi @sanketkatoch05 ,

 

You need to read in the list of files using the Directory tool, then build a formula to determine the current month in that format, then filter the records based on those that contain this date string before feeding into a Dynamic Input tool.

 

I've attached a workflow with some tools I wrote to do this. Simply re-point your directory tool to the folder you're using.

You might need to change the formula slightly, but this does what you want.

 

mceleavey_0-1626089491173.png

 

Hope this helps,

 

M.

 



Bulien

atcodedog05
22 - Nova
22 - Nova

Hi @sanketkatoch05 

 

You can use a formula like this create your filename.

 

Workflow:

atcodedog05_0-1626089554257.png

 

 

IF DateTimeFormat(DateTimeNow(),"%m")="02" 
THEN "Feb - 3" 
ELSE DateTimeFormat(DateTimeNow(),"%b")+" - 4" ENDIF

 

 

If Feb then "Feb - 3" else "Mon - 4"

 

Hope this helps : )

sanketkatoch05
8 - Asteroid

Thank you so much @mceleavey  & @atcodedog05  for the timely reply. Indeed it helps. 🙂

mceleavey
17 - Castor
17 - Castor

no problem.gif



Bulien

atcodedog05
22 - Nova
22 - Nova

Happy to help : ) @sanketkatoch05 

Labels