Free Trial

Alteryx Designer Desktop Discussions

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

Last run date

ntudev
8 - Asteroid

Hello, I'm trying to run my report weekly and i want the dates to only pick from the last run date.

I have a formula in there that runs the report from the 1st of the month, but when i run the report i need the report to only pick up the report from the last time i ran it. Would this possible?

10 REPLIES 10
DataNath
17 - Castor
17 - Castor

Hey @ntudev are you able to share a few more details about how you bring in the report etc? I'm guessing you save all of your runs somewhere and then currently use a Dynamic Input tool for the one which ran at the start of the month?

 

If you use a Directory > Dynamic Input combination then you could just add a sort after the Directory tool, descending on CreationTime and then a sample tool to only keep the First N rows (N = 1).

 

Something like this:

 

DataNath_0-1655822605039.png

 

Luke_C
17 - Castor
17 - Castor

Hi @ntudev 

 

Some more info would be helpful. I'm interpreting it a bit different than @DataNath. If you need to filter from the last time you ran the WF, you probably need to output a yxdb file with a date time field (created using the datetimenow() function). Then bring that in as an input to leverage in your filter.

ntudev
8 - Asteroid

well lets say i ran the report as of June 10th which had the entered date of june 6 thru  june10, then on june 17th i ran the report again for entered date of  june 13th thru june 17th. I just want the entered date to be after the las time i ran the report. does it make sense?

DataNath
17 - Castor
17 - Castor

Hey @ntudev, from the example you’ve provided, it looks like you could just use a Filter tool with the expression:

 

DateTimeParse([Cmmt Entered Date], ‘%d/%m/%Y’) > DateTimeParse([Report Run Date], ‘%d/%m/%Y’)

 

The data you want will come out of the top (true anchor).

ntudev
8 - Asteroid

its giving me an error, am i inputting wrong

 

ntudev_0-1655844622523.png

 

DataNath
17 - Castor
17 - Castor

Oh sorry, I opened it in Excel originally so the date formatting was different. You don't actually need the DateTimeParse() functions, can just use: [Cmmt Entered Date]>[Report Run Date]

 

However, that's also incorrect as it's comparing it to the date of the same run (i.e. that dataset), rather than the previous. You could pull in the previous by doing something to the dynamic input I mentioned earlier, trimming down your previous run input so you only have the date ran field and then append that to the new run, before applying this formula. If you can provide an example of a new run and a previous I can build something for you.

ntudev
8 - Asteroid

will the attached work?

DataNath
17 - Castor
17 - Castor

Something like this? You'd need to reconfigure the Directory, Dynamic Input and Input Data tools to match your own folders/filepaths of course.

 

DataNath_0-1655846594853.png

 

ntudev
8 - Asteroid

wow this is way more complicated then i thought.

Labels
Top Solution Authors