Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null values in a pivot table can't be highlighted using the ' When Cell is Null' custom formatting condition #41708

Open
dleard opened this issue Apr 22, 2024 · 2 comments
Labels
.Frontend Priority:P2 Average run of the mill bug .Team/DashViz Dashboard and Viz team Type:Bug Product defects Visualization/Tables Raw, summarized, and pivoted tables

Comments

@dleard
Copy link

dleard commented Apr 22, 2024

Describe the bug

We were trying to create a custom formatting rule that would highlight any null values in our pivot table, but the "null" cells were not being highlighted. When introspecting the data returned by the query in developer tools, we can see that the summed values that we were attempting to highlight if they were null are never actually null in the data returned by the query, but it appears that the pivot table instead ignores any data in the "rows" object where any of the breakouts are null.

For example:
If I have a pivot table with a sum aggregation broken out by name, type and year. There is a value in a row for 2021, but not 2022 and 2023. In the data.rows object array returned by the query I have several objects in the array that match my summed value. Each object contains a value for the sum, but for all but one object (where year=2021) at least one of the name, type or year breakout value is null. I imagine these null breakout values are what the pivot table is using to decide whether or not to display a value in the cell. I think because of this, the conditional formatting rule never considers the sum in the other years to be null and therefore won't highlight it in the pivot table.

To Reproduce

  1. Create a question that summarizes on a column broken out by a few other columns where the aggregated column will be null in some places once the table is pivoted
  2. Pivot the table
  3. Add a conditional formatting rule to highlight any of the cells where the value of the aggregation is null
  4. The conditional formatting rule does not highlight the empty cells

Expected behavior

Empty cells in a pivot table should be highlighted when the custom formatting rule is applied.

Logs

No response

Information about your Metabase installation

Chrome: 124.0.6367.60
Ubuntu: 20.04
Database: Postgres
Metabase version: 0.49.6
Metabase internal database: Postgres

Severity

annoying

Additional context

No response

@dleard dleard added .Needs Triage Type:Bug Product defects labels Apr 22, 2024
@paoliniluis
Copy link
Contributor

Is this in the pivot table viz, or in the table viz (which can be pivoted)?

@dleard
Copy link
Author

dleard commented Apr 23, 2024

Is this in the pivot table viz, or in the table viz (which can be pivoted)?

On the pivot table viz. Once the question is pivoted, records in the original question that don't have a value for a year have "empty" cells in the pivot table for those years. It's those cells in the pivot table viz that we were trying to highlight when null.

@paoliniluis paoliniluis added .Frontend Visualization/Tables Raw, summarized, and pivoted tables Priority:P3 Cosmetic bugs, minor bugs with a clear workaround and removed .Needs Triage labels Apr 26, 2024
@cdeweyx cdeweyx added the .Team/DashViz Dashboard and Viz team label May 20, 2024
@cdeweyx cdeweyx added Priority:P2 Average run of the mill bug and removed Priority:P3 Cosmetic bugs, minor bugs with a clear workaround labels Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.Frontend Priority:P2 Average run of the mill bug .Team/DashViz Dashboard and Viz team Type:Bug Product defects Visualization/Tables Raw, summarized, and pivoted tables
Projects
None yet
Development

No branches or pull requests

3 participants