Forum Discussion
Parameter Setting for Data Source(Snowflake)
- 3 years ago
SruthiK
I follow the below-mentioned method to stitch between different DBs environments i.e. DEV, Test, Prod.Before creating the report, I import all the tables which are necessary by default approach i.e
Get Data > Snowflake > Enter the URL > Warehouse Name.
After importing all necessary tables. I create 3 parameters
1. Server Name (ServerName)
2. Data warehouse (DWH)
3. Database Name (DB)
Select Advance Editor for any table and replace the code as mentioned below
Before:
let
Source = Snowflake.Databases("XXXXXXXXXXXX.snowflakecomputing.com","extralarge"),
XX_XX_DEV_Database = Source{[Name="XX_XX_DEV",Kind="Database"]}[Data],
Your_Schema = NAME_OF_Database{[Name="XX",Kind="Schema"]}[Data],
TABLE_NAME_YOU_IMPORTED = Your_Schema{[Name="TABLE_NAME_YOU_IMPORTED",Kind="View"]}[Data]
in
TABLE_NAME_YOU_IMPORTEDAfter:
let
Source = Snowflake.Databases(ServerName, DWH, [CreateNavigationProperties=null, ConnectionTimeout=null, CommandTimeout=null]),
Database = Source{[Name=DB,Kind="Database"]}[Data], // XX_XX_DEV_Database changed to Database, XX_XX_DEV changed to DB
Your_Schema = Database{[Name="XX",Kind="Schema"]}[Data], // Just use the word Database don't change it
TABLE_NAME_YOU_IMPORTED = Your_Schema{[Name="TABLE_NAME_YOU_IMPORTED",Kind="View"]}[Data]
in
TABLE_NAME_YOU_IMPORTEDNo need to make any changes in line number 4; I just gave you for reference.
You need to do the above things in each table for the first time only. When ever you want to change the database or server name just go to parameters which you created and switch them.
Let me know if this is helpful.
SruthiK
I follow the below-mentioned method to stitch between different DBs environments i.e. DEV, Test, Prod.
Before creating the report, I import all the tables which are necessary by default approach i.e
Get Data > Snowflake > Enter the URL > Warehouse Name.
After importing all necessary tables. I create 3 parameters
1. Server Name (ServerName)
2. Data warehouse (DWH)
3. Database Name (DB)
Select Advance Editor for any table and replace the code as mentioned below
Before:
let
Source = Snowflake.Databases("XXXXXXXXXXXX.snowflakecomputing.com","extralarge"),
XX_XX_DEV_Database = Source{[Name="XX_XX_DEV",Kind="Database"]}[Data],
Your_Schema = NAME_OF_Database{[Name="XX",Kind="Schema"]}[Data],
TABLE_NAME_YOU_IMPORTED = Your_Schema{[Name="TABLE_NAME_YOU_IMPORTED",Kind="View"]}[Data]
in
TABLE_NAME_YOU_IMPORTED
After:
let
Source = Snowflake.Databases(ServerName, DWH, [CreateNavigationProperties=null, ConnectionTimeout=null, CommandTimeout=null]),
Database = Source{[Name=DB,Kind="Database"]}[Data], // XX_XX_DEV_Database changed to Database, XX_XX_DEV changed to DB
Your_Schema = Database{[Name="XX",Kind="Schema"]}[Data], // Just use the word Database don't change it
TABLE_NAME_YOU_IMPORTED = Your_Schema{[Name="TABLE_NAME_YOU_IMPORTED",Kind="View"]}[Data]
in
TABLE_NAME_YOU_IMPORTED
No need to make any changes in line number 4; I just gave you for reference.
You need to do the above things in each table for the first time only. When ever you want to change the database or server name just go to parameters which you created and switch them.
Let me know if this is helpful.
I tried the same steps and got this error. Can you please explain what's wrong here. Any Insight is greatly appreciated.
Thanks,
Bhargav
- marcingalazkaMO3 years agoFrequent Visitor
I have same code in Advanced editor, the only difference is in 1st row after DWH I have Role specified and you have some different things.
- Anonymous1 year agoNot applicable
Can you share how to specified the role in there?
- BhargavYeluri3 years agoRegular Visitor
I have figured this out and my issue is resolved. The below code worked for me. I was using a importing from a table instead of a view as posted by the OP and that's where the confusion was.
let
Source = Snowflake.Databases(ServerName, DWH, [CreateNavigationProperties=null, ConnectionTimeout=null, CommandTimeout=null])
,Database = Source{[Name=Database,Kind="Database"]}[Data]
,MAIN_Schema = Database{[Name="MAIN",Kind="Schema"]}[Data]
,YOUR_OBJECT_NAME = MAIN_Schema{[Name="OBJECTNAME",Kind="Table"]}[Data]
in
YOUR_OBJECT_NAME