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

In-Database filter Macro

KB
7 - Meteor

Hi,

 

I am trying to build macro for In-Database filter to change dates. I would like to have macro built filter which can be then used for different Connect In-DB data inputs. Ideally I am looking for something as simple as the screenshot attached. Unfortunately it does not work. Is it something which can be done?  

 

Cheers,

Karol

8 REPLIES 8
ddiesel
13 - Pulsar
13 - Pulsar

I have an application that has a similar configuration:

 

Capture.PNG

 

 

Action Tool Configuration:

 

Capture.PNG

 

The SQL Query ends with:

...Date Between '1-august-2017' And '15-august-2017'

 

Hope this helps! If not, please post more details.

KB
7 - Meteor

Hi ddiesel,

 

Thank you for sharing. However our workflow looks more like this (see attached) there are multiple connect In_Db connections and some of them require date change so ideal situation would be that the there is one date change which updates all date filters present in the query. Correct me if I am wrong but your app allows only date change for this specific In-Db connection / query. So if I have another query pointing to another table this app would not work, right?

 

ddiesel
13 - Pulsar
13 - Pulsar

@KB You can have two (or more) action tools connected to one interface tool.

 

Will a setup similar to this do the trick?

 

Capture.PNG

 

KB
7 - Meteor

Yes it would. 

How can I get this to work?

Option 1) I have tried as per your original suggestion and it worked however when I have added second action tool it did not. I cannot get second action tool to pass the date into the query.

Option 2) For filters my action tool does not work at all. Does not matter whether one action tool or two.  

Am I missing something?

 

ddiesel
13 - Pulsar
13 - Pulsar

Can you share how your action are tools configured?

 

In the example I first provided, I use the "Replace a specific string" option. If both tools are configured as such with both variables in the Connect In-DB query, I don't know why it wouldn't work.

ddiesel
13 - Pulsar
13 - Pulsar

Also, I noticed that you are using Text Box Interface tool. What worked for me is the Date Interface tool.

KB
7 - Meteor

I figured it out! Thank you. It was all set up correctly, only thing I was missing was the tick box in the configuration properties window where you select which brows tools results to show. Since I did not tick second brows tool when I was testing I could not see the results. Since I could not see them I was thinking it does not produce any. Anyway Thanks for your help.

BTW the text tool does work also. 

MichalK
8 - Asteroid

Hi,

 

The solution I often use to create parameterized DB queries is using 'Dynamic Input In-DB' tool:

 

In-DB macro setup.png

 

In this example, I pass my parameters to a text input, then use Formula to write a SQL query, and finally pass that query as an input to 'Dynamic Input In-DB' tool.

 

 

 

 

Labels