-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path.mondrian-schema.xml
488 lines (488 loc) · 36.5 KB
/
.mondrian-schema.xml
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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
<?xml version='1.0' encoding='UTF-8'?>
<Schema name="Mondrian">
<Cube name="Order items" description="Individual products sold as part of an order" defaultMeasure="# Order items">
<Table schema="mondrian" name="order_items"/>
<Dimension name="Product category" description="The category name describing the group of products (e.g. "health_beauty", "computers_accessories", etc." foreignKey="product_fk">
<Hierarchy allMemberName="All Product category" hasAll="true" primaryKey="product_id">
<Table name="product" schema="ec_dim"/>
<Level name="Product category" column="product_category" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Product weight" description="The weight of the product measured in grams" foreignKey="product_fk">
<Hierarchy allMemberName="All Product weight" hasAll="true" primaryKey="product_id">
<Table name="product" schema="ec_dim"/>
<Level name="Product weight" column="weight" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Product length" description="The length of the product measured in centimeters" foreignKey="product_fk">
<Hierarchy allMemberName="All Product length" hasAll="true" primaryKey="product_id">
<Table name="product" schema="ec_dim"/>
<Level name="Product length" column="length" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Product height" description="The height of the product measured in centimeters" foreignKey="product_fk">
<Hierarchy allMemberName="All Product height" hasAll="true" primaryKey="product_id">
<Table name="product" schema="ec_dim"/>
<Level name="Product height" column="height" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Product width" description="The width of the product measured in centimeters" foreignKey="product_fk">
<Hierarchy allMemberName="All Product width" hasAll="true" primaryKey="product_id">
<Table name="product" schema="ec_dim"/>
<Level name="Product width" column="width" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Product number of photos" description="The number of published photos of this product on the store" foreignKey="product_fk">
<Hierarchy allMemberName="All Product number of photos" hasAll="true" primaryKey="product_id">
<Table name="product" schema="ec_dim"/>
<Level name="Product number of photos" column="number_of_photos" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Order date" type="TimeDimension" description="The date when the order was placed (stored in the backend)" foreignKey="order_date_fk">
<Hierarchy allMemberName="All order dates" hasAll="true" name="By month">
<Table schema="time" name="day"/>
<Level name="Year" column="year_id" type="Integer" levelType="TimeYears" uniqueMembers="true"/>
<Level name="Quarter" column="quarter_id" type="Integer" levelType="TimeQuarters" uniqueMembers="true"/>
<Level name="Month" column="month_id" type="Integer" levelType="TimeMonths" uniqueMembers="true"/>
<Level name="Day" column="day_id" type="Integer" levelType="TimeDays" uniqueMembers="true"/>
</Hierarchy>
<Hierarchy allMemberName="All order dates" hasAll="true" name="By week">
<Table schema="time" name="day"/>
<Level name="Year" column="iso_year_id" type="Integer" levelType="TimeYears" uniqueMembers="true"/>
<Level name="Week" column="week_id" type="Integer" levelType="TimeWeeks" uniqueMembers="true"/>
<Level name="Day" column="day_id" type="Integer" levelType="TimeDays" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Order status" description="The current status of the order (created, approved, shipped, etc)" foreignKey="order_fk">
<Hierarchy allMemberName="All Order status" hasAll="true" primaryKey="order_id">
<Table name="order" schema="ec_dim"/>
<Level name="Order status" column="order_status" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Payment approval date" type="TimeDimension" description="The date when the customer's payment was approved by the seller" foreignKey="payment_approval_date_fk">
<Hierarchy allMemberName="All payment approval dates" hasAll="true" name="By month">
<Table schema="time" name="day"/>
<Level name="Year" column="year_id" type="Integer" levelType="TimeYears" uniqueMembers="true"/>
<Level name="Quarter" column="quarter_id" type="Integer" levelType="TimeQuarters" uniqueMembers="true"/>
<Level name="Month" column="month_id" type="Integer" levelType="TimeMonths" uniqueMembers="true"/>
<Level name="Day" column="day_id" type="Integer" levelType="TimeDays" uniqueMembers="true"/>
</Hierarchy>
<Hierarchy allMemberName="All payment approval dates" hasAll="true" name="By week">
<Table schema="time" name="day"/>
<Level name="Year" column="iso_year_id" type="Integer" levelType="TimeYears" uniqueMembers="true"/>
<Level name="Week" column="week_id" type="Integer" levelType="TimeWeeks" uniqueMembers="true"/>
<Level name="Day" column="day_id" type="Integer" levelType="TimeDays" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Delivery date" type="TimeDimension" description="The date when the order was delivered to the customer" foreignKey="delivery_date_fk">
<Hierarchy allMemberName="All delivery dates" hasAll="true" name="By month">
<Table schema="time" name="day"/>
<Level name="Year" column="year_id" type="Integer" levelType="TimeYears" uniqueMembers="true"/>
<Level name="Quarter" column="quarter_id" type="Integer" levelType="TimeQuarters" uniqueMembers="true"/>
<Level name="Month" column="month_id" type="Integer" levelType="TimeMonths" uniqueMembers="true"/>
<Level name="Day" column="day_id" type="Integer" levelType="TimeDays" uniqueMembers="true"/>
</Hierarchy>
<Hierarchy allMemberName="All delivery dates" hasAll="true" name="By week">
<Table schema="time" name="day"/>
<Level name="Year" column="iso_year_id" type="Integer" levelType="TimeYears" uniqueMembers="true"/>
<Level name="Week" column="week_id" type="Integer" levelType="TimeWeeks" uniqueMembers="true"/>
<Level name="Day" column="day_id" type="Integer" levelType="TimeDays" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Delivery time in days" type="StandardDimension" description="The number of days from placing the order to delivery to the customer" foreignKey="delivery_time_in_days_fk">
<Hierarchy allMemberName="All delivery time in dayss" hasAll="true" name="By month">
<Table schema="time" name="duration"/>
<Level name="Days" column="days" type="Integer" levelType="Regular" uniqueMembers="true"/>
<Level name="Months" column="months" type="Integer" levelType="Regular" uniqueMembers="true"/>
<Level name="Half years" column="half_years" type="Integer" levelType="Regular" uniqueMembers="true"/>
<Level name="Years" column="years" type="Integer" levelType="Regular" uniqueMembers="true"/>
</Hierarchy>
<Hierarchy allMemberName="All delivery time in dayss" hasAll="true" name="By week">
<Table schema="time" name="duration"/>
<Level name="Days" column="days" type="Integer" levelType="Regular" uniqueMembers="true"/>
<Level name="Weeks" column="weeks" type="Integer" levelType="Regular" uniqueMembers="true"/>
<Level name="Four weeks" column="four_weeks" type="Integer" levelType="Regular" uniqueMembers="true"/>
<Level name="Years" column="years" type="Integer" levelType="Regular" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Days since first order" type="StandardDimension" description="The number of days from the first order of the customer to the placement of this order" foreignKey="days_since_first_order_fk">
<Hierarchy allMemberName="All days since first orders" hasAll="true" name="By month">
<Table schema="time" name="duration"/>
<Level name="Days" column="days" type="Integer" levelType="Regular" uniqueMembers="true"/>
<Level name="Months" column="months" type="Integer" levelType="Regular" uniqueMembers="true"/>
<Level name="Half years" column="half_years" type="Integer" levelType="Regular" uniqueMembers="true"/>
<Level name="Years" column="years" type="Integer" levelType="Regular" uniqueMembers="true"/>
</Hierarchy>
<Hierarchy allMemberName="All days since first orders" hasAll="true" name="By week">
<Table schema="time" name="duration"/>
<Level name="Days" column="days" type="Integer" levelType="Regular" uniqueMembers="true"/>
<Level name="Weeks" column="weeks" type="Integer" levelType="Regular" uniqueMembers="true"/>
<Level name="Four weeks" column="four_weeks" type="Integer" levelType="Regular" uniqueMembers="true"/>
<Level name="Years" column="years" type="Integer" levelType="Regular" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Customer zip code" description="First 5 digits of the zip code (Brazil has an 8-digit system)" foreignKey="order_customer_zip_code_fk">
<Hierarchy allMemberName="All Customer zip code" hasAll="true" primaryKey="zip_code_id">
<Table name="zip_code" schema="ec_dim"/>
<Level name="Customer zip code" column="zip_code" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Customer city" description="City name" foreignKey="order_customer_zip_code_fk">
<Hierarchy allMemberName="All Customer city" hasAll="true" primaryKey="zip_code_id">
<Table name="zip_code" schema="ec_dim"/>
<Level name="Customer city" column="city" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Customer state" description="State name" foreignKey="order_customer_zip_code_fk">
<Hierarchy allMemberName="All Customer state" hasAll="true" primaryKey="zip_code_id">
<Table name="zip_code" schema="ec_dim"/>
<Level name="Customer state" column="state" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Customer first order date" type="TimeDimension" description="The date when the order was placed (stored in the backend)" foreignKey="customer_first_order_date_fk">
<Hierarchy allMemberName="All customer first order dates" hasAll="true" name="By month">
<Table schema="time" name="day"/>
<Level name="Year" column="year_id" type="Integer" levelType="TimeYears" uniqueMembers="true"/>
<Level name="Quarter" column="quarter_id" type="Integer" levelType="TimeQuarters" uniqueMembers="true"/>
<Level name="Month" column="month_id" type="Integer" levelType="TimeMonths" uniqueMembers="true"/>
<Level name="Day" column="day_id" type="Integer" levelType="TimeDays" uniqueMembers="true"/>
</Hierarchy>
<Hierarchy allMemberName="All customer first order dates" hasAll="true" name="By week">
<Table schema="time" name="day"/>
<Level name="Year" column="iso_year_id" type="Integer" levelType="TimeYears" uniqueMembers="true"/>
<Level name="Week" column="week_id" type="Integer" levelType="TimeWeeks" uniqueMembers="true"/>
<Level name="Day" column="day_id" type="Integer" levelType="TimeDays" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Seller zip code" description="First 5 digits of the zip code (Brazil has an 8-digit system)" foreignKey="seller_zip_code_fk">
<Hierarchy allMemberName="All Seller zip code" hasAll="true" primaryKey="zip_code_id">
<Table name="zip_code" schema="ec_dim"/>
<Level name="Seller zip code" column="zip_code" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Seller city" description="City name" foreignKey="seller_zip_code_fk">
<Hierarchy allMemberName="All Seller city" hasAll="true" primaryKey="zip_code_id">
<Table name="zip_code" schema="ec_dim"/>
<Level name="Seller city" column="city" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Seller state" description="State name" foreignKey="seller_zip_code_fk">
<Hierarchy allMemberName="All Seller state" hasAll="true" primaryKey="zip_code_id">
<Table name="zip_code" schema="ec_dim"/>
<Level name="Seller state" column="state" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Measure name="# Order items" description="The number of ordered products" column="_order_items" aggregator="count" formatString="Standard" datatype="Integer"/>
<Measure name="# Orders" description="The number of valid orders (orders with an invoice)" column="_orders" aggregator="distinct-count" formatString="Standard" datatype="Integer"/>
<Measure name="# First orders" description="The number of first orders (orders with an invoice)" column="_first_orders" aggregator="distinct-count" formatString="Standard" datatype="Integer"/>
<Measure name="Product revenue" description="The price of the ordered products as shown in the cart" column="product_revenue" aggregator="sum" formatString="Standard" datatype="Numeric"/>
<Measure name="Shipping revenue" description="Revenue generated based on the delivery fee" column="shipping_revenue" aggregator="sum" formatString="Standard" datatype="Numeric"/>
<CalculatedMember name="Revenue" dimension="Measures" description="The total cart value of the order">
<Formula>[Measures].[Product revenue] + [Measures].[Shipping revenue]</Formula>
<CalculatedMemberProperty name="FORMAT_STRING" value="Standard"/>
</CalculatedMember>
<CalculatedMember name="AOV" dimension="Measures" description="The average revenue per order. Attention: not meaningful when split by product">
<Formula>[Measures].[Revenue] / [Measures].[# Orders]</Formula>
<CalculatedMemberProperty name="FORMAT_STRING" value="Standard"/>
</CalculatedMember>
</Cube>
<Cube name="Sellers" description="Merchants that are selling products" defaultMeasure="# Orders (lifetime)">
<Table schema="mondrian" name="sellers"/>
<Dimension name="Zip code" description="First 5 digits of the zip code (Brazil has an 8-digit system)" foreignKey="zip_code_fk">
<Hierarchy allMemberName="All Zip code" hasAll="true" primaryKey="zip_code_id">
<Table name="zip_code" schema="ec_dim"/>
<Level name="Zip code" column="zip_code" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="City" description="City name" foreignKey="zip_code_fk">
<Hierarchy allMemberName="All City" hasAll="true" primaryKey="zip_code_id">
<Table name="zip_code" schema="ec_dim"/>
<Level name="City" column="city" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="State" description="State name" foreignKey="zip_code_fk">
<Hierarchy allMemberName="All State" hasAll="true" primaryKey="zip_code_id">
<Table name="zip_code" schema="ec_dim"/>
<Level name="State" column="state" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="First order date" type="TimeDimension" description="The date when the order was placed (stored in the backend)" foreignKey="first_order_date_fk">
<Hierarchy allMemberName="All first order dates" hasAll="true" name="By month">
<Table schema="time" name="day"/>
<Level name="Year" column="year_id" type="Integer" levelType="TimeYears" uniqueMembers="true"/>
<Level name="Quarter" column="quarter_id" type="Integer" levelType="TimeQuarters" uniqueMembers="true"/>
<Level name="Month" column="month_id" type="Integer" levelType="TimeMonths" uniqueMembers="true"/>
<Level name="Day" column="day_id" type="Integer" levelType="TimeDays" uniqueMembers="true"/>
</Hierarchy>
<Hierarchy allMemberName="All first order dates" hasAll="true" name="By week">
<Table schema="time" name="day"/>
<Level name="Year" column="iso_year_id" type="Integer" levelType="TimeYears" uniqueMembers="true"/>
<Level name="Week" column="week_id" type="Integer" levelType="TimeWeeks" uniqueMembers="true"/>
<Level name="Day" column="day_id" type="Integer" levelType="TimeDays" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Measure name="# Orders (lifetime)" description="Number of orders with at-least one product fulfilled by this seller" column="_orders_lifetime_" aggregator="sum" formatString="Standard" datatype="Numeric"/>
<Measure name="# Order items (lifetime)" description="Number of products sold by this seller" column="_order_items_lifetime_" aggregator="sum" formatString="Standard" datatype="Numeric"/>
<Measure name="Revenue (lifetime)" description="The lifetime revenue generated from products sold by this seller" column="revenue_lifetime_" aggregator="sum" formatString="Standard" datatype="Numeric"/>
<CalculatedMember name="AOV" dimension="Measures" description="The average revenue per order. Attention: not meaningful when split by product">
<Formula>[Measures].[Revenue (lifetime)] / [Measures].[# Orders (lifetime)]</Formula>
<CalculatedMemberProperty name="FORMAT_STRING" value="Standard"/>
</CalculatedMember>
</Cube>
<Cube name="Customers" description="People that made at least one order" defaultMeasure="# Orders (lifetime)">
<Table schema="mondrian" name="customers"/>
<Dimension name="Days since first order" type="StandardDimension" description="The number of days since the first order was placed" foreignKey="days_since_first_order_fk">
<Hierarchy allMemberName="All days since first orders" hasAll="true" name="By month">
<Table schema="time" name="duration"/>
<Level name="Days" column="days" type="Integer" levelType="Regular" uniqueMembers="true"/>
<Level name="Months" column="months" type="Integer" levelType="Regular" uniqueMembers="true"/>
<Level name="Half years" column="half_years" type="Integer" levelType="Regular" uniqueMembers="true"/>
<Level name="Years" column="years" type="Integer" levelType="Regular" uniqueMembers="true"/>
</Hierarchy>
<Hierarchy allMemberName="All days since first orders" hasAll="true" name="By week">
<Table schema="time" name="duration"/>
<Level name="Days" column="days" type="Integer" levelType="Regular" uniqueMembers="true"/>
<Level name="Weeks" column="weeks" type="Integer" levelType="Regular" uniqueMembers="true"/>
<Level name="Four weeks" column="four_weeks" type="Integer" levelType="Regular" uniqueMembers="true"/>
<Level name="Years" column="years" type="Integer" levelType="Regular" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Days since last order" type="StandardDimension" description="The number of days since the last order was placed" foreignKey="days_since_last_order_fk">
<Hierarchy allMemberName="All days since last orders" hasAll="true" name="By month">
<Table schema="time" name="duration"/>
<Level name="Days" column="days" type="Integer" levelType="Regular" uniqueMembers="true"/>
<Level name="Months" column="months" type="Integer" levelType="Regular" uniqueMembers="true"/>
<Level name="Half years" column="half_years" type="Integer" levelType="Regular" uniqueMembers="true"/>
<Level name="Years" column="years" type="Integer" levelType="Regular" uniqueMembers="true"/>
</Hierarchy>
<Hierarchy allMemberName="All days since last orders" hasAll="true" name="By week">
<Table schema="time" name="duration"/>
<Level name="Days" column="days" type="Integer" levelType="Regular" uniqueMembers="true"/>
<Level name="Weeks" column="weeks" type="Integer" levelType="Regular" uniqueMembers="true"/>
<Level name="Four weeks" column="four_weeks" type="Integer" levelType="Regular" uniqueMembers="true"/>
<Level name="Years" column="years" type="Integer" levelType="Regular" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Favourite product category" description="The category of the most purchased product (by revenue) of the customer">
<Hierarchy allMemberName="All Favourite product category" hasAll="true">
<Level name="Favourite product category" column="favourite_product_category" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Zip code" description="First 5 digits of the zip code (Brazil has an 8-digit system)" foreignKey="zip_code_fk">
<Hierarchy allMemberName="All Zip code" hasAll="true" primaryKey="zip_code_id">
<Table name="zip_code" schema="ec_dim"/>
<Level name="Zip code" column="zip_code" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="City" description="City name" foreignKey="zip_code_fk">
<Hierarchy allMemberName="All City" hasAll="true" primaryKey="zip_code_id">
<Table name="zip_code" schema="ec_dim"/>
<Level name="City" column="city" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="State" description="State name" foreignKey="zip_code_fk">
<Hierarchy allMemberName="All State" hasAll="true" primaryKey="zip_code_id">
<Table name="zip_code" schema="ec_dim"/>
<Level name="State" column="state" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="First order date" type="TimeDimension" description="The date when the order was placed (stored in the backend)" foreignKey="first_order_date_fk">
<Hierarchy allMemberName="All first order dates" hasAll="true" name="By month">
<Table schema="time" name="day"/>
<Level name="Year" column="year_id" type="Integer" levelType="TimeYears" uniqueMembers="true"/>
<Level name="Quarter" column="quarter_id" type="Integer" levelType="TimeQuarters" uniqueMembers="true"/>
<Level name="Month" column="month_id" type="Integer" levelType="TimeMonths" uniqueMembers="true"/>
<Level name="Day" column="day_id" type="Integer" levelType="TimeDays" uniqueMembers="true"/>
</Hierarchy>
<Hierarchy allMemberName="All first order dates" hasAll="true" name="By week">
<Table schema="time" name="day"/>
<Level name="Year" column="iso_year_id" type="Integer" levelType="TimeYears" uniqueMembers="true"/>
<Level name="Week" column="week_id" type="Integer" levelType="TimeWeeks" uniqueMembers="true"/>
<Level name="Day" column="day_id" type="Integer" levelType="TimeDays" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Last order date" type="TimeDimension" description="The date when the order was placed (stored in the backend)" foreignKey="last_order_date_fk">
<Hierarchy allMemberName="All last order dates" hasAll="true" name="By month">
<Table schema="time" name="day"/>
<Level name="Year" column="year_id" type="Integer" levelType="TimeYears" uniqueMembers="true"/>
<Level name="Quarter" column="quarter_id" type="Integer" levelType="TimeQuarters" uniqueMembers="true"/>
<Level name="Month" column="month_id" type="Integer" levelType="TimeMonths" uniqueMembers="true"/>
<Level name="Day" column="day_id" type="Integer" levelType="TimeDays" uniqueMembers="true"/>
</Hierarchy>
<Hierarchy allMemberName="All last order dates" hasAll="true" name="By week">
<Table schema="time" name="day"/>
<Level name="Year" column="iso_year_id" type="Integer" levelType="TimeYears" uniqueMembers="true"/>
<Level name="Week" column="week_id" type="Integer" levelType="TimeWeeks" uniqueMembers="true"/>
<Level name="Day" column="day_id" type="Integer" levelType="TimeDays" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Measure name="# Orders (lifetime)" description="Number of orders placed by this customer" column="_orders_lifetime_" aggregator="sum" formatString="Standard" datatype="Numeric"/>
<Measure name="Revenue (lifetime)" description="The lifetime revenue generated from products purchased by this customer" column="revenue_lifetime_" aggregator="sum" formatString="Standard" datatype="Numeric"/>
<CalculatedMember name="AOV" dimension="Measures" description="The average revenue per order of the customer">
<Formula>[Measures].[Revenue (lifetime)] / [Measures].[# Orders (lifetime)]</Formula>
<CalculatedMemberProperty name="FORMAT_STRING" value="Standard"/>
</CalculatedMember>
</Cube>
<Cube name="Products" description="Products that were at least sold once" defaultMeasure="Revenue (lifetime)">
<Table schema="mondrian" name="products"/>
<Dimension name="Product category" description="The category name describing the group of products (e.g. "health_beauty", "computers_accessories", etc.">
<Hierarchy allMemberName="All Product category" hasAll="true">
<Level name="Product category" column="product_category" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Weight" description="The weight of the product measured in grams">
<Hierarchy allMemberName="All Weight" hasAll="true">
<Level name="Weight" column="weight" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Length" description="The length of the product measured in centimeters">
<Hierarchy allMemberName="All Length" hasAll="true">
<Level name="Length" column="length" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Height" description="The height of the product measured in centimeters">
<Hierarchy allMemberName="All Height" hasAll="true">
<Level name="Height" column="height" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Width" description="The width of the product measured in centimeters">
<Hierarchy allMemberName="All Width" hasAll="true">
<Level name="Width" column="width" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Number of photos" description="The number of published photos of this product on the store">
<Hierarchy allMemberName="All Number of photos" hasAll="true">
<Level name="Number of photos" column="number_of_photos" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Measure name="Revenue (lifetime)" description="The lifetime revenue generated from this product" column="revenue_lifetime_" aggregator="sum" formatString="Standard" datatype="Numeric"/>
</Cube>
<Cube name="Leads" description="People that made contact through filling a request of contact on a landing page. Can become sellers if they close a deal with a Sales Representative" defaultMeasure="# Orders (lifetime)">
<Table schema="mondrian" name="leads"/>
<Dimension name="First contact date" type="TimeDimension" description="The date the lead made first contact by signing up on a landing page" foreignKey="first_contact_date_fk">
<Hierarchy allMemberName="All first contact dates" hasAll="true" name="By month">
<Table schema="time" name="day"/>
<Level name="Year" column="year_id" type="Integer" levelType="TimeYears" uniqueMembers="true"/>
<Level name="Quarter" column="quarter_id" type="Integer" levelType="TimeQuarters" uniqueMembers="true"/>
<Level name="Month" column="month_id" type="Integer" levelType="TimeMonths" uniqueMembers="true"/>
<Level name="Day" column="day_id" type="Integer" levelType="TimeDays" uniqueMembers="true"/>
</Hierarchy>
<Hierarchy allMemberName="All first contact dates" hasAll="true" name="By week">
<Table schema="time" name="day"/>
<Level name="Year" column="iso_year_id" type="Integer" levelType="TimeYears" uniqueMembers="true"/>
<Level name="Week" column="week_id" type="Integer" levelType="TimeWeeks" uniqueMembers="true"/>
<Level name="Day" column="day_id" type="Integer" levelType="TimeDays" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Is closed deal" description="Whether the qualified lead closed a deal with a Sales Representative and became a seller">
<Hierarchy allMemberName="All Is closed deal" hasAll="true">
<Level name="Is closed deal" column="is_closed_deal" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Deal date" type="TimeDimension" description="The date when the marketing qualified lead was closed and became a seller" foreignKey="deal_date_fk">
<Hierarchy allMemberName="All deal dates" hasAll="true" name="By month">
<Table schema="time" name="day"/>
<Level name="Year" column="year_id" type="Integer" levelType="TimeYears" uniqueMembers="true"/>
<Level name="Quarter" column="quarter_id" type="Integer" levelType="TimeQuarters" uniqueMembers="true"/>
<Level name="Month" column="month_id" type="Integer" levelType="TimeMonths" uniqueMembers="true"/>
<Level name="Day" column="day_id" type="Integer" levelType="TimeDays" uniqueMembers="true"/>
</Hierarchy>
<Hierarchy allMemberName="All deal dates" hasAll="true" name="By week">
<Table schema="time" name="day"/>
<Level name="Year" column="iso_year_id" type="Integer" levelType="TimeYears" uniqueMembers="true"/>
<Level name="Week" column="week_id" type="Integer" levelType="TimeWeeks" uniqueMembers="true"/>
<Level name="Day" column="day_id" type="Integer" levelType="TimeDays" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Landing page ID" description="The ID of the landing page where the lead first made contact">
<Hierarchy allMemberName="All Landing page ID" hasAll="true">
<Level name="Landing page ID" column="landing_page_id" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Advertising channel" description="Specific advertising channel the lead was acquired on">
<Hierarchy allMemberName="All Advertising channel" hasAll="true">
<Level name="Advertising channel" column="advertising_channel" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Business Segment" description="The business segment in which the seller provides products e.g., "household_utilities", "car_accessories". Provided by the lead on the sign up at a landing page or the first contact with a Sales Development Representative">
<Hierarchy allMemberName="All Business Segment" hasAll="true">
<Level name="Business Segment" column="business_segment" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Lead type" description="The type of the lead in terms of company size, type, and experience, e.g., "online_beginner", "online_medium". Provided by the lead on the sign up at a landing page or the first contact with a Sales Development Representative">
<Hierarchy allMemberName="All Lead type" hasAll="true">
<Level name="Lead type" column="lead_type" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Lead behaviour profile" description="The behaviour profile of the lead based on the DISC behavior assessment tool (https://en.wikipedia.org/wiki/DISC_assessment). Identified by the Sales Development Representative on the first contact with the lead">
<Hierarchy allMemberName="All Lead behaviour profile" hasAll="true">
<Level name="Lead behaviour profile" column="lead_behaviour_profile" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Average stock" description="The average number of items per product the lead has available on stock. Provided by the lead on the sign up at a landing page or the first contact with a Sales Development Representative">
<Hierarchy allMemberName="All Average stock" hasAll="true">
<Level name="Average stock" column="average_stock" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Business type" description="The type of business the lead has: reseller, manufacturer, other, or unknown">
<Hierarchy allMemberName="All Business type" hasAll="true">
<Level name="Business type" column="business_type" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Days to closing the deal" type="StandardDimension" description="The number of days it took from first contact with the lead to closing the deal by a Sales Representative and the lead becoming a seller" foreignKey="days_to_closing_the_deal_fk">
<Hierarchy allMemberName="All days to closing the deals" hasAll="true" name="By month">
<Table schema="time" name="duration"/>
<Level name="Days" column="days" type="Integer" levelType="Regular" uniqueMembers="true"/>
<Level name="Months" column="months" type="Integer" levelType="Regular" uniqueMembers="true"/>
<Level name="Half years" column="half_years" type="Integer" levelType="Regular" uniqueMembers="true"/>
<Level name="Years" column="years" type="Integer" levelType="Regular" uniqueMembers="true"/>
</Hierarchy>
<Hierarchy allMemberName="All days to closing the deals" hasAll="true" name="By week">
<Table schema="time" name="duration"/>
<Level name="Days" column="days" type="Integer" levelType="Regular" uniqueMembers="true"/>
<Level name="Weeks" column="weeks" type="Integer" levelType="Regular" uniqueMembers="true"/>
<Level name="Four weeks" column="four_weeks" type="Integer" levelType="Regular" uniqueMembers="true"/>
<Level name="Years" column="years" type="Integer" levelType="Regular" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Seller zip code" description="First 5 digits of the zip code (Brazil has an 8-digit system)" foreignKey="seller_zip_code_fk">
<Hierarchy allMemberName="All Seller zip code" hasAll="true" primaryKey="zip_code_id">
<Table name="zip_code" schema="ec_dim"/>
<Level name="Seller zip code" column="zip_code" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Seller city" description="City name" foreignKey="seller_zip_code_fk">
<Hierarchy allMemberName="All Seller city" hasAll="true" primaryKey="zip_code_id">
<Table name="zip_code" schema="ec_dim"/>
<Level name="Seller city" column="city" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Seller state" description="State name" foreignKey="seller_zip_code_fk">
<Hierarchy allMemberName="All Seller state" hasAll="true" primaryKey="zip_code_id">
<Table name="zip_code" schema="ec_dim"/>
<Level name="Seller state" column="state" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Seller first order date" type="TimeDimension" description="The date when the order was placed (stored in the backend)" foreignKey="seller_first_order_date_fk">
<Hierarchy allMemberName="All seller first order dates" hasAll="true" name="By month">
<Table schema="time" name="day"/>
<Level name="Year" column="year_id" type="Integer" levelType="TimeYears" uniqueMembers="true"/>
<Level name="Quarter" column="quarter_id" type="Integer" levelType="TimeQuarters" uniqueMembers="true"/>
<Level name="Month" column="month_id" type="Integer" levelType="TimeMonths" uniqueMembers="true"/>
<Level name="Day" column="day_id" type="Integer" levelType="TimeDays" uniqueMembers="true"/>
</Hierarchy>
<Hierarchy allMemberName="All seller first order dates" hasAll="true" name="By week">
<Table schema="time" name="day"/>
<Level name="Year" column="iso_year_id" type="Integer" levelType="TimeYears" uniqueMembers="true"/>
<Level name="Week" column="week_id" type="Integer" levelType="TimeWeeks" uniqueMembers="true"/>
<Level name="Day" column="day_id" type="Integer" levelType="TimeDays" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Measure name="# Orders (lifetime)" description="Number of orders with at-least one product fulfilled by this seller" column="_orders_lifetime_" aggregator="sum" formatString="Standard" datatype="Numeric"/>
<Measure name="Revenue (lifetime)" description="The lifetime revenue generated from products sold by this seller" column="revenue_lifetime_" aggregator="sum" formatString="Standard" datatype="Numeric"/>
<CalculatedMember name="AOV" dimension="Measures" description="The average revenue per order. Attention: not meaningful when split by product">
<Formula>[Measures].[Revenue (lifetime)] / [Measures].[# Orders (lifetime)]</Formula>
<CalculatedMemberProperty name="FORMAT_STRING" value="Standard"/>
</CalculatedMember>
</Cube>
</Schema>