Thanks for your reply but that's not what i meant, i try to describe it better.
If the current week for yearweekcounter is 210, then I want the values from the field "orders" summation where yeraweekcounter is 208,209,210,211,212 with dimension Year week(Alla weeks off this will not be displayed).
Each yearweekcounter ex 208 consists of hundreds of individual lines on a date that fit this week's counter, therefore required sum (orders).
I had this expression before:
Money ((if ([Year Week]> = (vCurrentYearWeek-7), sum (Orders) / 1000), '#. # # 0, tkr') with the dimension Yearweek.
The problem is that this does not work well at year-end when the current week -7 will not be the same as 7 weeks back.
Therefore, I would like to use the weekcounter instead.("current" weekcounter-7)
See updated qvw. Is that what you need? I use a trigger to select the current YearWeek. I only have some sample data, but it should work the same with lots of order records.
comm69379 v2.qvw 140.0 K
No sorry, it was not what i meant.
But i have now solved it myself through the script with this:
if (Week Year (TODAY ()) & num (Week (TODAY ()), 00) = [Year Week] Week Counter) as tTodayweekcounter
left join (Time)
tTodayweekcounter as Today Week Counter
where tTodayweekcounter> 0;
drop table tToday_weekcounter;
Then i can compare the current Yearweek number with the rolling YearWeek number.
Thank you for trying to help me.