@fdellwing opened this Issue on July 2nd 2018 Contributor

So, there is something going on my nerves for quite some time now:

If you had 0 visits yesterday and any visit today, it shows 100%.
If you had 1 visit yesterday and more than 2 today it shows a value more than 100%.

This is mathematical correct, but in imho a big problem.

Take the following scenario:
Changes are like 0 -> 500 and 1 -> 20. Than it shows 100% for the first and 1900% for the second evolution. Implying that the second one increased more than the first one, which is absolutely wrong.

I do not really have a solution right now, but maybe someone else? Or do you not see a problem with that?

matomo1

@tsteur commented on July 2nd 2018 Member

Yeah I know exactly what you mean. Not sure how to fix though, maybe in the UI could show something like "New" but I presume the API would maybe still expect some number or so.

@fdellwing commented on July 3rd 2018 Contributor

I thought about using ∞ (∞) instead of 100%, but that is also not a valid number, so duh.

@fdellwing commented on May 10th 2019 Contributor

I thought about this some more.

Instead of changing the output, it might be better to change the input?

https://github.com/matomo-org/matomo/blob/c6eb52339f3fc496ac43b55c4a0de8d161edbff4/plugins/CoreHome/Columns/Metrics/EvolutionMetric.php#L109-L111

Here it is hard coded to return 100% if the old value (divisor) is 0. Well we could instead provide an arbitrary divisor for the calculation.

I think there are 2 possible arbitrary numbers to choose from:

return Piwik::getQuotientSafe($dividend, 1, $this->quotientPrecision + 2);

Will return the same as if the old value was 1.

return Piwik::getQuotientSafe($dividend, 1.0E-10, $this->quotientPrecision + 2);

Will return a huge number and is easily distinguishable from the old value 1.

What are your thoughts with this? @tsteur

@tsteur commented on May 12th 2019 Member

Not really sure what is best here. Maybe @mattab has some thoughts.

Powered by GitHub Issue Mirror