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

Dynamically Input files based on the day of workflow is running

Nithinpanicker
8 - Asteroid

Hi Team,

 

I need some assistance designing a workflow in Alteryx. To give you the scenario:

  1. I have a report (input file) which is generated daily and saved into 1 folder,
  2. I need alteryx to analyze these reports. The inputs required for the analysis depends on the day when the workflow is ran.
  3. The required input setup: If I am running the workflow on Tuesday, the input report has to be the report from Monday. For Wednesday, input has to be the one from Tuesday. For Thursday, input to be from Wednesday. Friday the workflow will not be ran. Instead, the workflow has to be run on Monday, taking the input reports from Friday, Sat and Sun combined.

Can alteryx be able to dynamically input these files based on the above scenario? Any help will be greatly appreciated.

 

Thanks and regards,

 

Nithin 

6 REPLIES 6
alexnajm
17 - Castor
17 - Castor

Hi @Nithinpanicker,

 

Here are the steps I would folow:

1) Directory tool connected to the folder with the reports

2) Filter tool limiting the data to the report from the day before - something like [CreationDate] = DateTimeAdd(DateTimeToday(),-1,'days')

3) Dynamic Input set to one of the files, but the Action is the "Change Entire File Path" based on the "Full Path"

 

If you are reading in a .xlsx file, you would also need to add in the sheet name with a Formula tool before the Dynamic Input. This link outlines it decently well: The Ultimate Input Data Flowchart - Alteryx Community entrée de données eingabedaten

 

-Alex

alexnajm
17 - Castor
17 - Castor

 To the point about running the weekend files, you can update the filter to select -1, -2, and -3 days if the creation date is a Monday

Nithinpanicker
8 - Asteroid

Hi @alexnajm ,

 

Thank you for your reply.

 

Yes, the information you provided is helpful. However, is there a way I can design the workflow without needing to update the filter tool on Monday. Like workflow checks if its a Monday and if it is then it will take the previous 3 days reports otherwise for any other day only 1 report is taken as the input.

 

The workflow will be run by my colleagues who do not have much experience with Alteryx and I want to minimize manual intervention to update workflow.

 

Thanks 

Nithin 

alexnajm
17 - Castor
17 - Castor

Yes, the point above should still work. I should have said "add onto" instead of "update" the Filter - you should be able to write a Formula that says something along the lines of IF DateTimeFormat(DateTimeToday(),'%A')="Monday" THEN [CreationDate]<=DateTimeAdd(DateTimeToday(),-3,'days') OR [CreationDate]<=DateTimeAdd(DateTimeToday(),-2,'days') OR [CreationDate]<=DateTimeAdd(DateTimeToday(),-1,'days')
ELSE [CreationDate]<=DateTimeAdd(DateTimeToday(),-1,'days') ENDIF

alexnajm
17 - Castor
17 - Castor

Here it is built with some dummy data - I tested out the Monday logic by adding that Formula and setting the date to a Monday date, but you can remove it

Nithinpanicker
8 - Asteroid

Hi @alexnajm 

 

Thank you. The solution you proposed worked.

Labels