Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to show the cumulative totals by year in a bar chart. I used full accumulation in expressions tab but its accumulating all values and giving totals by month. Assue my data set have quantity 10 for each month. I want to show cumulative totals by year like below. is there any easy way to achieve this?
Bar Chart is accumulating totals like below:
I want to see below result in bar chart.
| Month-Year | Sales | |
Jan-2010  | 10  | |
Feb-2010  | 20 | |
| Mar-2010 | 30 | |
| Apr-2010 | 40 | |
| May-2010 | 50 | |
| Jun-2010 | 60 | |
| July-2010 | 70 | |
| Aug-2010 | 80 | |
| Sep-2010 | 90 | |
| Oct-2010 | 100 | |
| Nov-2010 | 110 | |
| Dec-2010 | 120 | |
| Jan-2011 | 10 | |
| Feb-2011 | 20 | 
Attached are two approaches.
The first uses an AsOf table to connect each month to all of the months YTD. That lets you do a simple sum(Sales) with no chart accumulation, and the data model itself handles the accumulation. That's the approach I suggest since it doesn't depend on how the chart is sorted and what values are selected.
Months:
LOAD date(fieldvalue('Month',iterno())) as Month
AUTOGENERATE 1
WHILE len(fieldvalue('Month',iterno()))
;
AsOfMonth:
LOAD
 Month as AsOfMonth
,date(addmonths(Month,1-iterno()),'MMM-YYYY') as Month
RESIDENT Months
WHILE iterno() <= month(Month)
;
DROP TABLE Months;
But a much simpler approach that may be good enough in some cases is this:
rangesum(above(sum(Sales),0,month(Month)))
Thank you verymuch it worked.
John, i was following the second method. But my fiscal year starts from august not jan. in that case above function not giving correct results. Could you suggest any solution for this?
I think this?
rangesum(above(sum(Sales),0,mod(month(Month)+4,12)+1))
Great. It worked fine 
 thank you .
Hello Sir,
Attached is the Graph i'm looking to create,
the problem is to show the single bar graph with different colors each representing the new amt added.
Regards