-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpayment.view.lkml
86 lines (75 loc) · 1.44 KB
/
payment.view.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
view: payment {
sql_table_name: public.payment ;;
dimension: payment_id {
primary_key: yes
type: number
sql: ${TABLE}.payment_id ;;
}
dimension: amount {
type: number
sql: ${TABLE}.amount ;;
}
dimension: customer_id {
type: number
# hidden: yes
sql: ${TABLE}.customer_id ;;
}
dimension_group: payment {
type: time
timeframes: [
raw,
time,
date,
week,
month,
quarter,
year
]
sql: ${TABLE}.payment_date ;;
}
measure: count_payments_test{
description: "Count of emails sent within 365 day of the user subscribing"
type: count_distinct
sql: ${customer_id} ;;
filters: {
field: rental_id
value: "[1200,1300]"
}
}
dimension: rental_id {
type: number
# hidden: yes
sql: ${TABLE}.rental_id ;;
}
dimension: staff_id {
type: number
# hidden: yes
sql: ${TABLE}.staff_id ;;
}
measure: count {
type: count
drill_fields: [detail*]
}
measure: first_order {
type: date
sql: MIN(${TABLE}.payment_date) ;;
}
measure: lifetime_sale {
type: sum
sql: ${TABLE}.amount ;;
}
# ----- Sets of fields for drilling ------
set: detail {
fields: [
payment_id,
rental.rental_id,
staff.last_name,
staff.username,
staff.staff_id,
staff.first_name,
customer.first_name,
customer.last_name,
customer.customer_id
]
}
}