Are you using Framework Manager or a Data Module? This is one of those cases where building a quick DMR model will make this infinitely easier.
If you have to use the relational, having a limited number of types will make this a little easier.
First, if you don't already have it, make a separate data item for each type. In my example I'm using Order Method Type, so I'll have a bunch.
case [C].[C_Great_outdoors_sales_data_module].[page_1].[Order_method_type]
when 'E-mail' then [Revenue]
else 0
end
Setting the detail and summary aggregation total. Repeat for all types

Next create a data item to calculate the moving total minus the current total, this gives you the beginning balance you're looking for:
moving-total([Revenue],2) - [Revenue]
We can extend that out to get things like variance if needed
[Revenue] - [Beginning Revenue]
[Variance] / [Beginning Revenue]
The crosstab should look like this:

And when run we see:

The only reason this works is that the query returns a single row per month. If we had nested Order method type, it won't work anymore

I've experimented a bit with different forms using for, but nothing works well, especially as there are some gaps in the data (e.g., Special/February).
In general I find crosstabs work best with OLAP or dimensionally modelled data, which is one of the reasons I'm constantly pushing IBM to include some form of DMR modelling in Data Modules.
------------------------------
Paul Mendelson
------------------------------
Original Message:
Sent: Mon March 11, 2024 10:37 AM
From: Sachin Kandalgaonkar
Subject: Creating Cognos report where total of one column is start for another column.
Hi,
I am trying to create a report where the total for one column becomes the start of the next column.
| Type | Jan | Feb | Mar | Apr |
| Begin Bal | 0 | 3349 | 5708 | 10534 |
| Tyoe A | 123 | 561 | 4341 | 731 |
| Type B | 83 | 1345 | 413 | 1354 |
| Type C | 3143 | 453 | 72 | 4545 |
| End Bal | 3349 | 5708 | 10534 | 17164 |
The data in the table is only for Type A,B, and C. The Begin Bal for Jan is 0. For Feb the Begin Bal is the End Bal for Jan (which is Total for the month) and so on for the next months.
The data is coming from a relational model.
Any ideas on how to develop thiis Cognos Reports?
Thanks & Regards
Sachin
------------------------------
Sachin Kandalgaonkar
------------------------------