Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

apply filter to data input directly from a SQL server

gurpreet-singh
7 - Meteor

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

3 REPLIES 3
BenMoss
ACE Emeritus
ACE Emeritus

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

 

 

SamDesk
11 - Bolide

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 :)

BenMoss
ACE Emeritus
ACE Emeritus

Or what @SamDesk says if it needs to be dynamic!

Labels