Alteryx Designer Desktop Discussions

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

Automatically update dates each week

markdonnelly98
5 - Atom

Hello,

 

I'm currently developing a workflow which takes data from a large report and captures data within the current week (Mon-Sun). Is there a tool which will enable me to have the dates automatically updated each week to capture the current week?

 

I'm thinking of a possible solution as having the start date on a Monday and the capture date being pushed forward every 7 days.

 

Thanks in advance.

6 REPLIES 6
RolandSchubert
16 - Nebula
16 - Nebula

Hi @markdonnelly98 ,

 

if I understood correctly, you want to determine the date range for the current week to use start date (Monday) and end date (Sunday) as filter for data from a data source? Alteryx DateTime functions can help - I've added a sample workflow to find these days.

 

Let me know if it works for you.

 

Best,

 

Roland

DavidP
17 - Castor
17 - Castor

This formula will give you the start of the current week date (Monday)

 

DATETIMEADD(datetimenow(),-
IF
TONUMBER(DATETIMEFORMAT(datetimenow(),'%w'))=0
THEN 7
ELSE TONUMBER(DATETIMEFORMAT(datetimenow(),'%w'))
ENDIF
+1,'days')

Blake
12 - Quasar

Building on @RolandSchubert's formula, you can append those dates to your data set and use them for a custom filter. 

 

Blake_0-1587573590457.png

 

 

 

markdonnelly98
5 - Atom

Thanks for your response Roland.

 

I've attached a sample workflow below.

 

I basically just want each of the filter dates to be pushed forward by 7 days every 7 days if that makes sense.

 

E.G In the attached example the filters are capturing dates between 2020-04-20 and 2020-04-26 but starting on Monday I will need them to capture all dates between 2020-04-27 and 2020-05-03.

 

Kind regards,

Mark

markdonnelly98
5 - Atom

Thanks Blake that worked!

Blake
12 - Quasar

Thanks @markdonnelly98 , that's great! 

 

I'd also suggest marking @RolandSchubert as solved, he provided the formula that I used to build out the rest.

Polls
We’re dying to get your help in determining what the new profile picture frame should be this Halloween. Cast your vote and help us haunt the Community with the best spooky character.
Don’t ghost us—pick your favorite now!
Labels