Forum Discussion
Create a list then pass as parameters to TSQL
Hi Anonymous,
You can use custom function and parameter to achieve your requirement.
Parameter:
function formula:
let
loadDataBase=(ServerName as text,DataSource as text, parameter as text) as table=>
let
SQLQuery = "select * from test1121 where Quarter in ("& parameter &")",
Source = Sql.Database("ServerName", "DataSource",[Query=SQLQuery])
in
Source
in
loadDataBase
Invoke result:
Edit the parameter to show the specify records.
In addition, you can also use the t-sql query as the parameter.
let
loadDataBase=(ServerName as text,DataSource as text, SQLQuery as text) as table=>
let
Source = Sql.Database("ServerName", "DataSource",[Query=SQLQuery])
in
Source
in
loadDataBase
Regards,
Xiaoxin Sheng
Hi there Anonymous
Almost quite there
but instead of typing value (1,2,3) in I would like to pick it from my list
My list got following value
1
2
3
4
5
6
and I want to be able to pick multiple values from the list and reshape it to e.g 1,2,3 etc...
Is that doable?
Many thanks
- Anonymous9 years agoNot applicable
Hi Anonymous,
>>Is that doable?
I think it is impossible. You can only get one value from the parameter which stored in the list.
Regards,
Xiaoxin Sheng