-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathufdsgroupname.view.lkml
34 lines (30 loc) · 1022 Bytes
/
ufdsgroupname.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
view: ufdsgroupname {
sql_table_name: smartdc.ufdsgroupname ;;
dimension: groupname {
description: "Groupname for the account"
type: string
sql: ${TABLE}.groupname ;;
}
dimension: uuid {
description: "UFDS.uuid"
type: string
primary_key: yes
sql: ${TABLE}.uuid ;;
}
dimension: paidorfree {
description: "Returns either Customer or Internal or Employee Personal or Free - 3rd party/test/Fraud"
type: string
sql: CASE WHEN ${groupname} = 'Invoice' THEN 'Customer'
WHEN ${groupname} = 'Credit Card' THEN 'Customer'
WHEN ${groupname} = 'Internal - Department' THEN 'Internal'
WHEN ${groupname} = 'Internal - Employee' THEN 'Internal'
WHEN ${groupname} = 'Employee Personal Use' THEN 'Employee Personal'
ELSE 'Free - 3rd party/test/Fraud'
END;;
}
measure: count {
description: "Number of distinct objects returned in query"
type: count
drill_fields: [groupname]
}
}