[Feature request] Use dimensions from pre-aggregations to calculate measures
- Dominant language
- Rust
- Stars
- 20.8k
- Forks
- 2.1k
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 181
Description
Hi there!
We’re trying to build a cube like the one below, and we expected it to use pre-aggregations to calculate the `metric` because the `pre_aggregations` include the `day` dimension. However, the generated query doesn’t seem to involve the pre-aggregations.
**Feature Request:** Use dimensions from pre-aggregations to calculate measures.
```javascript
cube('model', {
public: false,
title: 'model',
sql: `SELECT 1 as metric, 1 as day`,
dimensions: {
day: {
sql: `day`,
type: 'number'
}
},
measures: {
metric: {
sql: `${day}`,
type: `count_distinct`
}
},
pre_aggregations: {
model_rollup: {
measures: [],
dimensions: [
CUBE.day
],
external: false,
}
}
});
```
Contributor guide
Assessment
This issue has not been assessed yet.