Home > Mobile >  Passing data parameters on SSRS using Snowflake data source
Passing data parameters on SSRS using Snowflake data source

Time:12-25

We are migrating the SQL Server SSRS reports to Snowflake; I have a question about parameters in SQL version -

select * 
from tbname 
where xtype in (@xtype)

How to write this in the Snowflake version?

CodePudding user response:

In Snowflake you set a variable using the SET command and then reference it in SQL statements by prefixing it with $ e.g.

set (min, max)=(40, 70);

select $min;

select avg(salary) from emp where age between $min and $max;

This is documented here: enter image description here

Sample input values:

enter image description here

Dataset definition:

enter image description here

Dataset parameter (expression: =JOIN(Parameters!Param_XType.Value, "^")):

enter image description here

Report test:

enter image description here

  • Related