Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

How to update dates in a SQL input query before running workflow?

Joker_Hazard
11 - Bolide

Hello guys.

I have to update a range of dates in 5 different queries that are inputted with input tool.

Those range of dates have a pattern, which is:

IF datetoday = 10/09/2021 THEN update the query with - 2 days. The query then would be like this:


Joker_Hazard_0-1631282725464.png

The pattern is to take the datetoday and subtract 2 days, to create a range of 3 days of values.

However, I see that Alteryx does not have a functionality that change the dates before running the workflow. Example:

Joker_Hazard_1-1631282848707.png
As you can see, the dynamic tool comes AFTER the input tool. For me that does not work due to a massive amount of data, millions of lines.

Is there any way to fix my problem? Any workaround?

Any input is appreciated.

Thanks

 

 

8 REPLIES 8
dougperez
12 - Quasar

The dynamic input will replace the date before the input tool (the input tool in this case will NOT do any queries into your DB, it exists just to parametrize the replace the values into the dynamic, which will execute the query), what you will have to do is very simple:

Create a collum with these 3 dates (use a generate tool to do that) and then put the sql into dynamic input, configure it to replace the dates into your sql and it will work

Joker_Hazard
11 - Bolide

That's outstanding! Love it.

So, Alteryx "understand's" that after the input tools we have a dinamic tool that replaces values in a query, so the workflow works backwards?

Dinamic tool > input tool > other tools   Right?


Maskell_Rascal
13 - Pulsar

Hi @Joker_Hazard 

 

You can use something like this

 

where SDBANCO.VCOB_BAML_R_TITULOS_INTERGR_CC.DATA between CURRENT_DATE-2 and CURRENT_DATE

 

dougperez
12 - Quasar

I think I expressed myself a little wrong. In this case, the dynamic input executes after the input, but the input will not query your db, it will just have the dates to replace into dynamic input

dougperez
12 - Quasar

Joker Hazard, are you brazillian? I can explain better in portuguese... 
If you want to use the dynamic to replace the dates, I can help you with that, but if you want to do this in the query, the Maskell_Rascal solution will help you

Joker_Hazard
11 - Bolide

Yes I am! I will send a private message for us to talk.

Thanks 😉

 

Joker_Hazard
11 - Bolide

How can I make the same thing with the other SQL table that was inner joined with the first one?

dougperez
12 - Quasar

Hello Joker,

 

See the workflow attached

Labels