-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshrimp_facts.view.lkml
70 lines (65 loc) · 1.53 KB
/
shrimp_facts.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
view: shrimp_facts {
# Or, you could make this view a derived table, like this:
derived_table: {
sql: SELECT
upper(cnapi."HOSTNAME") AS "cn_name",
cnapi."Model" AS "cn_model",
cnapi."uuid" AS "uuid",
cnapi."DCENTER" AS "dc",
DATE(cnapi."DATE" ) AS "date"
FROM smartdc.cnapi AS cnapi
where cnapi."Model" like 'Mantis Shrimp%' and upper(cnapi."HOSTNAME") like 'MS%'
GROUP BY 1,2,3,4,5
ORDER BY 1
;;
persist_for: "24 hours"
indexes: ["cn_model","date","uuid","cn_name","dc"]
}
# Define your dimensions and measures here, like this:
dimension: compound_primary_key {
type: string
description: "primary key "
primary_key: yes
sql: ${TABLE}."uuid" || ${TABLE}."date";;
}
dimension: cn_model {
description: "The CN model short name"
type: string
sql: ${TABLE}."cn_model" ;;
}
dimension_group: date {
description:"Timestamp when Cnapi data was collected"
type: time
timeframes: [
raw,
time,
date,
week,
month,
day_of_month,
month_num,
quarter,
year
]
sql: ${TABLE}."date" ;;
}
dimension: uuid {
description: "The cnapi uuid"
type: string
sql: ${TABLE}."uuid" ;;
}
dimension: dc {
description: "The Cnapi Data center name"
type: string
sql: ${TABLE}."dc" ;;
}
dimension: cn_name {
description: "The Cnapi hostname"
type: string
sql: ${TABLE}."cn_name" ;;
}
measure: count {
description: "Count of Shrimp_facts objects"
type: count
}
}