Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

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