nreco / pivotdata

.NET OLAP library for data aggregation and pivot tables calculation
https://www.nrecosite.com/pivot_data_library_net.aspx
45 stars 21 forks source link

PivotTable class: skip 'totals' entries in RowKeys and ColumnKeys calculation #11

Closed VitaliyMF closed 1 year ago

VitaliyMF commented 1 year ago

Normally IPivotData enumerator iterates only by 'real' data points (= where dimension keys are real values) and PivotTable.RowKeys / PivotTable.ColumnKeys calculation works well. However, there is a specific case when totals are mixed with normal entries - for example, when totals are calculated outside (say, on DB side) and then just loaded into IPivotData instance as described here. These 'totals' data points are processed in PivotTable class and lead to undesired excessive RowKey / ColumnKeys entries. To avoid that IPivotData needs to be wrapped with a special proxy that skips 'totals' data points (aka SkipTotalsPivotDataWrapper).

It makes sense to handle 'totals' entries inside PivotTable RowKeys/ColumnKeys calculation (to avoid need in SkipTotalsPivotDataWrapper); this change should not break anything.

VitaliyMF commented 1 year ago

Shipped in 1.4.2