Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
In my requirement, I want to show last 12 months data in dimension in dar chart.
EX:
Dimension : Month Year ( Api-2015 )
Expression : Count (Items).
the data is from 3 Years. i Want to show only 12 months dynamically.
any one help on this.
Regards,
Chennaiah
I would usually use a set filter on the expressions to limit data to the last 12 months, like
Sum({<Date = {">=$(=AddMonths(Max(Date), -12))"}>} Sales)
See also this article: Simply create YTD, moving totals and comparisons versus Year Ago
I have something similar, hope this will help.
On the Dimension limits tab, select Restrict which values are displayed, then in show only, select Largest in the Dropdown, and then 12 in Value.
I used it in a rolling 12 month stacked bar chart, works fine, then you have the calculation in the expression field.
=sum({1<DATE={'>=$(=MonthStart(Max(Date_field),-12))<=$(=MonthEnd(Max(Date_field),-1))'}>}Sales)
Try above expression
Hope it helps you..
Regards,
Mohammad
Thanks Andret,
But it showing between Api-2014 to Mar-2015, it not showing current month EX May 2015
Try this:
=sum({1<DATE={'>=$(=MonthStart(Max(Date_field),-12))<=$(=MonthEnd(Max(Date_field)))'}>}Sales)
Strange, are you sure everything is right, do yo have data for April and May 2015, this could give wrong values if you have missing months. have not picked up this problem myself, mine is working 100%. Maybe check your load order. Check the Sort tab as well, maybe the sorting is wrong. Can you maybe give a reduced data model with some records for each of the periods?
Hi,
See the attachment.
Thanks,
AS