cube-js/cube

Default TimeDimensions when Select Dimensions

Open

#5279 aperta il 12 set 2022

Vedi su GitHub
 (1 commento) (0 reazioni) (0 assegnatari)Rust (1965 fork)batch import
help wanted

Metriche repository

Star
 (19.563 star)
Metriche merge PR
 (Merge medio 5g 16h) (138 PR mergiate in 30 g)

Descrizione

Problem

I'm wondering if we can given a default timeDimensions when only selecting dimensions in one query. I mean, it look like cube won't offer a timeDimensions automatically if I firstly choose dimensions. However, if I select measures at the beginning, it will automatically give the first timeDimensions which is defined in backend Schema.

Below are two example, we can clearly see timeDimensions differed from each other.

Firstly choose measures

query  {"measures":["AlarmCodeHistory.count"],"dimensions":[],"segments":[],"timeDimensions":[{"dimension":"AlarmCodeHistory.startTime","dateRange":["2022-09-12T00:00:00.000","2022-09-12T23:59:59.999"]}],"filters":[],"order":[{"id":"AlarmCodeHistory.count","desc":false}],"timezone":"Asia/Taipei"}

image

Firstly choose dimensions

query  {"measures":[],"dimensions":["AlarmCodeHistory.code"],"segments":[],"timeDimensions":[],"filters":[],"order":[{"id":"AlarmCodeHistory.code","desc":false}],"timezone":"Asia/Taipei"}

image

My concern is if we don't give a timeDimension automatically, the query might take much time.

Guida contributor