Skip to content
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.

Max when use SUM calculation #16

Closed
MiguelAngelLV opened this issue Oct 19, 2020 · 8 comments · Fixed by #19
Closed

Max when use SUM calculation #16

MiguelAngelLV opened this issue Oct 19, 2020 · 8 comments · Fixed by #19
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@MiguelAngelLV
Copy link

Hi.

When I use SUM calculation, the max is the same that when I use AVG calculation, so, the most of cells are over the max and I must set the max manually.

@marcusolsson
Copy link
Owner

I'm afraid I don't fully understand what you mean. Could you give me an example?

@MiguelAngelLV
Copy link
Author

MiguelAngelLV commented Oct 22, 2020

Hi. Example:

My values for first hour: 5 + 5 + 5 -> Average 5, Sum 15
My values for second hour: 7 + 3 + 10 -> Average: 6.3, Sum: 20
My values for third hour: 0 + 0 + 0 -> Avarage: 0, Sum: 0

When I select AVG Calculation, the range of values is from 0 to 6.3.

First hour orange, second hour is red and first blue. Perfect!

The problem is con Sum Calculante, the range of values is from 0 to 6.3 too instead of 0 to 20.

So. first hour is red, second is red and third is blue... Not perfect...

@EBZ-Krisemendt
Copy link

i hook up on that issue since i got a similar problem with calculation.
no matter which sort of calculation i pick, it does use the last value in that bucket instead

@marcusolsson
Copy link
Owner

Gotcha! I'll look into this during the weekend to see if I can replicate/fix this!

@marcusolsson marcusolsson added the kind/bug Categorizes issue or PR as related to a bug. label Oct 29, 2020
@marcusolsson marcusolsson added this to To do in Grafana Plugins Nov 9, 2020
@marcusolsson marcusolsson moved this from To do to In progress in Grafana Plugins Nov 9, 2020
@marcusolsson
Copy link
Owner

Unfortunately, I haven't able to replicate this yet. Let me know if my test is different from yours:

issue

@marcusolsson
Copy link
Owner

Oh, I think I know why this is. The min and max are computed by Grafana from the fields, rather than the aggregation. Does it work if you set the min and max manually?

@MiguelAngelLV
Copy link
Author

MiguelAngelLV commented Dec 7, 2020 via email

@marcusolsson
Copy link
Owner

Yeah, just wanted to confirm. Max and min should depend on the result of the calculation rather than the raw data. Thanks for clarifying 🙏

marcusolsson added a commit that referenced this issue Dec 29, 2020
Grafana Plugins automation moved this from In progress to Done Jan 9, 2021
marcusolsson added a commit that referenced this issue Jan 9, 2021
* Compute min and max from aggregated values

Fixes #16 and #18

* Detect whether automatic min/max is set

* Refactor
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

3 participants