Skip to content

ResultSet | chartPivot & tablePivot | Missing data is always forced to 0 #9960

@mike-paretos

Description

@mike-paretos

Describe the bug
Missing measure data is force to be zero due to bug:

const measureValue = (row, measure) => row[measure] || pivotConfig.fillWithValue || 0;

something like this would work better:

const measureValue = (row, measure) => row[measure] ?? pivotConfig.fillWithValue ?? 0;

https://github.com/cube-js/cube/blob/master/packages/cubejs-client-core/src/ResultSet.ts#L537

To Reproduce
Steps to reproduce the behavior:

  1. Create Result Set with some null measures
  2. Perform chartPivot with fillWithValue: null
  3. Missing values filled with 0

Expected behavior
Missing values filled with null

Screenshots

Image

Version:
1.3.67

Metadata

Metadata

Assignees

No one assigned

    Labels

    client:coreIssues relating to the JavaScript client SDK

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions