Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Dynamically change date in SQL Query

maygross
8 - Asteroid

I'm creating a workflow that shows top 50 customer revenues by the past six months. How can i dynamically change the query to filter the dates between the current month and six months earlier? I want this flow to be completely automatic without me having to change the parameters of the months every time I run it. My dates are set up as yyyymm. I am using a teradata input. 

4 REPLIES 4
alexnajm
16 - Nebula
16 - Nebula

Something like this should work! The query can now be input in the Dynamic Input tool and the "Modify SQL Query" option can replace the date values you'd have in there

gautiergodard
13 - Pulsar

Agreed with @alexnajm - either of the highlighted options below should work for you:

If one doesnt, try the other, I've experienced mixed results depending on the use case.

 

gautiergodard_0-1680196908721.png

 

alexnajm
16 - Nebula
16 - Nebula

Agreed @gautiergodard!

apathetichell
18 - Pollux

As always I'm going with dynamic input in-db and editing the where clause in a formula tool.

 

 

not to say the other answers are wrong but personal preferences and if you are doing the query on server or on your own system...

Labels