Alteryx Designer Desktop Discussions

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

Change Date in Dynamic format

Tid14
8 - Asteroid

Hi, I am working on a Workflow where in for now I have kept the date filter as static, but I want to change in into Dynamic once, so that at picks up automatically every month.

 

 
 

For eg - In the attachment, I am running for the Current month, So i want it to be in dymanic format so that it updates every time to 1 sta day of current month.

Eg - [WIP Date]  <= To Date (Date time Add("2023-07-01" , 1 , "months")) And

[WIP Date] >= "2023-07-01"

 

This eg I want to make it dynamic.
Any help on this.

1 REPLY 1
DataNath
17 - Castor

Hey @Tid14, if I'm understanding the ask correctly, you can use DateTimeFirstOfMonth() to dynamically reference the start of the current month. Then you can add the transformations you have in your example around that. I've provided an example here where I generate all of 2023's dates and then filter to between the start of the current month and the first day of the next month.

 

Before:

DateFilterBefore.png

 

After:

DateFilterAfter.png

 

The expression I used to mimic yours is:

 

[Turned WIP Date] <= ToDate(DateTimeAdd(DateTimeFirstOfMonth(),1,'month'))
AND
[Turned WIP Date] >= ToDate(DateTimeFirstOfMonth())

 

However, if you're using the latest version of Alteryx (2023.1), they did just add the Between() function where you can just write this as Between(<field>, min, max) - you'll see I've left that in the Filter but commented out so if you're on this version you can just delete the //s and the original expression to use:

 

Between([Turned WIP Date], ToDate(DateTimeFirstOfMonth()),ToDate(DateTimeAdd(DateTimeFirstOfMonth(),1,'month')))

 

Hope this helps!

Labels