Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Friends,
The aim is take the maximum of YEAR and then maximum of WEEK of Sales, when I try the below expression which is not working, could you please correct me where I need to correct.
=Sum({<YEAR={"$(=Max(YEAR))"},WEEK={"$(=Max(WEEK))"}>}Sales)
Thanks
Chriss
You can try like this:
=Sum({<YEAR={"$(=Max(YEAR))"},WEEK={"$(=Max({<YEAR={"$(=Max(YEAR))"}>}WEEK))"}>}Sales)
Assuming your week field has numeric data(1,2,...52)
Hi Chriss
I guess you have many years so max(year)=2014 but max(Week)=52 which is the max for 2013
I think it is the reason because you don't have 52 weeks in 2014 yet
So you shoud use a combined Week-Year field
best regards
Chris
You can try like this:
=Sum({<YEAR={"$(=Max(YEAR))"},WEEK={"$(=Max({<YEAR={"$(=Max(YEAR))"}>}WEEK))"}>}Sales)
Assuming your week field has numeric data(1,2,...52)
Hi, Tresesco and Chris,
Thanks and it works like a charm.... and for my knowledge, pls correct me if I am wrong.
so first it takes the Max of YEAR like (2014) ie, 2012, 2013, 2014 and it takes the max of WEEK as we are ie 24th week but in between the bold part why we need that Max of YEAR again.
Please explain...
Many thanks...
Chriss
Hi Chriss,
The bold part of the set analysis expression is written because:
"To get the max week for that max year"
Thanks Karthigayan, now its clear..
Regards
Chriss