Forum Discussion
Cube.ApplyParameter - SAP BW connector - syntax to select range or between?
I had the same problem. Please see below and try if it works for you or not.
Step 1: Create a Start Date and End Date -- this step will help you to dynamically select the date range.
let
#"currentYear" = Date.Year(DateTime.FixedLocalNow()),
#"currentMonth" = Date.Month(DateTime.FixedLocalNow()),
#"startYear" = if #"currentMonth"<4 then #"currentYear"-2 else #"currentYear"-1, // I had to introduce this step to get the last n FYs
#"startDate" = #date(#"startYear",4,1)
in
#"startDate"
-----------
let
#"EndDate" = Date.From(Date.AddYears(DateTime.FixedLocalNow(),2))
in
#"EndDate"
Step 2 : {Cube.ApplyParameter, "DATE CUBE", {GetStartDate,GetEndDate}}
It worked for me.
- BartVW2 years agoHelper I
Thank you for your input Gauravshahin !
I currently no longer have the issue, as I'm able to rely on query folding to properly apply the filters when sending the request to BW. I will keep you suggestion in mind in case I have to relook at options.