Eric Mamet
Eric Mamet

Reputation: 3647

Can worksheet filters only be used in WHERE or GROUP BY Clause in Snow?flake

I would like to use the value selected in a filter as a returned column.

For instance like

SELECT :MyFilter;

but I get the following error:

No valid expression found for :Subscription. Expecting "<expression> = :MyFilter" (line 1)

Upvotes: 0

Views: 490

Answers (1)

Jim Demitriou
Jim Demitriou

Reputation: 603

You may need to declare a local variable, assign it the value from :MyFilter, and then use in your query. See the following reference: https://docs.snowflake.com/en/developer-guide/snowflake-scripting/variables.html#working-with-variables

Upvotes: 1

Related Questions