-
Notifications
You must be signed in to change notification settings - Fork 224
/
Copy pathaccounts_payable_turnover_v2.view.lkml
194 lines (157 loc) · 4.37 KB
/
accounts_payable_turnover_v2.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
view: accounts_payable_turnover_v2 {
sql_table_name: `@{GCP_PROJECT}.@{REPORTING_DATASET}.AccountsPayableTurnover`
;;
fields_hidden_by_default: yes
dimension: key {
type: string
primary_key: yes
sql: CONCAT(${client_mandt},${accounting_document_number_belnr},${number_of_line_item_within_accounting_document_buzei},${company_code_bukrs},${target_currency_tcurr});;
}
dimension: account_number_of_vendor_or_creditor_lifnr {
type: string
sql: ${TABLE}.AccountNumberOfVendorOrCreditor_LIFNR ;;
}
dimension: accounting_document_number_belnr {
type: string
sql: ${TABLE}.AccountingDocumentNumber_BELNR ;;
}
dimension: accounting_documenttype_blart {
type: string
sql: ${TABLE}.AccountingDocumenttype_BLART ;;
}
dimension: accounts_payable_turnover_in_source_currency {
type: number
sql: ${TABLE}.AccountsPayableTurnoverInSourceCurrency;;
}
dimension: accounts_payable_turnover_in_target_currency {
type: number
sql: (${TABLE}.AccountsPayableTurnoverInTargetCurrency * -1);;
}
dimension: doc_fisc_period {
type: string
sql: ${TABLE}.DocFiscPeriod ;;
}
dimension: fiscal_period_to_date{
sql: DATE(CAST(LEFT(${doc_fisc_period},4) AS INT64),CAST(RIGHT(${doc_fisc_period},2) AS INT64),01) ;;
}
dimension_group: fiscal_period {
type: time
datatype: date
timeframes: [month, year]
sql: ${fiscal_period_to_date} ;;
convert_tz: no
hidden: no
}
measure: turnover {
type: average
value_format: "0.0"
sql: NULLIF(${accounts_payable_turnover_in_target_currency},0) ;;
sql_distinct_key: ${fiscal_period_month} ;;
required_fields: [doc_fisc_period]
hidden: no
}
measure: turnover_in_days {
type: number
value_format: "0.0"
sql: 30.4/${turnover} ;;
hidden: no
}
dimension: amount_in_local_currency_dmbtr {
type: number
sql: ${TABLE}.AmountInLocalCurrency_DMBTR ;;
}
measure: total_amount_in_local_currency_dmbtr {
type: sum
sql: ${amount_in_local_currency_dmbtr} ;;
}
measure: average_amount_in_local_currency_dmbtr {
type: average
sql: ${amount_in_local_currency_dmbtr} ;;
}
dimension: amount_in_target_currency_dmbtr {
type: number
sql: ${TABLE}.AmountInTargetCurrency_DMBTR ;;
}
dimension: client_mandt {
type: string
sql: ${TABLE}.Client_MANDT ;;
}
dimension: closing_apin_source_currency {
type: number
sql: ${TABLE}.ClosingAPInSourceCurrency ;;
}
dimension: closing_apin_target_currency {
type: number
sql: ${TABLE}.ClosingAPInTargetCurrency ;;
}
dimension: company_code_bukrs {
type: string
sql: ${TABLE}.CompanyCode_BUKRS ;;
}
dimension: company_text_butxt {
type: string
sql: ${TABLE}.CompanyText_BUTXT ;;
hidden: no
}
dimension: currency_key_waers {
type: string
sql: ${TABLE}.CurrencyKey_WAERS ;;
}
dimension: name1 {
type: string
sql: ${TABLE}.NAME1 ;;
}
dimension: number_of_line_item_within_accounting_document_buzei {
type: string
sql: ${TABLE}.NumberOfLineItemWithinAccountingDocument_BUZEI ;;
}
dimension: opening_apin_source_currency {
type: number
sql: ${TABLE}.OpeningAPInSourceCurrency ;;
}
dimension: opening_apin_target_currency {
type: number
sql: ${TABLE}.OpeningAPInTargetCurrency ;;
}
dimension: period_apin_source_currency {
type: number
sql: ${TABLE}.PeriodAPInSourceCurrency ;;
}
dimension: period_apin_target_currency {
type: number
sql: ${TABLE}.PeriodAPInTargetCurrency ;;
}
# Dates and timestamps can be represented in Looker using a dimension group of type: time.
# Looker converts dates and timestamps to the specified timeframes within the dimension group.
dimension_group: posting_date_in_the_document_budat {
type: time
timeframes: [
raw,
date,
week,
month,
quarter,
year
]
convert_tz: no
datatype: date
sql: ${TABLE}.PostingDateInTheDocument_BUDAT ;;
}
dimension: target_currency_tcurr {
type: string
sql: ${TABLE}.TargetCurrency_TCURR ;;
hidden: no
}
dimension: total_purchases_in_source_currency {
type: number
sql: ${TABLE}.TotalPurchasesInSourceCurrency ;;
}
dimension: total_purchases_in_target_currency {
type: number
sql: ${TABLE}.TotalPurchasesInTargetCurrency ;;
}
measure: count {
type: count
drill_fields: []
}
}