Hi everybody,
I'm working on a generic report who should be able to pull also the report structure and the actual data from external files.
Among other requests, there is the need for calculating rows based on values of other rows.
To be more specific, this is the data (of course, oversimplified):
This is the report structure template (rows with formulas using the above data). As you can observe, there are (a) rows with formula based on items from the data source (R1,R2,R3) with row type I and (b) rows with formula based other rows (R10,R11,R12) with row type R. I added the type to help me with the load mechanism.
And this should be the final result (after performing the calculations) displayed in the report:
My approach was to try and split the formula in it's smallest parts, the items, find out the sign for each item and then it would have been simply a matter of summing up all the values in a straight table. Ideally, the data model should look something like this:
I managed to calculate the simple rows based solely on items (R1,R2,R3) and the rows based on other simple rows (R10). I'm stuck with expanding the formula for mixed rows (simple row plus row based on another rows) - R11 and the more complex rows based on rows based on rows - R12.
I've attached the sample file and the report.