cube-js / cube-js/cube

Feedback for “Subquery dimensions”

Open
#7,747 7 comments 1 reaction 0 assignees View on GitHub
question
Dominant language
Rust
Stars
20.8k
Forks
2.1k
Avg merge
1d 2h
Merged PRs (30d)
181

Description

I was looking at this and it seemed to be what I needed. However, the page doesn't discuss usage of Subquery dimensions when you are querying with a time dimension. When I use it with a time dimension, the subquery doesn't account for time. It is just a general query that calculates over all data and doesn't group by the time granularity or filter within the date range specified in the query.

For the example given (average sales per sales manager) it seems natural that you can extend this by adding a time dimension so you can graph average sales per manager over time. But that's not possible with Subquery dimensions. What you get as a result is each day showing the average of sales managers who had a deal on said day, but the average amount is the average of each manager's total sales over all time, rather than during the day in question.

I think either I've found a bug, or a better example should be given where it doesn't matter that the subquery doesn't account for time. Otherwise others will be misled by the intention of Subquery dimensions and spend a lot of time scratching their head, like me!

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.