cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
lewand03 Helper I
Helper I

Passing multiple parameters to SAP BW Query

Hi PBI Gurus,
In my report I am using multiple queries from SAP BW as a data source.

I all of these queries I am using the same parameters to get data. for examle fiscal year.

{Cube.ApplyParameter, "[!V000003]", {{"[0FISCYEAR].[K42016]", "[0FISCYEAR].[K42018]", "[0FISCYEAR].[K42017]"}}},

Next year I need to add year 2019 and istead of changing it in every single query I'd like to do that via Parameter.

 

I know how to pass just one value foe example: [0FISCYEAR].[K42016], but I am having trouble with passing all the values. I was trying with string: "[0FISCYEAR].[K42016]", "[0FISCYEAR].[K42018]", "[0FISCYEAR].[K42017]", but it doesn;t work.

Any suggestions?

 

Thanks ,

D.

2 ACCEPTED SOLUTIONS

Accepted Solutions
lewand03 Helper I
Helper I

Re: Passing multiple parameters to SAP BW Query

solve by creating a seperate "empty" query instead of parameter. I called it YEARS. Just like that:

let
 Source = {{"[0FISCYEAR].[K42015]", "[0FISCYEAR].[K42016]", "[0FISCYEAR].[K42017]", "[0FISCYEAR].[K42018]", "[0FISCYEAR].[K42018]"}}
in
 Source

And the result is used as a selector:

 

{Cube.ApplyParameter, "[!V000003]", YEARS},

View solution in original post

Sang Helper I
Helper I

Re: Passing multiple parameters to SAP BW Query

You have to pass the List of List in this case.

To do that lets sat you are stating from Company Code Master Data table, which is already filtered on the Companies that you need.

 

Write following code as a new query and use it in your Comp Code filter. Note here I had to convert Comp Code numbers into text so SAP can accept them.

let
    Source = #"Company Code Master Data",
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Company Code #", type text}}),
    #"Company Code #" = #"Changed Type"[#"Company Code #"],
    Final  = List.Combine({{#"Company Code #"}})
in
    Final

View solution in original post

5 REPLIES 5
Community Support
Community Support

Re: Passing multiple parameters to SAP BW Query

Hi @lewand03,

 

To pass multiple values in a single parameter, please check this blog Passing multiple values to a single input parameter.

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
lewand03 Helper I
Helper I

Re: Passing multiple parameters to SAP BW Query

Thanks @v-frfei-msft,

 

But to be honest I do not know how to convert proposed solution:

  var_out = CE_PROJECTION

         ( :vty

         , ["ZWEEK"

         , "ZROWCOUNT"]

         , 'in("ZWEEK", :ip_week)'

         );


Then the following statement will work.


SELECT "ZWEEK", sum("ZROWCOUNT") 

FROM "_SYS_BIC"."mypkg.filterview/ZTEST_FILT"

 ('PLACEHOLDER' = ('$$ip_week$$', '''201202'', ''201203'''))

GROUP BY "ZWEEK";

to PBI Language from my case, using Parameter functionality.

            {Cube.ApplyParameter, "[!V000003]", {{"[0FISCYEAR].[K42016]", "[0FISCYEAR].[K42017]", "[0FISCYEAR].[K42018]"}}},

Any ideas?

 

 

Thanks,

D.

lewand03 Helper I
Helper I

Re: Passing multiple parameters to SAP BW Query

solve by creating a seperate "empty" query instead of parameter. I called it YEARS. Just like that:

let
 Source = {{"[0FISCYEAR].[K42015]", "[0FISCYEAR].[K42016]", "[0FISCYEAR].[K42017]", "[0FISCYEAR].[K42018]", "[0FISCYEAR].[K42018]"}}
in
 Source

And the result is used as a selector:

 

{Cube.ApplyParameter, "[!V000003]", YEARS},

View solution in original post

Sang Helper I
Helper I

Re: Passing multiple parameters to SAP BW Query

You have to pass the List of List in this case.

To do that lets sat you are stating from Company Code Master Data table, which is already filtered on the Companies that you need.

 

Write following code as a new query and use it in your Comp Code filter. Note here I had to convert Comp Code numbers into text so SAP can accept them.

let
    Source = #"Company Code Master Data",
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Company Code #", type text}}),
    #"Company Code #" = #"Changed Type"[#"Company Code #"],
    Final  = List.Combine({{#"Company Code #"}})
in
    Final

View solution in original post

lewand03 Helper I
Helper I

Re: Passing multiple parameters to SAP BW Query

Thanks Sang,

 

You are absolutly right, I've already described that in my previous post 😉

 

Regards,

D.

Helpful resources

Announcements
Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

‘Better Together’ Integration Forum Launch

‘Better Together’ Integration Forum Launch

We've launched a how-to forum where you can learn about how Power BI integrates with other Power Platform products.

Top Solution Authors
Top Kudoed Authors