We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Fetching data from snowflake using sql query in alteryx

PB41091
8 - Asteroid

"select
a,
b,
c,
d,
e,
f,
g,
h
from
ab.pqr.xyz
where
a in ('12345')"

 

I am using the above sql query t fetch the the details. And query is running fine.

But I have list of 30,000 entries to fetch. I have created the concatenated list of these 30000 entires and break them in 3 groups consisting of 9999 entries. Below is the sample

Now i want to pass these values in the sql query i have written in formula tool but i dnt know how to read these multiple values

Batch_IDa
11234','3244','7008','6208','1211','4009'
23411','2414','1108','4454','7653','7369'
33455','1144','6788','2570','1771','9478'
3 REPLIES 3
DataNath
17 - Castor
17 - Castor

Hey @PB41091, if I'm understanding your ask correctly, are you looking to generate the IN lists like so?

 

3001.png

 

If so, we just interrupt the hard-coded query value to insert our field containing the list, as shown above.

ChrisTX
16 - Nebula
16 - Nebula

You can use a Batch Macro, where a Control Parameter feeds in your 3 different lists of values to an Input Data tool in the macro, and use an Action tool to "Replace a specific string" in the Input Data tool.

 

Or you can use the tools under the In-Database palette.

But there isn't much help for those tools.  Check out this video: https://community.alteryx.com/t5/Videos/In-Database-Workflows/m-p/330566

 

We use these tools: Connect In-DB, Data Stream, Join In-DB

We upload our values (your 3000 values) to a TEMP table in the database, then use Join In-DB to join from the Temp table to the "primary" database table we're reading.

 

Unfortunately my company is currently blocking all uploads, screenshots and sample workflows, so I can't provide any examples.

 

Chris

 

 

 

apathetichell
20 - Arcturus

I put your query in a text input tool.

I have a second datasource with my 3000 entities.

I configure a summarize tool and concatenate them

with '   ','   ' as my dividers.

I append the two datastreams.

I replace '12345' with my conctanated values.

I use dynamic input In-DB 

Labels
Top Solution Authors