I've a table with brand's and dates. Ex:
and I created a select to give me the count and the accumulated value per month:
SELECT brand, date, COUNT(brand) qt, SUM(COUNT(brand) OVER (PARTITION BY brand, TO_DATE(TO_CHAR(date,'YYYY'),'YYYY') ORDER BY date ROWS BETWEEN unbounded preceding AND CURRENT ROW) qt_acum FROM table GROUP BY brand, date, TO_DATE(TO_CHAR(date,'YYYY'),'YYYY')
1) create a subquery which generates a list of all the brands and does a cartesian join to all of the months. Also add a dummy column called count and set that to 0 and cumulative_count column which you can set to null.
2) Outer join from the subquery to your existing query on brand and month.
3) Use nvl to show the count i.e. nvl(yourcount, subquery.count)
4) For the cumulative count do nvl(yourcumcount, lag...)) where the lag will retrieve the previous cumulative count.