ALTERYX INSPIRE | Join us this May for for a multi-day virtual analytics + data science experience like no other! Register Now

Alteryx Designer Discussions

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

Dynamic Input SQL Update multiple clauses

JamesBills
8 - Asteroid

Hello community, 

Sorry for the long post but please stay with me..

I already have a database that i pull from, only when the date, is later than my last update. See photos. Use dynamic input tool for this. (each "car" in my data has multiple lines with different dates). This works at the moment...

 

But i want to only take this data for a certain amount of unique "cars". 

(Each car has a unique identifier number, i.e. car 321456, 321457, etc).

 There are ~4,000 cars which i want to take the data, around 2,000 which i don't. 

 

The whole aim of this is to reduce time taken to run the workflow. Hence why i want to only pull for cars i need rather than pulling all then filtering. 

 

Ideally i want a list of car numbers going into the query, and only pull data for them, and only after the right date (see top, currently working part) 

 

If anyone has any extra time in lock down, some help on this would be much appreciated, 

Thanks, James

patrick_mcauliffe
14 - Magnetar
14 - Magnetar

The issue is likely your sql statement of the dynamic input.

Does your Where clause use an "=" or an "in"?  
It should be an "IN ('123456789')" and then replace the 123456789 and the option to group replacement value for sql in clause.

JamesBills
8 - Asteroid

Hi Patrick. 

 

Just so I'm clear would your solution be appending the date onto the list of cars.

Then having the SQL clause say IN (123456789) AND ....= (date)

 

Thanks

patrick_mcauliffe
14 - Magnetar
14 - Magnetar

I believe that's it.  A little hard to say without having seen your original dynamic query.

Here's an example I put together.

This is my template query I put into the dynamic input:

patrick_mcauliffe_0-1588674663310.png

 

 

And then the modify settings for the dynamic query:

patrick_mcauliffe_1-1588674784794.png

 

JamesBills
8 - Asteroid

Thank you. Didn't know how to combine those two queries but that works now. 

Labels