Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
解決済み

Filter dates for current week only

arbencukaj
メテオール

I need to filter dates for a column with dates ranging from last year to 2025. I send a report every Wednesday that utilizes only the dates (weekdays only) for that week. For example, today I will be sending a report out using the date range 2022-04-04 to 2022-04-08. 

 

I've tried using others' formulas but nothing has seemed to work so far

3件の返信3
JagdeeshN
12 - Quasar
12 - Quasar

Hi @arbencukaj ,

 

 

Try this formula:-

 

(DateTimeFormat([Date],"%a") != "Sat"
AND DateTimeFormat([Date],"%a") != "Sun")
AND
DateTimeFormat([Date],"%U") = DateTimeFormat(Datetimenow(), "%U")

 

This excludes the weekends in the first part. In the second part it only includes days in this week.

 

 

Hope this helps.

 

Best,

Jagdeesh

SPetrie
クエーサー

Another approach would be these formulas

DateTimeAdd([TestDate],1-tonumber(DateTimeFormat([Testdate],"%u")),"days")

and 

DateTimeAdd([WeekStartCalc],4,"Days")

 

The first will give the Monday of the week for the test date

The second will add 4 days to that to give you the Friday

You can append those dates to your data to filter out any date that is not between those two dates.

SPetrie_0-1649272340633.png

 

arbencukaj
メテオール

Thank you Jagdeesh! This worked perfectly!!!

ラベル