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