-
Notifications
You must be signed in to change notification settings - Fork 0
/
yeezy_fact.view.lkml
84 lines (69 loc) · 1.75 KB
/
yeezy_fact.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
view: yeezy_fact {
derived_table: {
sql:
SELECT item_name, annual_high, annual_low, ask_count, current_highest_bid, bid_count, last_sale_price, image_url, CAST(DATE_ADD(CAST(release_date as DATE), INTERVAL 2000 YEAR) as TIMESTAMP) AS release, size, total_sale, total_sale_count, retail_price, average_price, size
FROM StockX.yeezy
WHERE {% condition shoe_name %} yeezy.item_name {% endcondition %}
;;
}
filter: shoe_name {
type: string
suggest_dimension: item_name
}
dimension: annual_high {
type: number
sql: ${TABLE}.Annual_High ;;
}
dimension: annual_low {
type: number
sql: ${TABLE}.Annual_Low ;;
}
dimension: ask_count {
type: number
sql: ${TABLE}.Ask_Count ;;
}
dimension: average_price {
type: number
sql: ${TABLE}.Average_Price ;;
}
dimension: bid_count {
type: number
sql: ${TABLE}.Bid_Count ;;
}
dimension: current_highest_bid {
type: number
value_format_name: id
sql: ${TABLE}.Current_Highest_Bid ;;
}
dimension: image {
type: string
sql: ${TABLE}.Image_URL ;;
html: <img src="{{ value }}" height = 300 width = 410>;;
}
dimension: item_name {
type: string
sql: ${TABLE}.Item_Name ;;
drill_fields: [size]
}
dimension: last_sale_price {
type: number
sql: ${TABLE}.Last_Sale_Price ;;
}
dimension: release {
type: date
sql: CAST(DATE_ADD(CAST(${TABLE}.release_date as DATE), INTERVAL 2000 YEAR) as TIMESTAMP);;
}
measure: retail_price {
type: sum
sql: ${TABLE}.Retail_Price ;;
}
dimension: size {
type: string
sql: cast(${TABLE}.Size AS string) ;;
}
dimension: total_sale {
type: number
sql: ${TABLE}.Total_Sale ;;
drill_fields: [size, adidas_trans.Price]
}
}