Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts,
i have the below expression:
NUM(rank(-(aggr(
(Sum({<MonthYear =,Date= {">=$(=date(MonthStart(vMaxSalesDate)))<=$(=date(vMaxSalesDate))"}>} UnitSales)
/
Sum({<MonthYear =,Date= {">=$(=date(MonthStart(vMaxSalesDate)))<=$(=date(vMaxSalesDate))"}>} TotalSales))
-
(Sum({<MonthYear =,Date= {'>=$(=Date(MONTHSTART(AddMonths(vMaxSalesDate, -1))))<=$(=Date(MONTHEND(AddMonths(vMaxSalesDate, -1))))'} >} UnitSales)
/
Sum({<MonthYear =,Date= {'>=$(=Date(MONTHSTART(AddMonths(vMaxSalesDate, -1))))<=$(=Date(MONTHEND(AddMonths(vMaxSalesDate, -1))))'} >} TotalSales))
, Branch))
))
the expression calculates rank of sales % - Current month vs Previous month.
this woks fine for monthly selection.
but when a quarter is selected, the value is not getting changed.
for ex., if i click on Q4, the expression shows rank for current month and not for the quarter.
how can i change the expression for a quarterly view.
Pls help.
Becoz you have bypassed the Date= and quarter you have created on Date field, I hope so..
Hi,
thanks for the reply
sorry i dont understand
Can you please help me with the expression change for quarter
Pls somebody give suggestions
Try:
NUM(rank(-(aggr(
(Sum({<MonthYear =,Date= {">=$(=QuarterStart($(vMaxSalesDate)))<=$(vMaxSalesDate)"}>} UnitSales)
/
Sum({<MonthYear =,Date= {">=$(=QuarterStart($(vMaxSalesDate)))<=$(vMaxSalesDate)"}>} TotalSales))
-
(Sum({<MonthYear =,Date= {'>=$(=QuarterStart($(vMaxSalesDate), -1))<$(=QuarterStart($(vMaxSalesDate)))'} >} UnitSales)
/
Sum({<MonthYear =,Date= {'>=$(=QuarterStart($(vMaxSalesDate), -1))<$(=QuarterStart($(vMaxSalesDate)))'} >} TotalSales))
, Branch))
))
gysbert,
thanks for the reply.
actually for a quarter, i shouldnt change the calculation as current quarter - prev quarter.
i should do quarter with logic curr month - prev month.
i have posted sample in thread 926337.
pls help me on that