This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
Have you looked at using the Dynamic Input tool? Basically, you can read your file/configuration table to get your date parameters, and then replace a placeholder date in your Dynamic Input query to update to the new dates when the query is run.
Check out this Knowledge Base article for some tips on configuration. Dynamic Input is BY FAR one of my favorite tools for it's versatility in cases exactly like this!
There are 2 ways to solve: dynamic input already mentioned and make the necessary adjustments. Other: Dynamic In-Db input using your already created connection In a Text Input create the following columns: column: Query1 and insert the query Select * from TABLE_A where DATE_A = 'DATEA' and DATE_B between 'DATE1' and 'DATE2' Columns DATEA and insert 2-July-2019 DATEB1 and insert 1-July-2019 DATEB2 and insert 30-July-2019
in a formula tool do the replace: create Query with the following calculation Replace (Replace (Replace ([Query1], 'DATEA', [DATEA]), 'DATEB1', [DATEB1]), 'DATEB2', [DATEB2])
And in the Dynamic input In-Db tool pass the Connection and Query parameters and you're done.
Thanks for you response. It worked the way i wanted, but the only problem i am seeing it when i am pasting my query in Dynamic Input Query - I have to provide a hard coded date in my Query and then i am replacing with the date i want otherwise Alteryx is not validating the query.
In my Dynamic input i am replacing '2-July-2019' to '2-Aug-2019'.
Select * from TABLE_A where DATE_A='2-July-2019' and DATE_B between '1-July-2019 and '30-July-2019'
Is there any way where i can put the query like this in Dynamic Input
Select * from TABLE_A where DATE_A='$DATE_A' and DATE_B between '$DATE_B_1 and $DATE_B_2'
so that Alteryx can validated this. And then i will always replace '$DATE_A with some value. Otherwise i need to relplace one hard code value with another always.
I just gave you an example using Dynamic Input in-db There are several ways you can solve the substitution of values, I'm moving faster for you to think and use creativity. I am sending the same example with dynamic input query.