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

missing data is always forced to 0 #4604

Open
vprus opened this issue May 26, 2022 · 2 comments
Open

missing data is always forced to 0 #4604

vprus opened this issue May 26, 2022 · 2 comments
Assignees
Labels
bug Something isn't working logged reviewed

Comments

@vprus
Copy link

vprus commented May 26, 2022

Since commit https://github.com/cube-js/cube.js/pull/3664/files if a pivot does not have any values for particular combination of dimensions, '0' is returned. This is suboptimal, because in a number of contexts, missing data and zero have different meaning. For example, I use cubejs to visualize certain business predictions, where missing data can indicate a technical problem, while "0" indicates a business problem.

To reproduce

Start cubejs with docker with

% docker run -p 4000:4000 \
  -v ${PWD}:/cube/conf \
  -e CUBEJS_DEV_MODE=true \
  cubejs/cube

Make sure the version is 0.30.7 (the current one as of today) or later.

Connect to a database (I've used clickhouse)

Define schema as

cube('Test', {
    sql: `
SELECT * FROM VALUES('x Int64, y Int64, value Int64', (1, 1, 7), (2, 2, 19))
`,



    measures: {
	value: {
	    sql: `value`,
	    type: `sum`
        }
    },

    dimensions: {
	x: {
	    sql: `x`,
	    type: `number`
	},
	y: {
	    sql: `y`,
	    type: `number`
	}
    }
})

Go to the build tab, and build the query as follows:

  • Select value as measure
  • Select x and y as dimensions
  • In pivot config, use 'x' for x axis, and 'y,measures' for y axis
  • Leave "Fill Missing Dates" at the default state of checked.

Run the query.

Observed effect

Each table cell we have no values for shows "0"

Expected effect

Each table cell we have no value for is empty. Previously (at least in version 0.27.35), that's exactly what happened.

Version:
0.30.7

@vasilev-alex
Copy link
Member

Hi @vprus!

Yeah, we missed that part out. But reverting this will cause a breaking change, which we only can do in the next minor release.

@vprus
Copy link
Author

vprus commented Jun 1, 2022

Thank you, as soon as it is fixed eventually, I'll be happy, no rush.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working logged reviewed
Projects
None yet
Development

No branches or pull requests

3 participants