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

Pivot Table: If a value in a cell is NULL and has a Suffix it will display in the table as "null Suffix" #42867

Closed
ixipixi opened this issue May 17, 2024 · 0 comments · Fixed by #47435
Assignees
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
Milestone

Comments

@ixipixi
Copy link
Contributor

ixipixi commented May 17, 2024

Describe the bug

If a pivot table has a cell with a NULL value it displays an empty cell in the visualization unless a suffix has been configured. In that case it displays "null" with the suffix appended on the end.

Without suffix:
one

With Suffix:
two

To Reproduce

  1. Create a Model using this query from the Sample Database:

(SELECT
"PUBLIC"."PRODUCTS"."ID" AS "ID",
"PUBLIC"."PRODUCTS"."EAN" AS "EAN",
"PUBLIC"."PRODUCTS"."TITLE" AS "TITLE",
"PUBLIC"."PRODUCTS"."CATEGORY" AS "CATEGORY",
"PUBLIC"."PRODUCTS"."VENDOR" AS "VENDOR",
"PUBLIC"."PRODUCTS"."PRICE" AS "PRICE",
"PUBLIC"."PRODUCTS"."RATING" AS "RATING",
"PUBLIC"."PRODUCTS"."CREATED_AT" AS "CREATED_AT"
FROM
"PUBLIC"."PRODUCTS"
where "PUBLIC"."PRODUCTS"."CATEGORY" <> 'Gizmo'
LIMIT 50)

union all

( SELECT
"PUBLIC"."PRODUCTS"."ID" AS "ID",
"PUBLIC"."PRODUCTS"."EAN" AS "EAN",
"PUBLIC"."PRODUCTS"."TITLE" AS "TITLE",
"PUBLIC"."PRODUCTS"."CATEGORY" AS "CATEGORY",
"PUBLIC"."PRODUCTS"."VENDOR" AS "VENDOR",
null AS "PRICE",
"PUBLIC"."PRODUCTS"."RATING" AS "RATING",
"PUBLIC"."PRODUCTS"."CREATED_AT" AS "CREATED_AT"
FROM
"PUBLIC"."PRODUCTS"
LIMIT 50)

  1. In the GUI Builder take a minimum of price grouped by Category and Vendor
  2. View as a Pivot and observe all of the empty price results for the "Gizmo" category
  3. Add " dollars" as a suffix for the price measure
  4. Observe the cells now display "null dollars"

Expected behavior

The cell should still be empty

Logs

No response

Information about your Metabase installation

{
  "browser-info": {
    "language": "en-US",
    "platform": "Win32",
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36",
    "vendor": "Google Inc."
  },
  "system-info": {
    "file.encoding": "UTF-8",
    "java.runtime.name": "OpenJDK Runtime Environment",
    "java.runtime.version": "11.0.23+9",
    "java.vendor": "Eclipse Adoptium",
    "java.vendor.url": "https://adoptium.net/",
    "java.version": "11.0.23",
    "java.vm.name": "OpenJDK 64-Bit Server VM",
    "java.vm.version": "11.0.23+9",
    "os.name": "Linux",
    "os.version": "5.15.133.1-microsoft-standard-WSL2",
    "user.language": "en",
    "user.timezone": "GMT"
  },
  "metabase-info": {
    "databases": [
      "h2",
      "postgres"
    ],
    "hosting-env": "unknown",
    "application-database": "postgres",
    "application-database-details": {
      "database": {
        "name": "PostgreSQL",
        "version": "11.22 (Debian 11.22-1.pgdg110+1)"
      },
      "jdbc-driver": {
        "name": "PostgreSQL JDBC Driver",
        "version": "42.7.2"
      }
    },
    "run-mode": "prod",
    "version": {
      "date": "2024-05-09",
      "tag": "v1.49.9",
      "hash": "c0913c7"
    },
    "settings": {
      "report-timezone": null
    }
  }
}

Severity

It's not pretty

Additional context

No response

@ixipixi ixipixi added Type:Bug Product defects .Needs Triage Priority:P3 Cosmetic bugs, minor bugs with a clear workaround labels May 17, 2024
@alxnddr alxnddr added .Frontend .Team/DashViz Dashboard and Viz team Visualization/Tables Raw, summarized, and pivoted tables and removed .Needs Triage labels May 18, 2024
@alxnddr alxnddr self-assigned this Aug 28, 2024
@alxnddr alxnddr added Priority:P2 Average run of the mill bug and removed Priority:P3 Cosmetic bugs, minor bugs with a clear workaround labels Aug 28, 2024
@github-actions github-actions bot added this to the 0.50.24 milestone Aug 30, 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

Successfully merging a pull request may close this issue.

2 participants