Free Trial

Alteryx Designer Desktop Discussions

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

Rolling Date Range

NSUTTON
5 - Atom

I am in need of a Criteria that will automatically show the current months data, Currently at the beginning of each month i have to change the date range shown below. 

 

 

NSUTTON_0-1591203258339.png

 

2 REPLIES 2
DavidP
17 - Castor
17 - Castor

What type of database are you connecting to?

 

You can insert a WHERE clause in your SQL statement. For MS SQL Server for instance, it could be something like

 

WHERE DATEDIFF(day, DATE,(DATEADD(mm, DATEDIFF(mm, 0, GETDATE()), 0)))>=0

jeff_reynolds
10 - Fireball

The Dynamic Input tool is perfect for that. 

 

First, build the date value you need in the formula tool.

Next, build your query in the Dynamic Input tool, and where you'd normally insert your date range, put something that you can replace.

Under the 'Add' drop-down, choose SQL: Update Where Clause

Finally, update the text you added with the date you generated, and you should be on your way. I use this all the time on various reports. Looks a bit like image below

dynamic.png

Labels
Top Solution Authors