Download numbers inconsistent between single and multi month reports

Hi all,

Piwik 2.16.1 here. I recently encountered an issue similar to Actions.getDownloads-- inconsistent data between encapsulating date ranges and Download numbers inconsistent for different periods.

Specifically, I noticed that Piwik seems to ‘drop’ downloads from my report if I switch from single month reports to multi month reports.

My setup:

  • run download report for june 2017 (R1), 111 items
  • run download report for july 2017 (R2), 109 items
  • run download report for june and july 2017 combined (R3), 112 items
  • download, manually merge and clean up R1 and R2 to get R4 and compare that to R3

Now it gets odd. R3 has 112 items. My R4 has 169 items. Both however end with the exact same 4 items (having between 1 and 4 unique downloads), indicating that Piwik has somehow forgot to include 57 items (having between 5 and 11 unique downloads) in its own report. A quick check confirms that yes, the items missing from R3 are present in R1 and R2.

Even more odd: the first 100 items in R3 and R4 match perfectly. Only then do the inconsistencies begin. Could of course be nothing more than coincidence.

Since this does not affect items having only 1 unique download (and which Piwik thus might have merged under ‘other’ downloads), I’m quite at a loss to explain this. I certainly looks like unexpected beviour, if not a bug outright.

An explanation would be welcome, especially since this might call into question the reliability of any multi month reports we pull from Piwik.