Alteryx Designer Desktop Discussions

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

SQL Query saved externally for Alteryx to read in multiple workflows

catmar
7 - Meteor

I have a workflow that uses 3 times the same SQL query with the regular input data tool. On each day the results are different as the database constantly updates.  Let's assume the logic is like this:

 

1. preview (on 25th of the month)

2. actual run (on 1st of the month)

3. comparison run (on 5th of the month)

 

In the preview run, I would verify if any new unknown values are being added. If there is, it will be added to the SQL CASE WHEN statement. I don't want to update my SQL on all three locations. Is there a way to save the SQL code outside of the input tool and have Alteryx read from this document in all the 3 workflows? 

3 REPLIES 3
cmcclellan
13 - Pulsar

Why not add that logic to the workflow?  You can use the day of the month to filter which data source is used.

catmar
7 - Meteor

All the queries are exactly the same in the four different workflows. I don't want to consolidate them to one. I am trying to avoid the need to update the input tool on four different locations and having the risk of inconsistent queries. 

apathetichell
19 - Altair

a .sql file is just a text file. Same them as text style files. read in as /0 text files... use a summarize tool if needed to get each file into one line - feed into batch macro -> input data/dynamic input/dynamic input in-db - whatever you are using to query your db.

Labels