I am using the input tool to get data from a SQL database. In the input tool I do some basic filters, to limit the data returned and speed things up. One of the filters is the current month. Normally I then turn this into an app, to dynamically update the data across the different tools. I don't want to use an app in this case, as the user needs to follow along what is happening and has to be able to make changes.
Is there a way to make the date within the query dynamic, without doing an app?
Solved! Go to Solution.
Hey @kat
How dynamic does the date need to be?
Does it just need to filter on the current month?
You could write your SQL statement to include the following:
AND DATEDIFF(month, [Your Date Column], GETDATE()) = 0
Part time Tableau, Part Time Alteryx. Full Time Awesome
Thanks @LordNeilLord, that would work for most cases. This workflow however is run towards then end of and at the beginning of the next month.
I'm thinking I could just add my data sources into 2 containers, one using your formula and one having a datediff of 1. Then instead of having to edit the SQL script one would just have to disable one of the containers. Or do you have a better idea?
Hey @kat
In that case I would go for datediff <=1 and have 2 months data in the workflow, which can then be changed?
Part time Tableau, Part Time Alteryx. Full Time Awesome
Yes good idea, that shouldn't be too much data to have a negative impact on performance.
Thank you for the help @LordNeilLord!