Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Replace SQL string in all Input Data instances

asp_ty
6 - Meteoroid

Hi,

 

I'm currently using Alteryx to automatically run 2 queries from Teradata and output them to Excel. I do this daily so every day I would go into the SQL code for each Input Data instance and update the date in the SQL code to the current date. is there a faster way of doing this manually? thanks. 

11 REPLIES 11
nick_ceneviva
11 - Bolide

You could use the SQL CURRENT_DATE function that will always use the date of the current day.  This would prevent you from having to update the date on a daily basis.

asp_ty
6 - Meteoroid

Hi Nick, 

 

thanks for the suggestion, but I also would like to run it for prior days if possible. What I'm really looking for is a tool where I can apply the date update to all the Data Input objects at once instead of doing it one by one. 

nick_ceneviva
11 - Bolide

I see.  You could always make it into an app where based on the selected date or date ranges the SQL query is updated.

asp_ty
6 - Meteoroid

can you show me how that would be accomplished in Alteryx? i attached a sample file with two different queries in one workflow. thanks. 

nick_ceneviva
11 - Bolide

It would be something like the attached application.  If you could test and let me know if it works that would be great.

asp_ty
6 - Meteoroid

my current query is pulling data where Business_Date(date) = '2017-09-18' and when i ran the app and changed to a prior date, it is still outputting 9-18 data. any idea what went wrong? 

nick_ceneviva
11 - Bolide

The update action must not be working as expected.  It will be tough to troubleshoot as I can't actually run the query.  This is actually very similar to the Weekly Challenge from this week so maybe checking that out would help!

asp_ty
6 - Meteoroid

i understand. i will look at the weekly challenge for ideas then. thanks for your help Nick!

asp_ty
6 - Meteoroid

I was going through someone's thread with a similar situation as mine and one thing i noticed that both of our dates in the SQL code are in this format: YYYY-MM-DD. Maybe this date format is not compatible with Alteryx's default date format which is MM/DD/YYYY which is why the "replace a specific string" function isn't working properly. 

Labels