I looked at this and this before posting this. I don't understand the responses so much as to tweak them to fit into my needs, so any pointers in the right direction would be great.
So: Say there is a building object that has multiple 'expenses' records (master-detail relationship). Needless to say that the number of expenses per building could vary (electricity, phone, internet, cleaning... etc) Every expense has an escalation rate every year.
What I am trying to do is to generate a report per building like so:
Month Expense1 Expense2 Expense3 ... MonthTotal
1/1/2015 $100 $150 $200 ... SUM
2/1/2015 $100 $150 $200 ... SUM
.
.
.
.
1/1/2016 $100+increase $150+increase $200+increase ... SUM
.
.
.
If there were going to be a finite number of expenses, I know I could just create a data structure and display the report using List. But how do I do this when the number of expenses is varying?
EDIT: How to add a new column for cumulative sum? Like so:
Month Expense1 Expense2 Expense3 ... MonthTotal CUMULATIVE TOTAL
1/1/2015 $100 $150 $200 ... sum1 SUM1
2/1/2015 $100 $150 $200 ... sum2 (SUM2 + SUM1)
.
.
.
.
1/1/2016 $100+increase $150+increase $200+increase ... sumX (SUMX + SUM(X-1) + SUM(X-2) +... + SUM2 + SUM1)
.
.
.