Alteryx Designer Desktop Discussions

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

SQL Update Where Clause duplicating quotes

Felipe_Amancio
7 - Meteor

Hi Masters

I have this workflow where the output of a Summarize (Concatenate) should replace a SQL IN clause using the option "SQL: Update Where Clause".
No matter how I setup the workflow (summarize with quotes or without quotes, selecting or not "Group Replacement Value for SQL IN Clause" etc) the output always duplicates the quotes in the SQL script.
In the example below, the SQL IN clause output has duplicated quotes ('''DST_000457'',''YYYYYYYY'''), making the query to fail .
I know there might be an workaround using "Replace a Specific String" but I really wanted to use the SQL: Update Where Clause. I
Is this issue a bug? Is there a way to make it work?
Thanks for your help

 

Workflow.png

 

Concatenate District.pngDynamic input.png

1 REPLY 1
rfoster7
9 - Comet

Its not a bug. The tool is trying to put the quotes in for you instead of you having to do it, so its working as designed.

 

It appears you have already concatenated your replacement values yourself, meaning you are sending only one line to the dynamic input. 

 

In that case you need to uncheck the Group Replacement Value in SQL IN Clause. Because you have already done it yourself. 

 

I'm not even sure that will work because its GOING to put a ' in front and behind your replacement text because it's supposed to. So you'd end up having to remove your own initial ' and ending ' to compensate. 

 

Alternatively, you can get rid of the contact_distinct you are doing yourself and just do a group by the district fields which will get you X rows of districts, then use the "Group Replacement Value in SQL IN clause" and it will put the ',' in for you so you don't have to. 

Labels