Alteryx Designer Desktop Discussions

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

Updating a SQL Query in an App

JenniferO
8 - Asteroid

Hello!

 

I have an analytical app in which I would like to use the Date Prompt Tool to allow a user to select a date.  Then, that date will be used to update a value in a where clause in a SQL query.  I have tried approximately one million things, and I cannot get it to work.  Can anyone assist?  Please let me know what additional information you need.  

 

Thank you!

6 REPLIES 6
Thableaus
17 - Castor
17 - Castor

Hi @JenniferO 

 

It should be a very simple task - You put a Date Interface Tool and connect that to your Input or Connect In-DB tool.

 

Then use the "Update Value" in your Query Expression and check "Replace a Specific String" right into the date in your original query.

 

Could you please share your workflow, or a picture so we can understand it better?

 

Cheers,

MarqueeCrew
20 - Arcturus
20 - Arcturus

@JenniferO,

 

I want to tell you the secret, but I don't want to make this look too easy.  You might be doing this as an in-db tool connect or as a standard input tool reading from your database.  I'll answer this as a standard input tool.

 

I like to use a DYNAMIC INPUT tool for SQL parameter updates.  You can copy your SQL from the input tool and setup a dynamic input tool.  The tool will first ask you to setup a template.  Go ahead and configure the template EXACTLY as you did in the Input tool (using your copied SQL).  Next you can put a TEXT INPUT tool in front of the dynamic input.  The TEXT INPUT will have a DATE_PARAMETER field that contains a properly formatted date (e.g. 2019-03-29).  

 

Now you can read in the date and *Modify SQL Query

 

You'll add to update the WHERE clause and update your "fixed" SQL date with the value from the date parameter.

 

If you have any issues, please let me know.

 

Cheers,

 

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
JenniferO
8 - Asteroid

Hello,

 

So, I ended up just making a silly error.  I had the action tool connected to the dynamic input.  I switched it so it was connected to the text input tool and it works fine now.  

 

I appreciate your assistance!!

 

Thank you!!

asmukar
5 - Atom

hi, I did the exact same thing, my workflow works but the query isn't filtering when I choose a date. can you please share the workflow so I can see the interface settings and details?

 

thanks :)

Thableaus
17 - Castor
17 - Castor

@asmukar 

 

Are you clicking at the magic wand? You have to do that to run as an App.

 

Cheers,

Brost
6 - Meteoroid

@Thableaus  Can you share how to do this using In-Database tools rather than the standard Input data?

Labels