Forum Discussion
SACooper
Helper II
3 years agoVariables in Query
Hi All, I'm using a powerbi dataset to load, transform and then store reports in a SQL database (Via [R]). I'm wondering if its possible to set up a simple variable that can be called to create a...
jbwtp
Memorable Member
3 years agoHi SACooper,
Something like this?
let
Source = {1..10},
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Added Custom" = Table.AddColumn(#"Converted to Table", "Custom", each "... INSERT INTO Table" & Text.From([Column1]) & " ............"),
SqlCall = (q as text)=> "Called SQL database with " & q,
#"Added SqlCall" = Table.AddColumn(#"Added Custom", "SqlCall", each SqlCall([Custom]))
in
#"Added SqlCall"
Cheers,
John
SACooper
Helper II
3 years agoHi jbwtp
Apologises for the delay a couple of issues arose at work which took up my time. If i'm reading your solution correctly we'd still need to know the upper limit of the number of queries, or would it not matter if the range was to 100 with only 50 queries (at that point in time)
- jbwtp3 years ago
Memorable Member
How do you know when to stop sending "INSERT INTO" statements?