cube-js / cube-js/cube

Cannot pre-aggregate rolling measure with `count_distinct`

Open
#7,730 10 comments 0 reactions 0 assignees View on GitHub
pre-aggregations
Dominant language
Rust
Stars
20.8k
Forks
2.1k
Avg merge
1d 2h
Merged PRs (30d)
181

Description

**Describe the bug**
Trying to pre-aggregate a rolling_window measure give the error ` Error: Time series queries without dateRange aren't supported at BaseTimeDimension.timeSeries... `

**To Reproduce**
Create a measure with a rolling_window with a trailing start, create a pre-aggregation for it.

**Expected behavior**
I expect the pre-aggregation to function correctly.

**Minimally reproducible Cube Schema**

```javascript
cube(`session`, {
sql_table: `test_db`,
data_source: `default`,
measures: {
weeklyCount: {
sql: `id`,
type: `count`,
rollingWindow: {
leading: `1 week`,
offset: `start`,
},
},
},
dimensions: {
created_at: {
sql: `${CUBE}."created_at"`,
type: `time`
}
},
preAggregations: {
main: {
measures: [session.weeklyCount],
timeDimension: session.created_at,
granularity: `day`
}
}
});
```

**Version:**
0.34.50

**Additional context**
Using PostgreSQL, but might be the same issue as #6813 who is using MS SQL

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.