Snowflake - trying to build a dashboard

I'm trying to build an app that has:

  • a single value select
  • a multi-value select
  • a date range

As the user chooses the values, a graph and table of the data is filtered based on the selections.

The single value select and the date range works fine. I can't get the multi-select to work.

I've read this SQL Cheatsheet - best practices for different flavors of SQL syntax

and applied it like this

select
  *
from
  FIREPIT.FP_META
where
  CLIENT_NAME = {{select_client.value}}
and "DATE" >= {{dateRange.value.start}}
and "DATE" <= {{dateRange.value.end}}
and   ARRAY_CONTAINS(CAMPAIGN_NAME::variant, SPLIT( '{{multi_campaign.value.join()}}', ',') )

but it doesn't work.

As soon as I remove the ARRAY_CONTAINS line it works fine, but I need to be able to filter for the multiple values from the multi_campaign

What am I missing please ?

Hi @Chris_Mc Does it work if you remove the single quotes around '{{multi_campaign.value.join()}}'?

This appears to be working in my db as long as I remove those extra quotes:

I'll update the doc you linked to remove those quotes as well!