Skip to content

Commit 1752769

Browse files
committed
Update examples
1 parent 1f3f600 commit 1752769

File tree

2 files changed

+48
-57
lines changed

2 files changed

+48
-57
lines changed

docs/pages/guides/recipes/access-control/controlling-access-to-cubes-and-views.mdx

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,15 @@ cubes:
5252
views:
5353
- name: total_revenue_per_customer
5454
public: {{ COMPILE_CONTEXT['securityContext']['isFinance'] }}
55-
includes:
56-
- orders.total_revenue
57-
- users.company
55+
56+
cubes:
57+
- join_path: orders
58+
includes:
59+
- total_revenue
60+
61+
- join_path: users
62+
includes:
63+
- company
5864
```
5965
6066
```javascript
@@ -75,12 +81,25 @@ cube(`users`, {
7581
});
7682

7783
// total_revenue_per_customer.js
78-
view("total_revenue_per_customer", {
84+
view(`total_revenue_per_customer`, {
7985
description: `Total revenue per customer`,
8086
public: COMPILE_CONTEXT.securityContext.isFinance,
8187

82-
includes: [orders.total_revenue, users.company],
83-
});
88+
cubes: [
89+
{
90+
join_path: orders,
91+
includes: [
92+
`total_revenue`
93+
]
94+
},
95+
{
96+
join_path: users,
97+
includes: [
98+
`company`
99+
]
100+
}
101+
]
102+
})
84103
```
85104

86105
</CodeTabs>

docs/pages/reference/data-model/view.mdx

Lines changed: 23 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,20 @@ view(`arr`, {
292292
description: `Annual Recurring Revenue`,
293293
public: COMPILE_CONTEXT.security_context.is_finance,
294294

295-
includes: [revenue.arr, revenue.date, customers.plan],
296-
});
295+
cubes: [
296+
{
297+
join_path: revenue,
298+
includes: [
299+
`arr`,
300+
`date`
301+
]
302+
},
303+
{
304+
join_path: customers,
305+
includes: `plan`
306+
}
307+
]
308+
})
297309
```
298310

299311
```yaml
@@ -302,12 +314,15 @@ views:
302314
description: Annual Recurring Revenue
303315
public: COMPILE_CONTEXT.security_context.is_finance
304316

305-
includes:
306-
# Measures
307-
- revenue.arr
308-
# Dimensions
309-
- revenue.date
310-
- customers.plan
317+
cubes:
318+
- join_path: revenue
319+
includes:
320+
- arr
321+
- date
322+
323+
- join_path: customers
324+
includes:
325+
- plan
311326
```
312327
313328
</CodeTabs>
@@ -340,49 +355,6 @@ views:
340355

341356
</CodeTabs>
342357

343-
### `includes` (deprecated)
344-
345-
<WarningBox>
346-
347-
The top-level `includes` parameter is deprecated and might be removed in
348-
the future. Please always use the `includes` parameter with `cubes` and
349-
`join_path` parameters so you can explicitly control the join path.
350-
351-
</WarningBox>
352-
353-
The top-level `includes` parameter is used to bulk add measures or dimensions
354-
to a view.
355-
356-
<CodeTabs>
357-
358-
```javascript
359-
view(`active_users`, {
360-
includes: [
361-
// Measures
362-
users.rolling_count,
363-
364-
// Dimensions
365-
users.city,
366-
users.created_at,
367-
],
368-
});
369-
```
370-
371-
```yaml
372-
views:
373-
- name: active_users
374-
375-
includes:
376-
# Measures
377-
- users.rolling_count
378-
379-
# Dimensions
380-
- users.city
381-
- users.created_at
382-
```
383-
384-
</CodeTabs>
385-
386358

387359
[ref-recipe-control-access-cubes-views]:
388360
/guides/recipes/access-control/controlling-access-to-cubes-and-views

0 commit comments

Comments
 (0)