Alteryx Designer Desktop Discussions

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

How can I pass Dynamic value to sql in input tool in alteryxw

Devu_GN
5 - Atom

I am trying to pass the max timestamp value from a table in  destination to load delta from the source table in another db. For that I am thinking of keeping a log table in destination db so after every load of db from source to destination  i will update the log table with the max timestamp in destination table . So for next load the min timestamp will be the value in log table and max time stamp  will be the current timestamp. I have seen examples were a constant value is replaced in alteryx, but here the value will be dynamic & have to be queried from a db every time.Can any one suggest some thing for this.

3 REPLIES 3
wwatson
12 - Quasar

I would use a dynamic in-db and update the sql with a formula.

DavidSta
Alteryx
Alteryx

Hi @Devu_GN,

 

I've done this once with an InDB integration, but this would work with the general tools as well.

 

Like already mentioned from @wwatson you have to use a Dynamic Input (with or without InDB).

DavidSta_0-1596097809236.png

In this attached IncrementLoadWF.yxmd you load at first the current max timestamp from your control table. Then you use this value to inject the SQL statement you want to pass to the real table you want to query. In this case I'm using the Dynamic Input In-DB Tool to process the datasets. I store them in the same database, and after this is done the control table gets updated with the new, latest timestamp.

 

The 2nd workflow "Source Table Creation" may help you to create some sample datasets.

 

Best regards,

David

 

Devu_GN
5 - Atom

yes it helped ..  thanks

Labels