Hi everyone,
I had to change the data source of several queries in an Excel report. At the moment I am connecting to Snowflake via ODBC in Excel. Querying data from there works just fine, but the query from the old report had "?" as parameters. That was working in the old case because it was a Microsoft Query connection to the old database which is now obsolete. My issue is that now I cannot replicate adding such parameters inside the Snowflake query straight through ODBC.
The desired result is to have a separate tab where users can input their desired value of the parameter, and then the Snowflake query would pick that up and fetch only the filtered data. If we leave out such parameters, the file would very likely break just because of the large amount of unfiltered data.
Here is an example:
I would like to query this data into the "Data" tab:
select product, warehouse
from snowflake_table
where warehouse in ('?', 'Y', 'Z')
and year(date) = '2019' and month(date) = '12' and day(date) = '01'
And in a separate tab "Parameter", we have users typing in any other value next to Warehouse to query for the warehouse Y, Z as constants and the one typed in by them (let's say X), replacing the "?" (I did try without quotation marks as well). Ultimately I want to extend this to the year month day filters as well, but let's start with the warehouse for now.
When using a Microsoft Query connection, I would be prompted with a screen to connect the "?" with an input cell, but that is not working with the ODBC connection I set up to Snowflake.
Another issue is that with Snowflake we prompt users to sign in via an active directory for security reasons. Before the file had an embedded password and query to the old database via Microsoft Query.
Do you have any hints and tips how I could make this work?
Thank you in advance.
Bookmarks