Happy 8th birthday to the Maveryx Community! Take a walk down memory lane in our birthday blog, and don't miss out on the awesome birthday present that all Maveryx Community members get to take advantage of!
Our main navigation will be under construction for the next hour. "Launch Pad" will be moving to "Learn", and the "Introduce Yourself" forum will be moving to a thread in the "General" discussion.

Alteryx Designer Desktop Discussions

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

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

snavee16
6 - Meteoroid

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.

3 REPLIES 3
BenMoss
ACE Emeritus
ACE Emeritus

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

jdunkerley79
ACE Emeritus
ACE Emeritus

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)

snavee16
6 - Meteoroid

Thank you so much


Labels