My table is something like this
Allocated_cost,Start_date,End_date
12,000 11/2014,11/2015
12,000 12/2014,12/2015
I would like to calculate rolling cost by month, for example if you look above cost for 11/14 & 12/15 is $1000 per month whereas the rest is $2000/month.I have to show this inform of graph.This can be done either in ruby or sql. Can someone help with the logic, all I need is some kind of array
[11/2014,1000],[12/2014,2000]...etc.
Just need some help with the logic..
Thanks