Alteryx Designer Desktop Discussions

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

Date now -7

Plewis1
8 - Asteroid

I have a workflow that runs once a week. The data appends to a excel sheet and stacks itself. I am trying get the filter tool to run that day the data is pulled plus 7 days back every week. Any help would be appreciated. Also I don't have any time in the column, so do I also need to build the formula in a way that excludes time? 

 

Thank you

11 REPLIES 11
RolandSchubert
16 - Nebula
16 - Nebula

Hi @Plewis1 ,

 

so you need a formula to get the current date - 7 days? This should work: DateTimeAdd(DateTimeToday(), -7, "days"). DateTimeToday() returns today's date, and DateTimeAdd calculates the respective day of last week. Does this help?

 

Best regards

 

Roland

BenMoss
ACE Emeritus
ACE Emeritus
I think we can do this as follows...

[DATEFIELD] >= DATETIMEADD(DATETIMETODAY(),-7,"days")

Ben
Plewis1
8 - Asteroid

Hi @

 

Plewis1
8 - Asteroid

Hi @

 

BenMoss
ACE Emeritus
ACE Emeritus
What that suggests to me is that you actually dont have any dates within 7 days of today.

Have you ensured that is the case?
BenMoss
ACE Emeritus
ACE Emeritus
Is your date field data type actually set to date type?
Plewis1
8 - Asteroid

The date type is selected as date  in the select tool. There is dates going all the way back to 2018. 

RolandSchubert
16 - Nebula
16 - Nebula

Hi @Plewis1 ,

 

maybe you should try:

 

DATETIMEPARSE([YourDateField], "%Y-%m-%d") >= DATETIMEADD(DATETIMENOW(), -7, "days")

Of course you have to replace the format specifiers in DATETIMEPARSE and remove the date type selection in the Select tool (set it to a string data type).

Plewis1
8 - Asteroid

That worked. Thank you sir.  

Labels