community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Upgrade Alteryx Designer in 10 Steps

Debating whether or not to upgrade to the latest version of Alteryx Designer?

LEARN MORE

Change In-DB query with input from Standard workflow

Meteoroid

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:

query-builder.JPG

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!

 

Best,

Richard

Quasar
Quasar
Check out the Dynamic Input pool- you'll want to use the option that updates a SQL query.
https://community.alteryx.com/t5/Alteryx-Knowledge-Base/Tool-Mastery-Dynamic-Input/ta-p/24946
Meteoroid
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.

Richard
Meteoroid

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?

 

Thanks!

 

Richard

 

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

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Atom

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. 

Labels