Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Change In-DB query with input from Standard workflow


At our company we have large amounts of data (2bn records per month) partitioned and stored at Redshift as monthly tables. This setup complicates our queries, since 1) the table name changes (increments) over time, and 2) we have to do joins to reduce the amount of data and this limits the use of views.


Because of the amount of data we have to operate in In-DB workflows. I am trying to build a dynamic query in a standard workflow that could replace a placeholder query within an In-DB workflow. The query builder works; Both checkbox lists populates from external source (sql query). The comma separated list of tables is split into rows, and the join criteria (from "Select classified type(s)") are appended to each table row. Lastly, it's all summed up by concatenating all rows into a single field:


My question(s) is: Can I somehow use the resulting query string in a new workflow where I replace a placeholder string with the query string?


Or even better: Can I achieve the same results in a pure In-DB setup, using the output from one app in the next app?


Hope you can help, it would be much appreciated!




Check out the Dynamic Input pool- you'll want to use the option that updates a SQL query.
Thanks for your reply, Jason.

I am not sure how I can use this with an in-db stream? I can't find a way to stream the generated query into an in db flow and then replace the query string. A standard workflow seems pretty straight forward, but I need to avoid streaming data locally.


I was able to read the YXDB values from the first workflow, and use them in a dropdown box which then was used to update the In-DB query. 

The question I am left with is how I can achieve the same results without requiring user input?






insert-into-db.JPGInterface control feeds values into In-DB select



insert-into-db-control-config.JPGThe control reads an yxdb file which contains NAME and VALUE fields




















Thanks, at first i didnt understand the instructions of Name && Value the tool indicates, but after i properly structured my file with those two columns it worked as I wanted to.