Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Reference a column in the Query Advance Editor to connect to a snowflake DB

First I am getting the Username using R, then I'm splitting the domain and the username into to columns. The next thing I want to do is to pass the domain value in column V1.1 to the snowflake connection see the bold text. I am getting this error:  

Expression.Error: The key didn't match any rows in the table.
Details:
Key=Record
Table=Table

 

Is this possible? thank you in advance for your help!

 

let
Table1 = let
RScript = R.Execute("output <- read.table(text=system2(""whoami"", stdout=TRUE))"),
UserSource = RScript{[Name="output"]}[Value],

SplitByDelimiter = (table, column, delimiter) =>
let
Count = List.Max(List.Transform(Table.Column(table, column), each List.Count(Text.Split(_,delimiter)))),
Names = List.Transform(List.Numbers(1, Count), each column & "." & Text.From(_)),
Types = List.Transform(Names, each {_, type text}),
Split = Table.SplitColumn(table, column, Splitter.SplitTextByDelimiter(delimiter), Names),
Typed = Table.TransformColumnTypes(Split, Types)
in
Typed,

#"Split Column by Delimiter" =SplitByDelimiter(UserSource, "V1", "\")
in
#"Split Column by Delimiter",
#"Uppercased Text" = Table.TransformColumns(Table1,{{"V1.1", Text.Upper, type text}}),
Source = Snowflake.Databases("xxxxxxxxxxxx.snowflakecomputing.com ", "xxxxxxxxxxxxxxxxx", []),
XXXX_Database = Source{[Name=Table.SelectRows(#"Uppercased Text", each ([V1.1])),Kind="Database"]}[Data],
PUBLIC_Schema = XXXX_Database{[Name="PUBLIC",Kind="Schema"]}[Data],
M_JOB_Table = PUBLIC_Schema{[Name="M_JOB",Kind="Table"]}[Data]

in
#"M_JOB_Table"

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@Anonymous,

 

You may change it as follows.

= #"Uppercased Text"[V1.1]{0}
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-chuncz-msft
Community Support
Community Support

@Anonymous,

 

You may change it as follows.

= #"Uppercased Text"[V1.1]{0}
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

It worked! thank you so much!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.