cell_set 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,778 @@
1
+ <?xml version="1.0"?>
2
+ <Schema name="FoodMart">
3
+ <!--
4
+ == $Id:$
5
+ == This software is subject to the terms of the Eclipse Public License v1.0
6
+ == Agreement, available at the following URL:
7
+ == http://www.eclipse.org/legal/epl-v10.html.
8
+ == Copyright (C) 2000-2002 Kana Software, Inc.
9
+ == Copyright (C) 2002-2009 Julian Hyde and others.
10
+ == All Rights Reserved.
11
+ == You must accept the terms of that agreement to use this software.
12
+ -->
13
+
14
+ <!-- Shared dimensions -->
15
+
16
+ <Dimension name="Store">
17
+ <Hierarchy hasAll="true" primaryKey="store_id">
18
+ <Table name="store"/>
19
+ <Level name="Store Country" column="store_country" uniqueMembers="true"/>
20
+ <Level name="Store State" column="store_state" uniqueMembers="true"/>
21
+ <Level name="Store City" column="store_city" uniqueMembers="false"/>
22
+ <Level name="Store Name" column="store_name" uniqueMembers="true">
23
+ <Property name="Store Type" column="store_type"/>
24
+ <Property name="Store Manager" column="store_manager"/>
25
+ <Property name="Store Sqft" column="store_sqft" type="Numeric"/>
26
+ <Property name="Grocery Sqft" column="grocery_sqft" type="Numeric"/>
27
+ <Property name="Frozen Sqft" column="frozen_sqft" type="Numeric"/>
28
+ <Property name="Meat Sqft" column="meat_sqft" type="Numeric"/>
29
+ <Property name="Has coffee bar" column="coffee_bar" type="Boolean"/>
30
+ <Property name="Street address" column="store_street_address" type="String"/>
31
+ </Level>
32
+ </Hierarchy>
33
+ </Dimension>
34
+
35
+ <Dimension name="Store Size in SQFT">
36
+ <Hierarchy hasAll="true" primaryKey="store_id">
37
+ <Table name="store"/>
38
+ <Level name="Store Sqft" column="store_sqft" type="Numeric" uniqueMembers="true"/>
39
+ </Hierarchy>
40
+ </Dimension>
41
+
42
+ <Dimension name="Store Type">
43
+ <Hierarchy hasAll="true" primaryKey="store_id">
44
+ <Table name="store"/>
45
+ <Level name="Store Type" column="store_type" uniqueMembers="true"/>
46
+ </Hierarchy>
47
+ </Dimension>
48
+
49
+ <Dimension name="Time" type="TimeDimension">
50
+ <Hierarchy hasAll="false" primaryKey="time_id">
51
+ <Table name="time_by_day"/>
52
+ <Level name="Year" column="the_year" type="Numeric" uniqueMembers="true"
53
+ levelType="TimeYears"/>
54
+ <Level name="Quarter" column="quarter" uniqueMembers="false"
55
+ levelType="TimeQuarters"/>
56
+ <Level name="Month" column="month_of_year" uniqueMembers="false" type="Numeric"
57
+ levelType="TimeMonths"/>
58
+ </Hierarchy>
59
+ <Hierarchy hasAll="true" name="Weekly" primaryKey="time_id">
60
+ <Table name="time_by_day"/>
61
+ <Level name="Year" column="the_year" type="Numeric" uniqueMembers="true"
62
+ levelType="TimeYears"/>
63
+ <Level name="Week" column="week_of_year" type="Numeric" uniqueMembers="false"
64
+ levelType="TimeWeeks"/>
65
+ <Level name="Day" column="day_of_month" uniqueMembers="false" type="Numeric"
66
+ levelType="TimeDays"/>
67
+ </Hierarchy>
68
+ </Dimension>
69
+
70
+ <Dimension name="Product">
71
+ <Hierarchy hasAll="true" primaryKey="product_id" primaryKeyTable="product">
72
+ <Join leftKey="product_class_id" rightKey="product_class_id">
73
+ <Table name="product"/>
74
+ <Table name="product_class"/>
75
+ </Join>
76
+ <!--
77
+ <Query>
78
+ <SQL dialect="generic">
79
+ SELECT *
80
+ FROM "product", "product_class"
81
+ WHERE "product"."product_class_id" = "product_class"."product_class_id"
82
+ </SQL>
83
+ </Query>
84
+ <Level name="Product Family" column="product_family" uniqueMembers="true"/>
85
+ <Level name="Product Department" column="product_department" uniqueMembers="false"/>
86
+ <Level name="Product Category" column="product_category" uniqueMembers="false"/>
87
+ <Level name="Product Subcategory" column="product_subcategory" uniqueMembers="false"/>
88
+ <Level name="Brand Name" column="brand_name" uniqueMembers="false"/>
89
+ <Level name="Product Name" column="product_name" uniqueMembers="true"/>
90
+ -->
91
+ <Level name="Product Family" table="product_class" column="product_family"
92
+ uniqueMembers="true"/>
93
+ <Level name="Product Department" table="product_class" column="product_department"
94
+ uniqueMembers="false"/>
95
+ <Level name="Product Category" table="product_class" column="product_category"
96
+ uniqueMembers="false"/>
97
+ <Level name="Product Subcategory" table="product_class" column="product_subcategory"
98
+ uniqueMembers="false"/>
99
+ <Level name="Brand Name" table="product" column="brand_name" uniqueMembers="false"/>
100
+ <Level name="Product Name" table="product" column="product_name"
101
+ uniqueMembers="true"/>
102
+ </Hierarchy>
103
+ </Dimension>
104
+
105
+ <Dimension name="Warehouse">
106
+ <Hierarchy hasAll="true" primaryKey="warehouse_id">
107
+ <Table name="warehouse"/>
108
+ <Level name="Country" column="warehouse_country" uniqueMembers="true"/>
109
+ <Level name="State Province" column="warehouse_state_province"
110
+ uniqueMembers="true"/>
111
+ <Level name="City" column="warehouse_city" uniqueMembers="false"/>
112
+ <Level name="Warehouse Name" column="warehouse_name" uniqueMembers="true"/>
113
+ </Hierarchy>
114
+ </Dimension>
115
+
116
+ <!-- Sales -->
117
+ <Cube name="Sales" defaultMeasure="Unit Sales">
118
+ <Table name="sales_fact_1997">
119
+ <!--
120
+ <AggExclude name="agg_l_03_sales_fact_1997" />
121
+ <AggExclude name="agg_ll_01_sales_fact_1997" />
122
+ <AggExclude name="agg_pl_01_sales_fact_1997" />
123
+ <AggExclude name="agg_l_05_sales_fact_1997" />
124
+ -->
125
+ <AggExclude name="agg_c_special_sales_fact_1997" />
126
+ <!--
127
+ <AggExclude name="agg_c_14_sales_fact_1997" />
128
+ -->
129
+ <AggExclude name="agg_lc_100_sales_fact_1997" />
130
+ <AggExclude name="agg_lc_10_sales_fact_1997" />
131
+ <AggExclude name="agg_pc_10_sales_fact_1997" />
132
+ <AggName name="agg_c_special_sales_fact_1997">
133
+ <AggFactCount column="FACT_COUNT"/>
134
+ <AggIgnoreColumn column="foo"/>
135
+ <AggIgnoreColumn column="bar"/>
136
+ <AggForeignKey factColumn="product_id" aggColumn="PRODUCT_ID" />
137
+ <AggForeignKey factColumn="customer_id" aggColumn="CUSTOMER_ID" />
138
+ <AggForeignKey factColumn="promotion_id" aggColumn="PROMOTION_ID" />
139
+ <AggForeignKey factColumn="store_id" aggColumn="STORE_ID" />
140
+ <!--
141
+ <AggMeasure name="[Measures].[Avg Unit Sales]" column="UNIT_SALES_AVG"/>
142
+ -->
143
+ <AggMeasure name="[Measures].[Unit Sales]" column="UNIT_SALES_SUM" />
144
+ <AggMeasure name="[Measures].[Store Cost]" column="STORE_COST_SUM" />
145
+ <AggMeasure name="[Measures].[Store Sales]" column="STORE_SALES_SUM" />
146
+ <AggLevel name="[Time].[Year]" column="TIME_YEAR" />
147
+ <AggLevel name="[Time].[Quarter]" column="TIME_QUARTER" />
148
+ <AggLevel name="[Time].[Month]" column="TIME_MONTH" />
149
+ </AggName>
150
+ </Table>
151
+
152
+ <DimensionUsage name="Store" source="Store" foreignKey="store_id"/>
153
+ <DimensionUsage name="Store Size in SQFT" source="Store Size in SQFT"
154
+ foreignKey="store_id"/>
155
+ <DimensionUsage name="Store Type" source="Store Type" foreignKey="store_id"/>
156
+ <DimensionUsage name="Time" source="Time" foreignKey="time_id"/>
157
+ <DimensionUsage name="Product" source="Product" foreignKey="product_id"/>
158
+ <Dimension name="Promotion Media" foreignKey="promotion_id">
159
+ <Hierarchy hasAll="true" allMemberName="All Media" primaryKey="promotion_id" defaultMember="All Media">
160
+ <Table name="promotion"/>
161
+ <Level name="Media Type" column="media_type" uniqueMembers="true"/>
162
+ </Hierarchy>
163
+ </Dimension>
164
+ <Dimension name="Promotions" foreignKey="promotion_id">
165
+ <Hierarchy hasAll="true" allMemberName="All Promotions" primaryKey="promotion_id" defaultMember="[All Promotions]">
166
+ <Table name="promotion"/>
167
+ <Level name="Promotion Name" column="promotion_name" uniqueMembers="true"/>
168
+ </Hierarchy>
169
+ </Dimension>
170
+ <Dimension name="Customers" foreignKey="customer_id">
171
+ <Hierarchy hasAll="true" allMemberName="All Customers" primaryKey="customer_id">
172
+ <Table name="customer"/>
173
+ <Level name="Country" column="country" uniqueMembers="true"/>
174
+ <Level name="State Province" column="state_province" uniqueMembers="true"/>
175
+ <Level name="City" column="city" uniqueMembers="false"/>
176
+ <Level name="Name" column="customer_id" type="Numeric" uniqueMembers="true">
177
+ <NameExpression>
178
+ <SQL dialect="oracle">
179
+ "fname" || ' ' || "lname"
180
+ </SQL>
181
+ <SQL dialect="access">
182
+ fname + ' ' + lname
183
+ </SQL>
184
+ <SQL dialect="postgres">
185
+ "fname" || ' ' || "lname"
186
+ </SQL>
187
+ <SQL dialect="mysql">
188
+ CONCAT(`customer`.`fname`, ' ', `customer`.`lname`)
189
+ </SQL>
190
+ <SQL dialect="mssql">
191
+ fname + ' ' + lname
192
+ </SQL>
193
+ <SQL dialect="derby">
194
+ "customer"."fullname"
195
+ </SQL>
196
+ <SQL dialect="db2">
197
+ CONCAT(CONCAT("customer"."fname", ' '), "customer"."lname")
198
+ </SQL>
199
+ <SQL dialect="luciddb">
200
+ "fname" || ' ' || "lname"
201
+ </SQL>
202
+ <SQL dialect="teradata">
203
+ "fname" || ' ' || "lname"
204
+ </SQL>
205
+ <SQL dialect="generic">
206
+ "fname"
207
+ </SQL>
208
+ </NameExpression>
209
+ <OrdinalExpression>
210
+ <SQL dialect="oracle">
211
+ "fname" || ' ' || "lname"
212
+ </SQL>
213
+ <SQL dialect="access">
214
+ fname + ' ' + lname
215
+ </SQL>
216
+ <SQL dialect="postgres">
217
+ "fname" || ' ' || "lname"
218
+ </SQL>
219
+ <SQL dialect="mysql">
220
+ CONCAT(`customer`.`fname`, ' ', `customer`.`lname`)
221
+ </SQL>
222
+ <SQL dialect="mssql">
223
+ fname + ' ' + lname
224
+ </SQL>
225
+ <SQL dialect="derby">
226
+ "customer"."fullname"
227
+ </SQL>
228
+ <SQL dialect="db2">
229
+ CONCAT(CONCAT("customer"."fname", ' '), "customer"."lname")
230
+ </SQL>
231
+ <SQL dialect="luciddb">
232
+ "fname" || ' ' || "lname"
233
+ </SQL>
234
+ <SQL dialect="generic">
235
+ "fname"
236
+ </SQL>
237
+ </OrdinalExpression>
238
+ <Property name="Gender" column="gender"/>
239
+ <Property name="Marital Status" column="marital_status"/>
240
+ <Property name="Education" column="education"/>
241
+ <Property name="Yearly Income" column="yearly_income"/>
242
+ </Level>
243
+ </Hierarchy>
244
+ </Dimension>
245
+ <Dimension name="Education Level" foreignKey="customer_id">
246
+ <Hierarchy hasAll="true" primaryKey="customer_id">
247
+ <Table name="customer"/>
248
+ <Level name="Education Level" column="education" uniqueMembers="true"/>
249
+ </Hierarchy>
250
+ </Dimension>
251
+ <Dimension name="Gender" foreignKey="customer_id">
252
+ <Hierarchy hasAll="true" allMemberName="All Gender" primaryKey="customer_id">
253
+ <Table name="customer"/>
254
+ <Level name="Gender" column="gender" uniqueMembers="true"/>
255
+ </Hierarchy>
256
+ </Dimension>
257
+ <Dimension name="Marital Status" foreignKey="customer_id">
258
+ <Hierarchy hasAll="true" allMemberName="All Marital Status" primaryKey="customer_id">
259
+ <Table name="customer"/>
260
+ <Level name="Marital Status" column="marital_status" uniqueMembers="true" approxRowCount="111"/>
261
+ </Hierarchy>
262
+ </Dimension>
263
+ <Dimension name="Yearly Income" foreignKey="customer_id">
264
+ <Hierarchy hasAll="true" primaryKey="customer_id">
265
+ <Table name="customer"/>
266
+ <Level name="Yearly Income" column="yearly_income" uniqueMembers="true"/>
267
+ </Hierarchy>
268
+ </Dimension>
269
+
270
+ <Measure name="Unit Sales" column="unit_sales" aggregator="sum"
271
+ formatString="Standard"/>
272
+ <Measure name="Store Cost" column="store_cost" aggregator="sum"
273
+ formatString="#,###.00"/>
274
+ <Measure name="Store Sales" column="store_sales" aggregator="sum"
275
+ formatString="#,###.00"/>
276
+ <Measure name="Sales Count" column="product_id" aggregator="count"
277
+ formatString="#,###"/>
278
+ <Measure name="Customer Count" column="customer_id"
279
+ aggregator="distinct-count" formatString="#,###"/>
280
+ <Measure name="Promotion Sales" aggregator="sum" formatString="#,###.00">
281
+ <MeasureExpression>
282
+ <SQL dialect="access">
283
+ Iif("sales_fact_1997"."promotion_id" = 0, 0, "sales_fact_1997"."store_sales")
284
+ </SQL>
285
+ <SQL dialect="oracle">
286
+ (case when "sales_fact_1997"."promotion_id" = 0 then 0 else "sales_fact_1997"."store_sales" end)
287
+ </SQL>
288
+ <SQL dialect="postgres">
289
+ (case when "sales_fact_1997"."promotion_id" = 0 then 0 else "sales_fact_1997"."store_sales" end)
290
+ </SQL>
291
+ <SQL dialect="mysql">
292
+ (case when `sales_fact_1997`.`promotion_id` = 0 then 0 else `sales_fact_1997`.`store_sales` end)
293
+ </SQL>
294
+ <!-- Workaround the fact that Infobright does not have a CASE operator.
295
+ The simpler expression gives wrong results, so some tests are
296
+ disabled. -->
297
+ <SQL dialect="infobright">
298
+ `sales_fact_1997`.`store_sales`
299
+ </SQL>
300
+ <SQL dialect="derby">
301
+ (case when "sales_fact_1997"."promotion_id" = 0 then 0 else "sales_fact_1997"."store_sales" end)
302
+ </SQL>
303
+ <SQL dialect="luciddb">
304
+ (case when "sales_fact_1997"."promotion_id" = 0 then 0 else "sales_fact_1997"."store_sales" end)
305
+ </SQL>
306
+ <SQL dialect="db2">
307
+ (case when "sales_fact_1997"."promotion_id" = 0 then 0 else "sales_fact_1997"."store_sales" end)
308
+ </SQL>
309
+ <SQL dialect="generic">
310
+ (case when "sales_fact_1997"."promotion_id" = 0 then 0 else "sales_fact_1997"."store_sales" end)
311
+ </SQL>
312
+ </MeasureExpression>
313
+ </Measure>
314
+ <CalculatedMember
315
+ name="Profit"
316
+ dimension="Measures">
317
+ <Formula>[Measures].[Store Sales] - [Measures].[Store Cost]</Formula>
318
+ <CalculatedMemberProperty name="FORMAT_STRING" value="$#,##0.00"/>
319
+ </CalculatedMember>
320
+ <CalculatedMember
321
+ name="Profit last Period"
322
+ dimension="Measures"
323
+ formula="COALESCEEMPTY((Measures.[Profit], [Time].PREVMEMBER), Measures.[Profit])"
324
+ visible="false">
325
+ <CalculatedMemberProperty name="FORMAT_STRING" value="$#,##0.00"/>
326
+ <CalculatedMemberProperty name="MEMBER_ORDINAL" value="18"/>
327
+ </CalculatedMember>
328
+ <CalculatedMember
329
+ name="Profit Growth"
330
+ dimension="Measures"
331
+ formula="([Measures].[Profit] - [Measures].[Profit last Period]) / [Measures].[Profit last Period]"
332
+ visible="true"
333
+ caption="Gewinn-Wachstum">
334
+ <CalculatedMemberProperty name="FORMAT_STRING" value="0.0%"/>
335
+ </CalculatedMember>
336
+ </Cube>
337
+
338
+ <Cube name="Warehouse">
339
+ <Table name="inventory_fact_1997"/>
340
+
341
+ <DimensionUsage name="Store" source="Store" foreignKey="store_id"/>
342
+ <DimensionUsage name="Store Size in SQFT" source="Store Size in SQFT"
343
+ foreignKey="store_id"/>
344
+ <DimensionUsage name="Store Type" source="Store Type" foreignKey="store_id"/>
345
+ <DimensionUsage name="Time" source="Time" foreignKey="time_id"/>
346
+ <DimensionUsage name="Product" source="Product" foreignKey="product_id"/>
347
+ <DimensionUsage name="Warehouse" source="Warehouse" foreignKey="warehouse_id"/>
348
+
349
+ <Measure name="Store Invoice" column="store_invoice" aggregator="sum"/>
350
+ <Measure name="Supply Time" column="supply_time" aggregator="sum"/>
351
+ <Measure name="Warehouse Cost" column="warehouse_cost" aggregator="sum"/>
352
+ <Measure name="Warehouse Sales" column="warehouse_sales" aggregator="sum"/>
353
+ <Measure name="Units Shipped" column="units_shipped" aggregator="sum" formatString="#.0"/>
354
+ <Measure name="Units Ordered" column="units_ordered" aggregator="sum" formatString="#.0"/>
355
+ <Measure name="Warehouse Profit" aggregator="sum">
356
+ <MeasureExpression>
357
+ <SQL dialect="mysql">
358
+ `warehouse_sales` - `inventory_fact_1997`.`warehouse_cost`
359
+ </SQL>
360
+ <SQL dialect="infobright">
361
+ `warehouse_sales` - `inventory_fact_1997`.`warehouse_cost`
362
+ </SQL>
363
+ <SQL dialect="generic">
364
+ &quot;warehouse_sales&quot; - &quot;inventory_fact_1997&quot;.&quot;warehouse_cost&quot;
365
+ </SQL>
366
+ </MeasureExpression>
367
+ </Measure>
368
+ <CalculatedMember
369
+ name="Average Warehouse Sale"
370
+ dimension="Measures">
371
+ <Formula>[Measures].[Warehouse Sales] / [Measures].[Warehouse Cost]</Formula>
372
+ <CalculatedMemberProperty name="FORMAT_STRING" value="$#,##0.00"/>
373
+ </CalculatedMember>
374
+ <NamedSet name="Top Sellers">
375
+ <Formula>TopCount([Warehouse].[Warehouse Name].MEMBERS, 5, [Measures].[Warehouse Sales])</Formula>
376
+ </NamedSet>
377
+ </Cube>
378
+
379
+ <!-- Test a cube based upon a single table. -->
380
+ <Cube name="Store">
381
+ <Table name="store"/>
382
+ <!-- We could have used the shared dimension "Store Type", but we
383
+ want to test private dimensions without primary key. -->
384
+ <Dimension name="Store Type">
385
+ <Hierarchy hasAll="true">
386
+ <Level name="Store Type" column="store_type" uniqueMembers="true"/>
387
+ </Hierarchy>
388
+ </Dimension>
389
+
390
+ <!-- We don't have to specify primary key or foreign key since the shared
391
+ dimension "Store" has the same underlying table as the cube. -->
392
+ <DimensionUsage name="Store" source="Store"/>
393
+
394
+ <Dimension name="Has coffee bar">
395
+ <Hierarchy hasAll="true">
396
+ <Level name="Has coffee bar" column="coffee_bar" uniqueMembers="true"
397
+ type="Boolean"/>
398
+ </Hierarchy>
399
+ </Dimension>
400
+
401
+ <Measure name="Store Sqft" column="store_sqft" aggregator="sum"
402
+ formatString="#,###"/>
403
+ <Measure name="Grocery Sqft" column="grocery_sqft" aggregator="sum"
404
+ formatString="#,###"/>
405
+
406
+ </Cube>
407
+
408
+ <Cube name="HR">
409
+ <Table name="salary"/>
410
+ <!-- Use private "Time" dimension because key is different than public
411
+ "Time" dimension. -->
412
+ <Dimension name="Time" type="TimeDimension" foreignKey="pay_date">
413
+ <Hierarchy hasAll="false" primaryKey="the_date">
414
+ <Table name="time_by_day"/>
415
+ <Level name="Year" column="the_year" type="Numeric" uniqueMembers="true"
416
+ levelType="TimeYears"/>
417
+ <Level name="Quarter" column="quarter" uniqueMembers="false"
418
+ levelType="TimeQuarters"/>
419
+ <!-- Use the_month as source for the name, so members look like
420
+ [Time].[1997].[Q1].[Jan] rather than [Time].[1997].[Q1].[1]. -->
421
+ <Level name="Month" column="month_of_year" nameColumn="the_month"
422
+ uniqueMembers="false" type="Numeric" levelType="TimeMonths"/>
423
+ </Hierarchy>
424
+ </Dimension>
425
+
426
+ <Dimension name="Store" foreignKey="employee_id" >
427
+ <Hierarchy hasAll="true" primaryKey="employee_id"
428
+ primaryKeyTable="employee">
429
+ <Join leftKey="store_id" rightKey="store_id">
430
+ <Table name="employee"/>
431
+ <Table name="store"/>
432
+ </Join>
433
+ <Level name="Store Country" table="store" column="store_country"
434
+ uniqueMembers="true"/>
435
+ <Level name="Store State" table="store" column="store_state"
436
+ uniqueMembers="true"/>
437
+ <Level name="Store City" table="store" column="store_city"
438
+ uniqueMembers="false"/>
439
+ <Level name="Store Name" table="store" column="store_name"
440
+ uniqueMembers="true">
441
+ <Property name="Store Type" column="store_type"/>
442
+ <Property name="Store Manager" column="store_manager"/>
443
+ <Property name="Store Sqft" column="store_sqft" type="Numeric"/>
444
+ <Property name="Grocery Sqft" column="grocery_sqft" type="Numeric"/>
445
+ <Property name="Frozen Sqft" column="frozen_sqft" type="Numeric"/>
446
+ <Property name="Meat Sqft" column="meat_sqft" type="Numeric"/>
447
+ <Property name="Has coffee bar" column="coffee_bar" type="Boolean"/>
448
+ <Property name="Street address" column="store_street_address"
449
+ type="String"/>
450
+ </Level>
451
+ </Hierarchy>
452
+ </Dimension>
453
+
454
+ <Dimension name="Pay Type" foreignKey="employee_id">
455
+ <Hierarchy hasAll="true" primaryKey="employee_id"
456
+ primaryKeyTable="employee">
457
+ <Join leftKey="position_id" rightKey="position_id">
458
+ <Table name="employee"/>
459
+ <Table name="position"/>
460
+ </Join>
461
+ <Level name="Pay Type" table="position" column="pay_type"
462
+ uniqueMembers="true"/>
463
+ </Hierarchy>
464
+ </Dimension>
465
+
466
+ <Dimension name="Store Type" foreignKey="employee_id">
467
+ <Hierarchy hasAll="true" primaryKeyTable="employee" primaryKey="employee_id">
468
+ <Join leftKey="store_id" rightKey="store_id">
469
+ <Table name="employee"/>
470
+ <Table name="store"/>
471
+ </Join>
472
+ <Level name="Store Type" table="store" column="store_type"
473
+ uniqueMembers="true"/>
474
+ </Hierarchy>
475
+ </Dimension>
476
+
477
+ <Dimension name="Position" foreignKey="employee_id">
478
+ <Hierarchy hasAll="true" allMemberName="All Position"
479
+ primaryKey="employee_id">
480
+ <Table name="employee"/>
481
+ <Level name="Management Role" uniqueMembers="true"
482
+ column="management_role"/>
483
+ <Level name="Position Title" uniqueMembers="false"
484
+ column="position_title" ordinalColumn="position_id"/>
485
+ </Hierarchy>
486
+ </Dimension>
487
+
488
+ <Dimension name="Department" foreignKey="department_id">
489
+ <Hierarchy hasAll="true" primaryKey="department_id">
490
+ <Table name="department"/>
491
+ <Level name="Department Description" uniqueMembers="true"
492
+ column="department_id"/>
493
+ </Hierarchy>
494
+ </Dimension>
495
+ <Dimension name="Employees" foreignKey="employee_id">
496
+ <Hierarchy hasAll="true" allMemberName="All Employees"
497
+ primaryKey="employee_id">
498
+ <Table name="employee"/>
499
+ <Level name="Employee Id" type="Numeric" uniqueMembers="true"
500
+ column="employee_id" parentColumn="supervisor_id"
501
+ nameColumn="full_name" nullParentValue="0">
502
+ <Closure parentColumn="supervisor_id" childColumn="employee_id">
503
+ <Table name="employee_closure"/>
504
+ </Closure>
505
+ <Property name="Marital Status" column="marital_status"/>
506
+ <Property name="Position Title" column="position_title"/>
507
+ <Property name="Gender" column="gender"/>
508
+ <Property name="Salary" column="salary"/>
509
+ <Property name="Education Level" column="education_level"/>
510
+ <Property name="Management Role" column="management_role"/>
511
+ </Level>
512
+ </Hierarchy>
513
+ </Dimension>
514
+
515
+ <Measure name="Org Salary" column="salary_paid" aggregator="sum"
516
+ formatString="Currency"/>
517
+ <Measure name="Count" column="employee_id" aggregator="count"
518
+ formatString="#,#"/>
519
+ <Measure name="Number of Employees" column="employee_id"
520
+ aggregator="distinct-count" formatString="#,#"/>
521
+ <CalculatedMember name="Employee Salary" dimension="Measures"
522
+ formatString="Currency"
523
+ formula="([Employees].currentmember.datamember, [Measures].[Org Salary])"/>
524
+ <CalculatedMember name="Avg Salary" dimension="Measures"
525
+ formatString="Currency"
526
+ formula="[Measures].[Org Salary]/[Measures].[Number of Employees]"/>
527
+ </Cube>
528
+
529
+ <!-- Cube with one ragged hierarchy (otherwise the same as the "Sales"
530
+ cube). -->
531
+ <Cube name="Sales Ragged">
532
+ <Table name="sales_fact_1997">
533
+ <AggExclude name="agg_pc_10_sales_fact_1997"/>
534
+ <AggExclude name="agg_lc_10_sales_fact_1997"/>
535
+ </Table>
536
+ <Dimension name="Store" foreignKey="store_id">
537
+ <Hierarchy hasAll="true" primaryKey="store_id">
538
+ <Table name="store_ragged"/>
539
+ <Level name="Store Country" column="store_country" uniqueMembers="true"
540
+ hideMemberIf="Never"/>
541
+ <Level name="Store State" column="store_state" uniqueMembers="true"
542
+ hideMemberIf="IfParentsName"/>
543
+ <Level name="Store City" column="store_city" uniqueMembers="false"
544
+ hideMemberIf="IfBlankName"/>
545
+ <Level name="Store Name" column="store_name" uniqueMembers="true"
546
+ hideMemberIf="Never">
547
+ <Property name="Store Type" column="store_type"/>
548
+ <Property name="Store Manager" column="store_manager"/>
549
+ <Property name="Store Sqft" column="store_sqft" type="Numeric"/>
550
+ <Property name="Grocery Sqft" column="grocery_sqft" type="Numeric"/>
551
+ <Property name="Frozen Sqft" column="frozen_sqft" type="Numeric"/>
552
+ <Property name="Meat Sqft" column="meat_sqft" type="Numeric"/>
553
+ <Property name="Has coffee bar" column="coffee_bar" type="Boolean"/>
554
+ <Property name="Street address" column="store_street_address" type="String"/>
555
+ </Level>
556
+ </Hierarchy>
557
+ </Dimension>
558
+
559
+ <Dimension name="Geography" foreignKey="store_id">
560
+ <Hierarchy hasAll="true" primaryKey="store_id">
561
+ <Table name="store_ragged"/>
562
+ <Level name="Country" column="store_country" uniqueMembers="true"
563
+ hideMemberIf="Never"/>
564
+ <Level name="State" column="store_state" uniqueMembers="true"
565
+ hideMemberIf="IfParentsName"/>
566
+ <Level name="City" column="store_city" uniqueMembers="false"
567
+ hideMemberIf="IfBlankName"/>
568
+ </Hierarchy>
569
+ </Dimension>
570
+
571
+ <DimensionUsage name="Store Size in SQFT" source="Store Size in SQFT"
572
+ foreignKey="store_id"/>
573
+ <DimensionUsage name="Store Type" source="Store Type" foreignKey="store_id"/>
574
+ <DimensionUsage name="Time" source="Time" foreignKey="time_id"/>
575
+ <DimensionUsage name="Product" source="Product" foreignKey="product_id"/>
576
+ <Dimension name="Promotion Media" foreignKey="promotion_id">
577
+ <Hierarchy hasAll="true" allMemberName="All Media" primaryKey="promotion_id">
578
+ <Table name="promotion"/>
579
+ <Level name="Media Type" column="media_type" uniqueMembers="true"/>
580
+ </Hierarchy>
581
+ </Dimension>
582
+ <Dimension name="Promotions" foreignKey="promotion_id">
583
+ <Hierarchy hasAll="true" allMemberName="All Promotions" primaryKey="promotion_id">
584
+ <Table name="promotion"/>
585
+ <Level name="Promotion Name" column="promotion_name" uniqueMembers="true"/>
586
+ </Hierarchy>
587
+ </Dimension>
588
+ <Dimension name="Customers" foreignKey="customer_id">
589
+ <Hierarchy hasAll="true" allMemberName="All Customers" primaryKey="customer_id">
590
+ <Table name="customer"/>
591
+ <Level name="Country" column="country" uniqueMembers="true"/>
592
+ <Level name="State Province" column="state_province" uniqueMembers="true"/>
593
+ <Level name="City" column="city" uniqueMembers="false"/>
594
+ <Level name="Name" uniqueMembers="true">
595
+ <KeyExpression>
596
+ <SQL dialect="oracle">
597
+ "fname" || ' ' || "lname"
598
+ </SQL>
599
+ <SQL dialect="access">
600
+ fname + ' ' + lname
601
+ </SQL>
602
+ <SQL dialect="postgres">
603
+ "fname" || ' ' || "lname"
604
+ </SQL>
605
+ <SQL dialect="mysql">
606
+ CONCAT(`customer`.`fname`, ' ', `customer`.`lname`)
607
+ </SQL>
608
+ <SQL dialect="mssql">
609
+ fname + ' ' + lname
610
+ </SQL>
611
+ <SQL dialect="derby">
612
+ "customer"."fullname"
613
+ </SQL>
614
+ <SQL dialect="db2">
615
+ CONCAT(CONCAT("customer"."fname", ' '), "customer"."lname")
616
+ </SQL>
617
+ <SQL dialect="luciddb">
618
+ "fname" || ' ' || "lname"
619
+ </SQL>
620
+ <SQL dialect="generic">
621
+ "fname"
622
+ </SQL>
623
+ </KeyExpression>
624
+ <Property name="Gender" column="gender"/>
625
+ <Property name="Marital Status" column="marital_status"/>
626
+ <Property name="Education" column="education"/>
627
+ <Property name="Yearly Income" column="yearly_income"/>
628
+ </Level>
629
+ </Hierarchy>
630
+ </Dimension>
631
+ <Dimension name="Education Level" foreignKey="customer_id">
632
+ <Hierarchy hasAll="true" primaryKey="customer_id">
633
+ <Table name="customer"/>
634
+ <Level name="Education Level" column="education" uniqueMembers="true"/>
635
+ </Hierarchy>
636
+ </Dimension>
637
+ <Dimension name="Gender" foreignKey="customer_id">
638
+ <Hierarchy hasAll="true" allMemberName="All Gender" primaryKey="customer_id">
639
+ <Table name="customer"/>
640
+ <Level name="Gender" column="gender" uniqueMembers="true"/>
641
+ </Hierarchy>
642
+ </Dimension>
643
+ <Dimension name="Marital Status" foreignKey="customer_id">
644
+ <Hierarchy hasAll="true" allMemberName="All Marital Status" primaryKey="customer_id">
645
+ <Table name="customer"/>
646
+ <Level name="Marital Status" column="marital_status" uniqueMembers="true"/>
647
+ </Hierarchy>
648
+ </Dimension>
649
+ <Dimension name="Yearly Income" foreignKey="customer_id">
650
+ <Hierarchy hasAll="true" primaryKey="customer_id">
651
+ <Table name="customer"/>
652
+ <Level name="Yearly Income" column="yearly_income" uniqueMembers="true"/>
653
+ </Hierarchy>
654
+ </Dimension>
655
+ <Measure name="Unit Sales" column="unit_sales" aggregator="sum"
656
+ formatString="Standard"/>
657
+ <Measure name="Store Cost" column="store_cost" aggregator="sum"
658
+ formatString="#,###.00"/>
659
+ <Measure name="Store Sales" column="store_sales" aggregator="sum"
660
+ formatString="#,###.00"/>
661
+ <Measure name="Sales Count" column="product_id" aggregator="count"
662
+ formatString="#,###"/>
663
+ <Measure name="Customer Count" column="customer_id" aggregator="distinct-count"
664
+ formatString="#,###"/>
665
+ </Cube>
666
+
667
+ <!-- a simpler version of "Sales" (with MEMBER_ORDINAL-properties) -->
668
+ <Cube name="Sales 2">
669
+ <Table name="sales_fact_1997"/>
670
+
671
+ <DimensionUsage name="Time" source="Time" foreignKey="time_id"/>
672
+ <DimensionUsage name="Product" source="Product" foreignKey="product_id"/>
673
+
674
+ <Dimension name="Gender" foreignKey="customer_id">
675
+ <Hierarchy hasAll="true" allMemberName="All Gender" primaryKey="customer_id">
676
+ <Table name="customer"/>
677
+ <Level name="Gender" column="gender" uniqueMembers="true"/>
678
+ </Hierarchy>
679
+ </Dimension>
680
+
681
+ <Measure name="Sales Count" column="product_id" aggregator="count" formatString="#,###">
682
+ <CalculatedMemberProperty name="MEMBER_ORDINAL" value="1"/>
683
+ </Measure>
684
+
685
+ <Measure name="Unit Sales" column="unit_sales" aggregator="sum" formatString="Standard">
686
+ <CalculatedMemberProperty name="MEMBER_ORDINAL" value="2"/>
687
+ </Measure>
688
+
689
+ <Measure name="Store Sales" column="store_sales" aggregator="sum" formatString="#,###.00">
690
+ <CalculatedMemberProperty name="MEMBER_ORDINAL" value="3"/>
691
+ </Measure>
692
+
693
+ <Measure name="Store Cost" column="store_cost" aggregator="sum" formatString="#,###.00">
694
+ <CalculatedMemberProperty name="MEMBER_ORDINAL" value="6"/>
695
+ </Measure>
696
+
697
+ <Measure name="Customer Count" column="customer_id" aggregator="distinct-count" formatString="#,###">
698
+ <CalculatedMemberProperty name="MEMBER_ORDINAL" value="7"/>
699
+ </Measure>
700
+
701
+ <CalculatedMember
702
+ name="Profit"
703
+ dimension="Measures">
704
+ <Formula>[Measures].[Store Sales] - [Measures].[Store Cost]</Formula>
705
+ <CalculatedMemberProperty name="FORMAT_STRING" value="$#,##0.00"/>
706
+ <CalculatedMemberProperty name="MEMBER_ORDINAL" value="4"/>
707
+ </CalculatedMember>
708
+
709
+ <CalculatedMember
710
+ name="Profit last Period"
711
+ dimension="Measures"
712
+ formula="COALESCEEMPTY((Measures.[Profit], [Time].PREVMEMBER), Measures.[Profit])"
713
+ visible="false">
714
+ <CalculatedMemberProperty name="MEMBER_ORDINAL" value="5"/>
715
+ </CalculatedMember>
716
+ </Cube>
717
+
718
+ <VirtualCube name="Warehouse and Sales" defaultMeasure="Store Sales">
719
+ <VirtualCubeDimension cubeName="Sales" name="Customers"/>
720
+ <VirtualCubeDimension cubeName="Sales" name="Education Level"/>
721
+ <VirtualCubeDimension cubeName="Sales" name="Gender"/>
722
+ <VirtualCubeDimension cubeName="Sales" name="Marital Status"/>
723
+ <VirtualCubeDimension name="Product"/>
724
+ <VirtualCubeDimension cubeName="Sales" name="Promotion Media"/>
725
+ <VirtualCubeDimension cubeName="Sales" name="Promotions"/>
726
+ <VirtualCubeDimension name="Store"/>
727
+ <VirtualCubeDimension name="Time"/>
728
+ <VirtualCubeDimension cubeName="Sales" name="Yearly Income"/>
729
+ <VirtualCubeDimension cubeName="Warehouse" name="Warehouse"/>
730
+ <VirtualCubeMeasure cubeName="Sales" name="[Measures].[Sales Count]"/>
731
+ <VirtualCubeMeasure cubeName="Sales" name="[Measures].[Store Cost]"/>
732
+ <VirtualCubeMeasure cubeName="Sales" name="[Measures].[Store Sales]"/>
733
+ <VirtualCubeMeasure cubeName="Sales" name="[Measures].[Unit Sales]"/>
734
+ <VirtualCubeMeasure cubeName="Sales" name="[Measures].[Profit]"/>
735
+ <VirtualCubeMeasure cubeName="Sales" name="[Measures].[Profit Growth]"/>
736
+ <VirtualCubeMeasure cubeName="Warehouse" name="[Measures].[Store Invoice]"/>
737
+ <VirtualCubeMeasure cubeName="Warehouse" name="[Measures].[Supply Time]"/>
738
+ <VirtualCubeMeasure cubeName="Warehouse" name="[Measures].[Units Ordered]"/>
739
+ <VirtualCubeMeasure cubeName="Warehouse" name="[Measures].[Units Shipped]"/>
740
+ <VirtualCubeMeasure cubeName="Warehouse" name="[Measures].[Warehouse Cost]"/>
741
+ <VirtualCubeMeasure cubeName="Warehouse" name="[Measures].[Warehouse Profit]"/>
742
+ <VirtualCubeMeasure cubeName="Warehouse" name="[Measures].[Warehouse Sales]"/>
743
+ <VirtualCubeMeasure cubeName="Warehouse" name="[Measures].[Average Warehouse Sale]"/>
744
+ <!--
745
+ <VirtualCubeMeasure cubeName="Sales" name="[Measures].[Store Sales Net]"/>
746
+ -->
747
+ <CalculatedMember name="Profit Per Unit Shipped" dimension="Measures">
748
+ <Formula>[Measures].[Profit] / [Measures].[Units Shipped]</Formula>
749
+ </CalculatedMember>
750
+ </VirtualCube>
751
+
752
+ <!-- A California manager can only see customers and stores in California.
753
+ They cannot drill down on Gender. -->
754
+ <Role name="California manager">
755
+ <SchemaGrant access="none">
756
+ <CubeGrant cube="Sales" access="all">
757
+ <HierarchyGrant hierarchy="[Store]" access="custom"
758
+ topLevel="[Store].[Store Country]">
759
+ <MemberGrant member="[Store].[USA].[CA]" access="all"/>
760
+ <MemberGrant member="[Store].[USA].[CA].[Los Angeles]" access="none"/>
761
+ </HierarchyGrant>
762
+ <HierarchyGrant hierarchy="[Customers]" access="custom"
763
+ topLevel="[Customers].[State Province]" bottomLevel="[Customers].[City]">
764
+ <MemberGrant member="[Customers].[USA].[CA]" access="all"/>
765
+ <MemberGrant member="[Customers].[USA].[CA].[Los Angeles]" access="none"/>
766
+ </HierarchyGrant>
767
+ <HierarchyGrant hierarchy="[Gender]" access="none"/>
768
+ </CubeGrant>
769
+ </SchemaGrant>
770
+ </Role>
771
+
772
+ <Role name="No HR Cube">
773
+ <SchemaGrant access="all">
774
+ <CubeGrant cube="HR" access="none"/>
775
+ </SchemaGrant>
776
+ </Role>
777
+
778
+ </Schema>