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

Delete records in Snowfalke Table based on condition

Eliyaz
5 - Atom

Hi,

I am trying to load data from Multiple excel files and load them into a Snowflake Table. Before loading into the Snowflake table, I need to delete the records in Snowflake Table based on the distinct values of the Year column from Excel data.

 

It should be somewhat similar to below shown in the SQL example.

 

Delete * from <Snowflake_Table>

where YearColumn=

(select distinct

YearColumn from Excel_File_Data)

 

But I am not able to perform this step on Alteryx. Can you please help me with this?

 

Thanks,

Eliyaz.

2 REPLIES 2
SeanAdams
17 - Castor
17 - Castor

Hey @Eliyaz 

 

What you're asking for is a plain old SQL tool - this did come up in Alteryx Sneaks last year, but not sure if it ever got built.

 

The way round this is that you can put whatever SQL you like in the PreSQL of an input tool.

 

So what I'd do is:

- Take an input tool, and wrap it in a batch macro (you can find out more about Batch Macros if you need in the Academy area)

- You can put your delete statement into the PreSQL

- and then you can dynamically change this by using the control param.

 

And because this is a batch macro - it will hold execution until it's finished 

 

It is a long way round - I know - but I've not found a better way to do this yet.

 

cc: @VojtechT @NicoleJ 

apathetichell
18 - Pollux

The "SQL" tool is another I've asked for - albeit with the caveat that I'd expect a ton of questions about why syntax x doesn't work in DB Y vs in DB Z - but that shouldn't prevent creating it.

Labels