[wdmmg-dev] aggregated sum differences

Carsten Senger senger at rehfisch.de
Tue Mar 22 15:28:36 UTC 2011


With #42 I implemented a listing in the entry view that show all the
elements that are aggregated into the current entry (if it is an
is_aggregated entry).

Now I had a look at an entry from the "eu" dataset that aggregates 300
other entries and noticed that the amount of the aggregate differs from the
sum of all aggregated entries in my query.

  196848866492 (from the aggregate)
- 196848867848 (sum of all aggregated entries I found in solr)
--------------
         -1356

For another aggregated entry in the "eu" dataset with 1301 subentries the
difference is 1496.

Does anyone know the reason for the difference?

Maybe its summed summed up rounding errors. We use floats for the amounts
and if we have enough calculation steps it's possible to get there.
Or it's a difference between the data stored in mongodb and the data stored
in solr (where my results are coming from). Or I don't catch the same
entries from solr that are aggregated in mongodb.


..Carsten




More information about the openspending-dev mailing list