cube-js / cube-js/cube

Remove duplicate timeDimension field from result data

Open
#676 1 comment 0 reactions 0 assignees View on GitHub
backend:server
Dominant language
Rust
Stars
20.8k
Forks
2.1k
Avg merge
1d 2h
Merged PRs (30d)
181

Description

Currently when I specify a Time Dimension in a query, the data in the result will include both this plus a duplicate value in another field which is named with a .granularity suffix.

For example if I specify a query like this:
```
{"timeDimensions": [{"dimension": "Cube.timeDimension", "granularity": "month"}], "measures": ["Cube.measure"]}]}
```
I am getting a result like this:
```
{"Cube.timeDimension.month":"2016-08-01T00:00:00.000","Cube.timeDimension":"2016-08-01T00:00:00.000","Cube.measure":1}
```

One of these 2 fields which both represent the same value, should be removed or there should be a way to tell the backend that we do not want the extra field returned in the result.
This is what I would like returned:
```
{"Cube.timeDimension":"2016-08-01T00:00:00.000","Cube.measure":1}
```

As a workaround I can remove the granularity from the `timeDimension` and specify the field as a regular dimension which enables the required grouping, and removes the unwanted extra field from the result data.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.