Delete records in Snowfalke Table based on condition
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
