-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathsegment_stripe.model.lkml
70 lines (57 loc) · 1.42 KB
/
segment_stripe.model.lkml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
connection: "segment_sources"
# include all the views
include: "*.view"
# include all the dashboards
include: "*.dashboard"
explore: calendar {
label: "Charges"
join: charges {
type: left_outer
relationship: one_to_many
sql_on: ${calendar.cal_date_date} = ${charges.created_date} ;;
}
join: customers {
type: left_outer
sql_on: ${charges.customer_id} = ${customers.id} ;;
relationship: many_to_one
}
join: invoices {
type: left_outer
sql_on: ${charges.invoice_id} = ${invoices.id} ;;
relationship: many_to_one
}
join: invoice_items {
type: left_outer
sql_on: ${invoices.id} = ${invoice_items.invoice_id} ;;
relationship: one_to_many
}
join: discounts {
type: left_outer
sql_on: ${customers.discount_id} = ${discounts.id} ;;
relationship: many_to_one
}
join: subscriptions {
type: left_outer
sql_on: ${invoices.subscription_id} = ${subscriptions.id} ;;
relationship: many_to_one
}
join: plans {
type: left_outer
sql_on: ${subscriptions.plan_id} = ${plans.id} ;;
relationship: many_to_one
}
}
explore: customer {
from: calendar
label: "Customers"
join: customers {
type: left_outer
sql_on: ${customer.cal_date_date} = ${customers.created_date} ;;
relationship: one_to_many
}
join: discounts {
type: left_outer
sql_on: ${customers.discount_id} = ${discounts.id} ;;
relationship: many_to_one
}
}