community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

how to get data for two previous weeks and current date data with a formula

Highlighted
Atom

Hi , i need to get a data filtered out for the current date along with the previous two weeks of data .. could someone help me with the formula. Attached my document .. i need to get it filtered in Go LIVE date column.

Alteryx Certified Partner
Alteryx Certified Partner

There's many different ways to do this; the datetimediff function within a formula tool should give you what you need...

 

datetimediff([Go Live Dt],datetimetoday(),'days') >= -14
AND
datetimediff([Go Live Dt],datetimetoday(),'days') <= 0

 

Though this does -14 days, the solution may need to change slightly if you are looking for the previous 2 weeks in terms of week numbers.

 

Ben

Use a filter tool with a custom filter:

[Go Live Dt] = ToDate(DateTimeAdd(DateTimeToday(), -13, "days")) AND [Go Live Dt] <= Left(DateTimeToday(),10)

That will be last two weeks including today (excluding 14 days ago)

Atom

Thank you so much

Labels