Skip to content

Measures in views don't inherit drill_members #6778

@DPHonys

Description

@DPHonys

Question

Hi, I have a question about measures that are included in a view... I would expect them to keep the drill-down members if they are included... like if I define a measure in cube with drill-down members the view that includes the measure should have the same drill-down members. Because if I want to use the resultSet.drillDown() method it will return null because the DrillDownLocator uses TaskView.count as the yValue (and the TaskView.count does not have the drill-down members like TaskCube.count - as seen bellow in generated META). So am I missing something or am I going about this totally wrong?

Related Cube.js schema
TaskCube.js

cube(`TaskCube`, {
  sql: `SELECT * FROM public.task`,
  rewriteQueries: true,
  sqlAlias: `task`,
  shown: false,

  measures: {
    count: {
      type: `count`,
      drill_members: [CUBE.id, CUBE.type, CUBE.state],
    },
  },

  dimensions: {
    id: {
      sql: `task_id`,
      type: `number`,
      primaryKey: true,
    },

    type: {
      sql: `type`,
      type: `string`,
    },

    state: {
      sql: `state`,
      type: `number`,
    },
  }
}

TaskView.js

view(`TaskView`, {
  description: `Task view`,

  includes: [
    TaskCube.count,
  ]
}

Related Cube.js generated META

{
            "public": false,
            "name": "TaskCube",
            "type": "cube",
            "title": "Task Cube",
            "connectedComponent": 1,
            "measures": [
                {
                    "name": "TaskCube.count",
                    "title": "Task Cube Count",
                    "shortTitle": "Count",
                    "cumulativeTotal": false,
                    "cumulative": false,
                    "type": "number",
                    "aggType": "count",
                    "drillMembers": [
                        "TaskCube.id",
                        "TaskCube.type",
                        "TaskCube.state"
                    ],
                    "drillMembersGrouped": {
                        "measures": [],
                        "dimensions": [
                            "TaskCube.id",
                            "TaskCube.type",
                            "TaskCube.state"
                        ]
                    },
                    "isVisible": false
                }
            ],
            "dimensions": [
                {
                    "name": "TaskCube.id",
                    "title": "Task Cube Id",
                    "type": "number",
                    "shortTitle": "Id",
                    "suggestFilterValues": true,
                    "isVisible": false
                },
                {
                    "name": "TaskCube.type",
                    "title": "Task Cube Type",
                    "type": "string",
                    "shortTitle": "Type",
                    "suggestFilterValues": true,
                    "isVisible": false
                },
                {
                    "name": "TaskCube.state",
                    "title": "Task Cube State",
                    "type": "number",
                    "shortTitle": "State",
                    "suggestFilterValues": true,
                    "isVisible": false
                }
            ],
            "segments": []
},
{
            "public": true,
            "name": "TaskView",
            "type": "view",
            "title": "Task View",
            "description": "Task view test",
            "measures": [
                {
                    "name": "TaskView.count",
                    "title": "Task View Count",
                    "shortTitle": "Count",
                    "cumulativeTotal": false,
                    "cumulative": false,
                    "type": "number",
                    "aggType": "count",
                    "drillMembers": [],
                    "drillMembersGrouped": {
                        "measures": [],
                        "dimensions": []
                    },
                    "isVisible": true
                }
            ],
            "dimensions": [],
            "segments": []
}

Cube version
v0.33.31 in Docker

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions