cube-js / cube-js/cube

Support for "last" measure with preaggs

Open
#593 2 comments 0 reactions 0 assignees View on GitHub
backend:server data modeling
Dominant language
Rust
Stars
20.8k
Forks
2.1k
Avg merge
1d 5h
Merged PRs (30d)
193

Description

**Is your feature request related to a problem? Please describe.**
I have a schema where I want to select the last value, base on the timestamp, for a given dimension. I currently use (with presto as db):

last: {
sql: `max_by(value, ${CUBE}.timestamp)`,
type: `number`
},

which works well except that it doesn't match to any preaggs.

**Describe the solution you'd like**
I was wondering if it would be possible to include `first` and `last` as builtin measure types to allow them to work with preaggs

**Describe alternatives you've considered**
Not sure if there are any other ways to get this to work with rollups, can't find any docs on rollups + number measure type

**Additional context**
trying to build a realtime view

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.