Skip to content

Commit

Permalink
docs: Leaf measure additive pre-aggregation example
Browse files Browse the repository at this point in the history
  • Loading branch information
paveltiunov authored Oct 28, 2019
1 parent 41cd46c commit 0c73949
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/Schema/pre-aggregations.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ cube(`Orders`, {
revenue: {
sql: `amount`,
type: `sum`
},

averageRevenue: {
sql: `${amount} / ${count}`,
type: `number`
}
},

Expand Down Expand Up @@ -133,6 +138,7 @@ In this particular example these queries will use `categoryAndDate` pre-aggregat
- Order Revenue by Category this month
- Order Count by Created At Day this year
- Order Count for all time
- Order Average Revenue by Category this month

These queries won't use `categoryAndDate` pre-aggregation:
- Order Revenue by Created At Week this year
Expand Down

0 comments on commit 0c73949

Please sign in to comment.