Hi There,
I have an Alteryx flow which is taking the data input directly from a SQL server. What I would like to do is filter this data as it comes into the flow so I don’t download so much data into Alteryx. I would like to filter this data using a datetime variable of the form ‘2018-12-21 00:00:00’.
Can someone please help?
Regards,
Gurpreet
Solved! Go to Solution.
Hi!
Sure this is possible and there are a couple of ways to do this; you can use the 'in-database' tools to input your data and then filter it, before using the 'data steam out' tool to bring the data into Alteryx; the way the in-db tools work is they push the query back to your database server to process.
Alternatively, in your standard input tool, when connected to the database, you can create a query, for example...
Select * From Database
where field > ‘2018-12-21 00:00:00’
This can be done in the 'Choose table or specific query' and then going to the 'SQL Editor'.
Ben
Hello @gurpreet-singh,
This is possible using the Dynamic Input Tool, please see my post here.
You would just need to adjust the logic presented to use the below WHERE statement in your SQL and then to replace <DYNAMIC WHERE> with the string variable ‘2018-12-21 00:00:00’ instead of the entire where statement.
AND timedate_field = TO_DATE('<DYNAMIC WHERE>','yyyy-mm-dd HH:MM:SS')
If you need a fuller explanation for your case just say and I can recreate a workflow for you.
Sam :)
Or what @SamDesk says if it needs to be dynamic!