Skip to content

Commit

Permalink
refs matomo-org#4377 make sure metrics like sum_daily_nb_uniq_visitor…
Browse files Browse the repository at this point in the history
…s (which are renamed after aggregation) are summed correctly. If period is for instance 2014-04-01,2014-05-01 we will sum two periods. The month of April 2014 and May 1st. The dataTable of the month will already contain the renamed column (as it was aggregated before) whereas May 1st datatable will not contain the renamend column but the original. Both columns cannot be summed therefore and the original column will overwrite the value of the renamed column. Meaning sum_daily_nb_uniq_visitors is in this case always the value of May 1st
  • Loading branch information
tsteur committed May 7, 2014
1 parent c04cdb5 commit 9e86c79
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/ArchiveProcessor.php
Expand Up @@ -337,6 +337,12 @@ protected function aggregateDataTableRecord($name, $columnsAggregationOperation
$dataTable = $this->getArchive()->getDataTable($name, $idSubTable = null);
}

if ($dataTable instanceof Map) {
foreach ($dataTable->getDataTables() as $table) {
$this->renameColumnsAfterAggregation($table, $columnsToRenameAfterAggregation);
}
}

$dataTable = $this->getAggregatedDataTableMap($dataTable, $columnsAggregationOperation);
$this->renameColumnsAfterAggregation($dataTable, $columnsToRenameAfterAggregation);
return $dataTable;
Expand Down

0 comments on commit 9e86c79

Please sign in to comment.