-
Notifications
You must be signed in to change notification settings - Fork 0
/
order_items.view.lkml
64 lines (53 loc) · 1.04 KB
/
order_items.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
view: order_items {
sql_table_name: demo_db.order_items ;;
dimension: id {
primary_key: yes
type: string
sql: ${TABLE}.id ;;
}
parameter: test_parameter {
type: string
}
measure: field_for_the_single_value_vis {
sql:
case
when {% parameter inventory_item_id %} = 'blah' then ${order_id}
when {% parameter inventory_item_id %} = 'blahblah' then ${count}
end ;;
}
dimension: inventory_item_id {
type: string
# hidden: yes
sql: ${TABLE}.inventory_item_id ;;
}
dimension: order_id {
type: number
# hidden: yes
sql: ${TABLE}.order_id ;;
}
dimension_group: returned {
type: time
timeframes: [
raw,
time,
date,
week,
month,
quarter,
year
]
sql: ${TABLE}.returned_at ;;
}
measure: count_of_orders {
type: count_distinct
sql: ${TABLE}.order_id ;;
}
dimension: sale_price {
type: number
sql: ${TABLE}.sale_price ;;
}
measure: count {
type: count
drill_fields: [id, inventory_items.id, orders.id]
}
}