metabase / metabase

The simplest, fastest way to get business intelligence and analytics to everyone in your company :yum:
https://metabase.com
Other
38.69k stars 5.14k forks source link

Tooltip on unaggregated data does not show summed value like the visualization #11907

Closed flamber closed 3 years ago

flamber commented 4 years ago

Describe the bug When showing a line/bar chart with unaggregated data, it sums up the values correctly in the visualization, but hovering the tick will only show a single data point in the tooltip. Hovering the warning triangle in the right-top corner of the visualization will show the warning: "d" is an unaggregated field: if it has more than one value at a point on the x-axis, the values will be summed.

To Reproduce Run this SQL (H2) and set the visualization to line/bar and hover the first tick, which has a summed value of 10 (shown on the visualization correctly), but will show 5 in the tooltip.

SELECT parsedatetime('2020-01-01', 'yyyy-MM-dd') AS "d", 5 AS "c" UNION ALL
SELECT parsedatetime('2020-01-01', 'yyyy-MM-dd') AS "d", 2 AS "c" UNION ALL
SELECT parsedatetime('2020-01-01', 'yyyy-MM-dd') AS "d", 3 AS "c" UNION ALL
SELECT parsedatetime('2020-01-02', 'yyyy-MM-dd') AS "d", 1 AS "c" UNION ALL
SELECT parsedatetime('2020-01-02', 'yyyy-MM-dd') AS "d", 4 AS "c"

Expected behavior Tooltip should show same value as the visualization.

Screenshots Screenshot_00000

Information about your Metabase Installation: Metabase x.34.2 and master with multiple backends and browsers.

:arrow_down: Please click the :+1: reaction instead of leaving a +1 or update? comment

kjohnston commented 4 years ago

I'm running into this as well on 0.34.3

alxnddr commented 3 years ago

Fixed by https://github.com/metabase/metabase/pull/15472

camsaul commented 3 years ago

We couldn't merge #15472 into release-x.39.x because it caused a regression of #15612 -- see #15685 for more context. We'll need to do a separate fix for this for 39+

alxnddr commented 3 years ago

Fixed by https://github.com/metabase/metabase/pull/15783

There is a rarer case with breakouts https://github.com/metabase/metabase/issues/15785

@flamber should I close this issue?

flamber commented 3 years ago

Fixed by #15778