Alteryx Designer Desktop Discussions

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

Using reference shortcuts in the SQL Editor

Billigans
8 - Asteroid

I am trying to pass a user defined year into the SQL editor input tool using reference shortcuts. I have created my two variables via the Numeric Input tool named Beg_Year and End_Year. I have updated the code in the SQL editor so the where clause reads 

 

WHERE year BETWEEN %Question.Beg_Year% and %Question.End_Year%

 

but when I run the app the query error's out returning no results and the error message shows that the reference shortcuts are not passing the year variables into the code. 

 

Am I doing something wrong here or is the SQL editor not meant to support reference shortcuts?

1 REPLY 1
echuong1
Alteryx Alumni (Retired)

If you're trying to make a workflow dynamic, I recommend either creating an analytic app, or using the dynamic input.

 

For the analytic app, create your workflow with a "base case." I'm filtering for a customer ID, but you can use the dates in here too. You can then update each portion with an interface tool and an action tool for the min and max dates.

 

echuong1_0-1610755319213.png

echuong1_1-1610755464905.png

 

For the dynamic input, you'll start with a text input that has placeholders for your two dates. Then in your dynamic input you'll build that "base case." Go to modify SQL Query and add the necessary modifications. You can either modify the entire where clause all at once, your you can choose a specific string like I did.

 

echuong1_2-1610755564649.png

echuong1_3-1610755640045.png

 

 

 

 

Labels