Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi friends,
I need to show sales for the three previous months to the selected month,
In the example show a month earlier, but do not know how to show the other two previous months.
I appreciate your help.
Thx in advance
Here you go. Back to straight table with 4 expressions and 1 dimension:
Expressions
1) sum({$<Year, Month, Date = {"$(='>=' & Date(MonthStart(Max(Date))) & '<=' & Date(MonthEnd(Max(Date))))"}>} Sales)
2) sum({$<Year, Month, Date = {"$(='>=' & Date(MonthStart(Max(Date), -1)) & '<=' & Date(MonthEnd(Max(Date), -1)))"}>} Sales)
3) sum({$<Year, Month, Date = {"$(='>=' & Date(MonthStart(Max(Date), -2)) & '<=' & Date(MonthEnd(Max(Date), -2)))"}>} Sales)
4) sum({$<Year, Month, Date = {"$(='>=' & Date(MonthStart(Max(Date), -3)) & '<=' & Date(MonthEnd(Max(Date), -3)))"}>} Sales)
HI,
Try this
Sum({<Date = {">=$(=monthstart(addmonths(Max(Date),-1)))=$(=Monthend(addmonths(Max(Date),-1)))"},Year=,Month=>}Sales)
For previous month
Sum({<Date = {">=$(=monthstart(addmonths(Max(Date),-2)))<=$(=Monthend(addmonths(Max(Date),-2)))"},Year=,Month=>}Sales)
For Previous to Previous Month and so on.
Regards,
Kaushik Solanki
May be this:
Converted your table into a pivot table
Thx Sunny T,
It works ok, but I need to use other dimensions than the month...I forget to add
I incorporated new dimension called "Region" in the attached example.
you could help me with that dimension?
Is this the kind of table you envision?
Yes, but the dimension must only be "Region" no "MonthYear".
It is possible?
Many Thx Kaushik,
But I get an erroneous result by applying the expression, and is independent of the selection.
You don't want to see MonthYear? Like this?
You can also potentitally use the max(fieldname, rank) function in your set analysis.
For example, max(Month, 2) would give you the "prior" month if the current month is the max month. max(Month, 3) and max(Month, 4) would be the 2 and 3 months back from current.
Yes I need to see the month year but not included as used dimension: