Skip to content

Commit 36c15cd

Browse files
keydunovhassankhan
andauthored
docs: update data modeling section (#6563)
* docs: update data modeling section * docs: Add views to concepts * Update docs/content/Schema/Fundamentals/Syntax.mdx Co-authored-by: Hassan Khan <[email protected]> * Update docs/content/Schema/Reference/cube.mdx Co-authored-by: Hassan Khan <[email protected]> * Update docs/content/Schema/Reference/cube.mdx Co-authored-by: Hassan Khan <[email protected]> * Update docs/content/Schema/Fundamentals/Syntax.mdx Co-authored-by: Hassan Khan <[email protected]> * docs: clarify FILTER PARAMS usage --------- Co-authored-by: Hassan Khan <[email protected]>
1 parent 0af1df2 commit 36c15cd

File tree

6 files changed

+358
-79
lines changed

6 files changed

+358
-79
lines changed

docs/content/Schema/Reference/schema-execution-environment.mdx renamed to docs/content/Schema/Advanced/schema-execution-environment.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
2-
title: Execution Environment
2+
title: Execution Environment (JS models)
33
permalink: /schema/reference/execution-environment
44
scope: cubejs
55
category: Data Modeling
6-
subCategory: Reference
6+
subCategory: Advanced
77
menuOrder: 28
88
redirect_from:
99
- /schema-execution-environment

docs/content/Schema/Fundamentals/Additional-Concepts.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Additional concepts
33
permalink: /schema/fundamentals/additional-concepts
44
category: Data Modeling
55
subCategory: Fundamentals
6-
menuOrder: 11
6+
menuOrder: 13
77
redirect_from:
88
- /drill-downs
99
- /subquery

docs/content/Schema/Fundamentals/Concepts.mdx

Lines changed: 79 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,85 @@ cubes:
8383
8484
</CodeTabs>
8585
86+
## Views
87+
88+
Views sit on top of the data graph of cubes and create a facade of your whole
89+
data model with which data consumers can interact. They are useful for defining
90+
metrics, managing governance and data access, and controlling ambiguous join
91+
paths.
92+
93+
Views **can not** have their own members. Instead, use the `cubes` or `includes` parameters
94+
to include measures and dimensions from other cubes into the view. In the
95+
example below, we create a new view `active_users` which is made up of properties
96+
from the `users` cube:
97+
98+
<CodeTabs>
99+
100+
```javascript
101+
view(`orders`, {
102+
cubes: [
103+
{
104+
join_path: base_orders,
105+
includes: [
106+
`status`,
107+
`created_date`,
108+
`total_amount`,
109+
`total_amount_shipped`,
110+
`count`,
111+
`average_order_value`
112+
]
113+
},
114+
{
115+
join_path: base_orders.line_items.products,
116+
includes: [
117+
{
118+
name: `name`,
119+
alias: `product`
120+
}
121+
]
122+
},
123+
{
124+
join_path: base_orders.users,
125+
prefix: true,
126+
includes: `*`,
127+
excludes: [
128+
`company`
129+
]
130+
131+
}
132+
]
133+
});
134+
```
135+
136+
```yaml
137+
views:
138+
- name: orders
139+
140+
cubes:
141+
- join_path: base_orders
142+
includes:
143+
- status
144+
- created_date
145+
- total_amount
146+
- total_amount_shipped
147+
- count
148+
- average_order_value
149+
150+
- join_path: base_orders.line_items.products
151+
includes:
152+
- name: name
153+
alias: product
154+
155+
- join_path: base_orders.users
156+
prefix: true
157+
includes: *
158+
excludes:
159+
- company
160+
161+
```
162+
163+
</CodeTabs>
164+
86165
## Dimensions
87166

88167
Dimensions represent the properties of a **single** data point in the cube.
@@ -181,8 +260,6 @@ cubes:
181260
Dimensions can be of different types, and you can find them all
182261
[here][ref-schema-dimension-types].
183262
184-
### <--{"id" : "Dimensions"}--> Time Dimensions
185-
186263
Time-based properties should be represented as dimensions with type `time`. Time
187264
dimensions allow grouping the result set by a unit of time (e.g. hours, days,
188265
weeks). In analytics, this is also known as "granularity".

0 commit comments

Comments
 (0)