Dear All,
I have a table as follows:
Year Week Value
2011 1 10
2011 2 12
2011 3 14
2011 4 16
2012 1 21
2012 2 22
2012 3 23
2012 4 24
My objective is to determine the sum(Value) of the last four weeks.
For example, if any user inputs 1 in the 'Current Week' input box and 2012 in the 'Current Year' inputbox, then the output
table should include sum(Value) figure of the week 1 of 2012 and week 4,3,2 of the 2011.
I have tried this by the expression
if($(vCurrentWeek) = 1,
sum({<Week = {'$(vMaxWeek)', $(=Max({<Year = {$(=Max(Year)-1)}>}Week)), $(=Max({<Year = {$(=Max(Year)-1)}>}Week) - 1)}>} Value)
)
This can be found in the attachment. But this is not working as expected.
Any help would be highly appreciated.
Thanks & Regards,
Somnath