Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
i have one pivot table with month dimension and two measures like this
i have one pivot table with monthdimension and two measures like this
jan feb mar april may jun july aug sep oct nov dec
sales1 10 20 20 10 30 40 10 20 20 30 10 20
sales2 30 20 20 50 60 70 80 10 80 20 20 90
so here i need a column at right side which adds last 3 months values for baoth sales1 and sales2 like this
jan feb mar april may jun july aug sep oct nov dec latest_3_months
sales1 10 20 20 10 30 40 10 20 20 30 10 20 60
sales2 30 20 20 50 60 70 80 10 80 20 20 90 130
could u please tel me...
Please don't duplicate your threads!!!!!!!
Use set analysis to get last 3 months
Hi Durga
Try this:
sum(aggr(rangesum(above(total sum({<Month=>}Amount),0,3)),Month))
Go to this link:
can u give me the expression for the set analysis to get the sum of last three months for both measures(sales1 and sales2)
thanku for ur response hemanth... but i need the last three months sum for both measures(sales1 and sales2) in single column only... as i mentioned above... could u please tel mee that
try this:
month refers month field name
sales1 refers sales1 field name
sales2 refers sales2 field name
sum(aggr(rangesum(above(total sum({<Month=>}sales1),0,3)),Month))
sum(aggr(rangesum(above(total sum({<Month=>}sales2),0,3)),Month))
Regards
hemanth
To get Sales1 and Sales2 for last 3 months
Sum({<Month = {"$(=AddMonths(Month,-3))"}>} (Sales1 + Sales2))
OR
Sum({<Month = {">= Max(Month) <= Max(Month)-3"}>} (Sales1 + Sales2))
OR
Sum({<Month = {">= Max(Month) <= AddMonths(Month,-3)"}>} (Sales1 + Sales2))