Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I'm trying to use a "last 4 weeks" variable but i'm encoutering issues with syntax I think.
I've tried this :
num(SUM({<[WeekNumber]={">$(=$(vMaxYearWeekID)-4)<=$(=$(vMaxYearWeekID))"}>}[Invent.Qty]))
My MaxYearWeekID variable looks like this :
=max( {1} YearWeekId)
What am I doing wrong?
Thank you in advance for the help.
Best regards,
The problem was somewhere else in my master calendar.
It is solved now.
Thank you for you time youssefbelloum
Hi,
the approach is ok, variable ok, expression ok, what do you see on the chart ?
The value displayed is 0.
But when I put the "YearWeekID" field in a filter pane and select the last 4 weeks, I get a good value.
do you have all the weeks on your data ?
example:
Measure, Week
100,1
200,2
120,3
210,4
340,5
145,6
125,7
574,8
195,9
354,10
165,11
==> here all weeks are available, you will see 4 lines as expected on the graph
or yo don't have all the weeks, like this:
Measure, Week
100,1
200,2
120,3
210,4
340,5
145,6
276,7
310,9
174,11
==> here week 8 and week 10 are missing.. so using your expression, you will only see two lines on the graph
I do have all the weeks, numbers from 1 to 813.
And when I pick manualy the weeks 813 - 812 - 811 - 810, I see a result in my KPI.
With production KPI like :
num(SUM([Invent.Qty]))
Would you be able to share sample app the see the issue ?
The problem was somewhere else in my master calendar.
It is solved now.
Thank you for you time youssefbelloum
no problem, good luck