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 Pass Parameter in to pre-SQL statement based on Input Data Stream?

puttarajud
7 - Meteor

My Input data stream is excel and it contains dates along with other data. If I run workflow twice, data is getting appended twice to sql table resulting in duplicate rows. So to avoid data duplicacy, I need to delete the data from sql table which is greater than minimum date of input data stream before appending the data from excel to sql table.

 

I am able to find minimum date by using summarize tool. How can I pass these minimum date to pre-sql statement so that I can delete previously appended data.

 

For example, I have last week data. Once I run macro, last week data get appended to sql table. If I re-run the query, last week data get appended to table again. Becuase Data doesn't have any unique colomns so database don't throw any error.

 

I am trying to delete the last week data if exists by using pre-sql statement. I am getting last week min date "07/10/2016", I am not sure how can I  pass this date to pre-sql statement.

 

Thanks in advance.

6 REPLIES 6
michael_treadwell
ACE Emeritus
ACE Emeritus

The easiest way to pass a dynamic date string to Pre-SQL in the Input tool would be to imbed the Input tool inside of a batch macro and then pass the min date using a Text Box interface tool.

puttarajud
7 - Meteor

@Michael, Thank you. Is it possible to show some sample workflow?

puttarajud
7 - Meteor

I have created temporary sql table and passed minimum date in the data using summarize widget. Now I deleting the data using the column in the temporary table in Pre-SQL Statement.

Ab3111
5 - Atom

Can you please attach an example of how we can do this?

sneh12
5 - Atom

Hi did you get any answers to this question, I am in a similar situation and want to know if I can pass a string in a pre sql statement if anyone knows how to do that please let me know

 

murugansabk
5 - Atom

It's not solved and there is no answer in this thread.

Why is it marked as SOLVED???

Labels