forked from OSBI/saiku
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FoodMart.xml
1011 lines (967 loc) · 41.8 KB
/
FoodMart.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
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0"?>
<Schema name="FoodMart">
<!--
== $Id:$
== This software is subject to the terms of the Eclipse Public License v1.0
== Agreement, available at the following URL:
== http://www.eclipse.org/legal/epl-v10.html.
== Copyright (C) 2000-2002 Kana Software, Inc.
== Copyright (C) 2002-2009 Julian Hyde and others.
== All Rights Reserved.
== You must accept the terms of that agreement to use this software.
-->
<!-- Shared dimensions -->
<Dimension name="Store">
<Hierarchy hasAll="true" primaryKey="store_id">
<Table name="store"/>
<Level name="Store Country" column="store_country" uniqueMembers="true"/>
<Level name="Store State" column="store_state" uniqueMembers="true"/>
<Level name="Store City" column="store_city" uniqueMembers="false"/>
<Level name="Store Name" column="store_name" uniqueMembers="true">
<Property name="Store Type" column="store_type"/>
<Property name="Store Manager" column="store_manager"/>
<Property name="Store Sqft" column="store_sqft" type="Numeric"/>
<Property name="Grocery Sqft" column="grocery_sqft" type="Numeric"/>
<Property name="Frozen Sqft" column="frozen_sqft" type="Numeric"/>
<Property name="Meat Sqft" column="meat_sqft" type="Numeric"/>
<Property name="Has coffee bar" column="coffee_bar" type="Boolean"/>
<Property name="Street address" column="store_street_address" type="String"/>
</Level>
</Hierarchy>
</Dimension>
<Dimension name="Store Size in SQFT">
<Hierarchy hasAll="true" primaryKey="store_id">
<Table name="store"/>
<Level name="Store Sqft" column="store_sqft" type="Numeric" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Store Type">
<Hierarchy hasAll="true" primaryKey="store_id">
<Table name="store"/>
<Level name="Store Type" column="store_type" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Time" type="TimeDimension">
<Hierarchy hasAll="false" primaryKey="time_id">
<Table name="time_by_day"/>
<Level name="Year" column="the_year" type="Numeric" uniqueMembers="true"
levelType="TimeYears"/>
<Level name="Quarter" column="quarter" uniqueMembers="false"
levelType="TimeQuarters">
<Annotations><Annotation name="AnalyzerDateFormat">[yyyy].['QTR'q]</Annotation></Annotations>
</Level>
<Level name="Month" column="month_of_year" uniqueMembers="false" type="Numeric"
levelType="TimeMonths">
<Annotations><Annotation name="AnalyzerDateFormat">[yyyy].['QTR'q].[m]</Annotation></Annotations>
</Level>
</Hierarchy>
<Hierarchy hasAll="true" name="Weekly" primaryKey="time_id">
<Table name="time_by_day"/>
<Level name="Year" column="the_year" type="Numeric" uniqueMembers="true"
levelType="TimeYears"/>
<Level name="Week" column="week_of_year" type="Numeric" uniqueMembers="false"
levelType="TimeWeeks"/>
<Level name="Day" column="day_of_month" uniqueMembers="false" type="Numeric"
levelType="TimeDays"/>
</Hierarchy>
</Dimension>
<Dimension name="Product">
<Hierarchy hasAll="true" primaryKey="product_id" primaryKeyTable="product">
<Join leftKey="product_class_id" rightKey="product_class_id">
<Table name="product"/>
<Table name="product_class"/>
</Join>
<!--
<Query>
<SQL dialect="generic">
SELECT *
FROM "product", "product_class"
WHERE "product"."product_class_id" = "product_class"."product_class_id"
</SQL>
</Query>
<Level name="Product Family" column="product_family" uniqueMembers="true"/>
<Level name="Product Department" column="product_department" uniqueMembers="false"/>
<Level name="Product Category" column="product_category" uniqueMembers="false"/>
<Level name="Product Subcategory" column="product_subcategory" uniqueMembers="false"/>
<Level name="Brand Name" column="brand_name" uniqueMembers="false"/>
<Level name="Product Name" column="product_name" uniqueMembers="true"/>
-->
<Level name="Product Family" table="product_class" column="product_family"
uniqueMembers="true"/>
<Level name="Product Department" table="product_class" column="product_department"
uniqueMembers="false"/>
<Level name="Product Category" table="product_class" column="product_category"
uniqueMembers="false"/>
<Level name="Product Subcategory" table="product_class" column="product_subcategory"
uniqueMembers="false"/>
<Level name="Brand Name" table="product" column="brand_name" uniqueMembers="false"/>
<Level name="Product Name" table="product" column="product_name"
uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Warehouse">
<Hierarchy hasAll="true" primaryKey="warehouse_id">
<Table name="warehouse"/>
<Level name="Country" column="warehouse_country" uniqueMembers="true"/>
<Level name="State Province" column="warehouse_state_province"
uniqueMembers="true"/>
<Level name="City" column="warehouse_city" uniqueMembers="false"/>
<Level name="Warehouse Name" column="warehouse_name" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<!-- Sales -->
<Cube name="Sales" defaultMeasure="Unit Sales">
<Table name="sales_fact_1997">
<!--
<AggExclude name="agg_l_03_sales_fact_1997" />
<AggExclude name="agg_ll_01_sales_fact_1997" />
<AggExclude name="agg_pl_01_sales_fact_1997" />
<AggExclude name="agg_l_05_sales_fact_1997" />
-->
<AggExclude name="agg_c_special_sales_fact_1997" />
<!--
<AggExclude name="agg_c_14_sales_fact_1997" />
-->
<AggExclude name="agg_lc_100_sales_fact_1997" />
<AggExclude name="agg_lc_10_sales_fact_1997" />
<AggExclude name="agg_pc_10_sales_fact_1997" />
<AggName name="agg_c_special_sales_fact_1997">
<AggFactCount column="FACT_COUNT"/>
<AggIgnoreColumn column="foo"/>
<AggIgnoreColumn column="bar"/>
<AggForeignKey factColumn="product_id" aggColumn="PRODUCT_ID" />
<AggForeignKey factColumn="customer_id" aggColumn="CUSTOMER_ID" />
<AggForeignKey factColumn="promotion_id" aggColumn="PROMOTION_ID" />
<AggForeignKey factColumn="store_id" aggColumn="STORE_ID" />
<!--
<AggMeasure name="[Measures].[Avg Unit Sales]" column="UNIT_SALES_AVG"/>
-->
<AggMeasure name="[Measures].[Unit Sales]" column="UNIT_SALES_SUM" />
<AggMeasure name="[Measures].[Store Cost]" column="STORE_COST_SUM" />
<AggMeasure name="[Measures].[Store Sales]" column="STORE_SALES_SUM" />
<AggLevel name="[Time].[Year]" column="TIME_YEAR" />
<AggLevel name="[Time].[Quarter]" column="TIME_QUARTER" />
<AggLevel name="[Time].[Month]" column="TIME_MONTH" />
</AggName>
</Table>
<DimensionUsage name="Store" source="Store" foreignKey="store_id"/>
<DimensionUsage name="Store Size in SQFT" source="Store Size in SQFT"
foreignKey="store_id"/>
<DimensionUsage name="Store Type" source="Store Type" foreignKey="store_id"/>
<DimensionUsage name="Time" source="Time" foreignKey="time_id"/>
<DimensionUsage name="Product" source="Product" foreignKey="product_id"/>
<Dimension name="Promotion Media" foreignKey="promotion_id">
<Hierarchy hasAll="true" allMemberName="All Media" primaryKey="promotion_id" defaultMember="All Media">
<Table name="promotion"/>
<Level name="Media Type" column="media_type" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Promotions" foreignKey="promotion_id">
<Hierarchy hasAll="true" allMemberName="All Promotions" primaryKey="promotion_id" defaultMember="[All Promotions]">
<Table name="promotion"/>
<Level name="Promotion Name" column="promotion_name" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Customers" foreignKey="customer_id">
<Hierarchy hasAll="true" allMemberName="All Customers" primaryKey="customer_id">
<Table name="customer"/>
<Level name="Country" column="country" uniqueMembers="true"/>
<Level name="State Province" column="state_province" uniqueMembers="true"/>
<Level name="City" column="city" uniqueMembers="false"/>
<Level name="Name" column="customer_id" type="Numeric" uniqueMembers="true">
<NameExpression>
<SQL dialect="oracle">
"fname" || ' ' || "lname"
</SQL>
<SQL dialect="access">
fname + ' ' + lname
</SQL>
<SQL dialect="postgres">
"fname" || ' ' || "lname"
</SQL>
<SQL dialect="mysql">
CONCAT(`customer`.`fname`, ' ', `customer`.`lname`)
</SQL>
<SQL dialect="mssql">
fname + ' ' + lname
</SQL>
<SQL dialect="derby">
"customer"."fullname"
</SQL>
<SQL dialect="db2">
CONCAT(CONCAT("customer"."fname", ' '), "customer"."lname")
</SQL>
<SQL dialect="luciddb">
"fname" || ' ' || "lname"
</SQL>
<SQL dialect="teradata">
"fname" || ' ' || "lname"
</SQL>
<SQL dialect="generic">
"fname"
</SQL>
</NameExpression>
<OrdinalExpression>
<SQL dialect="oracle">
"fname" || ' ' || "lname"
</SQL>
<SQL dialect="access">
fname + ' ' + lname
</SQL>
<SQL dialect="postgres">
"fname" || ' ' || "lname"
</SQL>
<SQL dialect="mysql">
CONCAT(`customer`.`fname`, ' ', `customer`.`lname`)
</SQL>
<SQL dialect="mssql">
fname + ' ' + lname
</SQL>
<SQL dialect="derby">
"customer"."fullname"
</SQL>
<SQL dialect="db2">
CONCAT(CONCAT("customer"."fname", ' '), "customer"."lname")
</SQL>
<SQL dialect="luciddb">
"fname" || ' ' || "lname"
</SQL>
<SQL dialect="generic">
"fname"
</SQL>
</OrdinalExpression>
<Property name="Gender" column="gender"/>
<Property name="Marital Status" column="marital_status"/>
<Property name="Education" column="education"/>
<Property name="Yearly Income" column="yearly_income"/>
</Level>
</Hierarchy>
</Dimension>
<Dimension name="Education Level" foreignKey="customer_id">
<Hierarchy hasAll="true" primaryKey="customer_id">
<Table name="customer"/>
<Level name="Education Level" column="education" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Gender" foreignKey="customer_id">
<Hierarchy hasAll="true" allMemberName="All Gender" primaryKey="customer_id">
<Table name="customer"/>
<Level name="Gender" column="gender" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Marital Status" foreignKey="customer_id">
<Hierarchy hasAll="true" allMemberName="All Marital Status" primaryKey="customer_id">
<Table name="customer"/>
<Level name="Marital Status" column="marital_status" uniqueMembers="true" approxRowCount="111"/>
</Hierarchy>
</Dimension>
<Dimension name="Yearly Income" foreignKey="customer_id">
<Hierarchy hasAll="true" primaryKey="customer_id">
<Table name="customer"/>
<Level name="Yearly Income" column="yearly_income" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Measure name="Unit Sales" column="unit_sales" aggregator="sum"
formatString="Standard"/>
<Measure name="Store Cost" column="store_cost" aggregator="sum"
formatString="#,###.00"/>
<Measure name="Store Sales" column="store_sales" aggregator="sum"
formatString="#,###.00"/>
<Measure name="Sales Count" column="product_id" aggregator="count"
formatString="#,###"/>
<Measure name="Customer Count" column="customer_id"
aggregator="distinct-count" formatString="#,###"/>
<Measure name="Promotion Sales" aggregator="sum" formatString="#,###.00">
<MeasureExpression>
<SQL dialect="access">
Iif("sales_fact_1997"."promotion_id" = 0, 0, "sales_fact_1997"."store_sales")
</SQL>
<SQL dialect="oracle">
(case when "sales_fact_1997"."promotion_id" = 0 then 0 else "sales_fact_1997"."store_sales" end)
</SQL>
<SQL dialect="postgres">
(case when "sales_fact_1997"."promotion_id" = 0 then 0 else "sales_fact_1997"."store_sales" end)
</SQL>
<SQL dialect="mysql">
(case when `sales_fact_1997`.`promotion_id` = 0 then 0 else `sales_fact_1997`.`store_sales` end)
</SQL>
<!-- Workaround the fact that Infobright does not have a CASE operator.
The simpler expression gives wrong results, so some tests are
disabled. -->
<SQL dialect="infobright">
`sales_fact_1997`.`store_sales`
</SQL>
<SQL dialect="derby">
(case when "sales_fact_1997"."promotion_id" = 0 then 0 else "sales_fact_1997"."store_sales" end)
</SQL>
<SQL dialect="luciddb">
(case when "sales_fact_1997"."promotion_id" = 0 then 0 else "sales_fact_1997"."store_sales" end)
</SQL>
<SQL dialect="db2">
(case when "sales_fact_1997"."promotion_id" = 0 then 0 else "sales_fact_1997"."store_sales" end)
</SQL>
<SQL dialect="generic">
(case when "sales_fact_1997"."promotion_id" = 0 then 0 else "sales_fact_1997"."store_sales" end)
</SQL>
</MeasureExpression>
</Measure>
<CalculatedMember
name="Profit"
dimension="Measures">
<Formula>[Measures].[Store Sales] - [Measures].[Store Cost]</Formula>
<CalculatedMemberProperty name="FORMAT_STRING" value="$#,##0.00"/>
</CalculatedMember>
<CalculatedMember
name="Profit last Period"
dimension="Measures"
formula="COALESCEEMPTY((Measures.[Profit], [Time].PREVMEMBER), Measures.[Profit])"
visible="false">
<CalculatedMemberProperty name="FORMAT_STRING" value="$#,##0.00"/>
<CalculatedMemberProperty name="MEMBER_ORDINAL" value="18"/>
</CalculatedMember>
<CalculatedMember
name="Profit Growth"
dimension="Measures"
formula="([Measures].[Profit] - [Measures].[Profit last Period]) / [Measures].[Profit last Period]"
visible="true"
caption="Gewinn-Wachstum">
<CalculatedMemberProperty name="FORMAT_STRING" value="0.0%"/>
</CalculatedMember>
<CalculatedMember name='H1 1997' formula='Aggregate([Time].[1997].[Q1]:[Time].[1997].[Q2])' dimension='Time' />
</Cube>
<Cube name="Sales Scenario" defaultMeasure="Unit Sales">
<Table name="sales_fact_1997">
<!--
<AggExclude name="agg_l_03_sales_fact_1997" />
<AggExclude name="agg_ll_01_sales_fact_1997" />
<AggExclude name="agg_pl_01_sales_fact_1997" />
<AggExclude name="agg_l_05_sales_fact_1997" />
-->
<AggExclude name="agg_c_special_sales_fact_1997" />
<!--
<AggExclude name="agg_c_14_sales_fact_1997" />
-->
<AggExclude name="agg_lc_100_sales_fact_1997" />
<AggExclude name="agg_lc_10_sales_fact_1997" />
<AggExclude name="agg_pc_10_sales_fact_1997" />
<AggName name="agg_c_special_sales_fact_1997">
<AggFactCount column="FACT_COUNT"/>
<AggIgnoreColumn column="foo"/>
<AggIgnoreColumn column="bar"/>
<AggForeignKey factColumn="product_id" aggColumn="PRODUCT_ID" />
<AggForeignKey factColumn="customer_id" aggColumn="CUSTOMER_ID" />
<AggForeignKey factColumn="promotion_id" aggColumn="PROMOTION_ID" />
<AggForeignKey factColumn="store_id" aggColumn="STORE_ID" />
<!--
<AggMeasure name="[Measures].[Avg Unit Sales]" column="UNIT_SALES_AVG"/>
-->
<AggMeasure name="[Measures].[Unit Sales]" column="UNIT_SALES_SUM" />
<AggMeasure name="[Measures].[Store Cost]" column="STORE_COST_SUM" />
<AggMeasure name="[Measures].[Store Sales]" column="STORE_SALES_SUM" />
<AggLevel name="[Time].[Year]" column="TIME_YEAR" />
<AggLevel name="[Time].[Quarter]" column="TIME_QUARTER" />
<AggLevel name="[Time].[Month]" column="TIME_MONTH" />
</AggName>
</Table>
<DimensionUsage name="Store" source="Store" foreignKey="store_id"/>
<DimensionUsage name="Store Size in SQFT" source="Store Size in SQFT"
foreignKey="store_id"/>
<DimensionUsage name="Store Type" source="Store Type" foreignKey="store_id"/>
<DimensionUsage name="Time" source="Time" foreignKey="time_id"/>
<DimensionUsage name="Product" source="Product" foreignKey="product_id"/>
<Dimension name="Promotion Media" foreignKey="promotion_id">
<Hierarchy hasAll="true" allMemberName="All Media" primaryKey="promotion_id" defaultMember="All Media">
<Table name="promotion"/>
<Level name="Media Type" column="media_type" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Promotions" foreignKey="promotion_id">
<Hierarchy hasAll="true" allMemberName="All Promotions" primaryKey="promotion_id" defaultMember="[All Promotions]">
<Table name="promotion"/>
<Level name="Promotion Name" column="promotion_name" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Customers" foreignKey="customer_id">
<Hierarchy hasAll="true" allMemberName="All Customers" primaryKey="customer_id">
<Table name="customer"/>
<Level name="Country" column="country" uniqueMembers="true"/>
<Level name="State Province" column="state_province" uniqueMembers="true"/>
<Level name="City" column="city" uniqueMembers="false"/>
<Level name="Name" column="customer_id" type="Numeric" uniqueMembers="true">
<NameExpression>
<SQL dialect="oracle">
"fname" || ' ' || "lname"
</SQL>
<SQL dialect="access">
fname + ' ' + lname
</SQL>
<SQL dialect="postgres">
"fname" || ' ' || "lname"
</SQL>
<SQL dialect="mysql">
CONCAT(`customer`.`fname`, ' ', `customer`.`lname`)
</SQL>
<SQL dialect="mssql">
fname + ' ' + lname
</SQL>
<SQL dialect="derby">
"customer"."fullname"
</SQL>
<SQL dialect="db2">
CONCAT(CONCAT("customer"."fname", ' '), "customer"."lname")
</SQL>
<SQL dialect="luciddb">
"fname" || ' ' || "lname"
</SQL>
<SQL dialect="teradata">
"fname" || ' ' || "lname"
</SQL>
<SQL dialect="generic">
"fname"
</SQL>
</NameExpression>
<OrdinalExpression>
<SQL dialect="oracle">
"fname" || ' ' || "lname"
</SQL>
<SQL dialect="access">
fname + ' ' + lname
</SQL>
<SQL dialect="postgres">
"fname" || ' ' || "lname"
</SQL>
<SQL dialect="mysql">
CONCAT(`customer`.`fname`, ' ', `customer`.`lname`)
</SQL>
<SQL dialect="mssql">
fname + ' ' + lname
</SQL>
<SQL dialect="derby">
"customer"."fullname"
</SQL>
<SQL dialect="db2">
CONCAT(CONCAT("customer"."fname", ' '), "customer"."lname")
</SQL>
<SQL dialect="luciddb">
"fname" || ' ' || "lname"
</SQL>
<SQL dialect="generic">
"fname"
</SQL>
</OrdinalExpression>
<Property name="Gender" column="gender"/>
<Property name="Marital Status" column="marital_status"/>
<Property name="Education" column="education"/>
<Property name="Yearly Income" column="yearly_income"/>
</Level>
</Hierarchy>
</Dimension>
<Dimension name="Education Level" foreignKey="customer_id">
<Hierarchy hasAll="true" primaryKey="customer_id">
<Table name="customer"/>
<Level name="Education Level" column="education" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Gender" foreignKey="customer_id">
<Hierarchy hasAll="true" allMemberName="All Gender" primaryKey="customer_id">
<Table name="customer"/>
<Level name="Gender" column="gender" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Marital Status" foreignKey="customer_id">
<Hierarchy hasAll="true" allMemberName="All Marital Status" primaryKey="customer_id">
<Table name="customer"/>
<Level name="Marital Status" column="marital_status" uniqueMembers="true" approxRowCount="111"/>
</Hierarchy>
</Dimension>
<Dimension name="Yearly Income" foreignKey="customer_id">
<Hierarchy hasAll="true" primaryKey="customer_id">
<Table name="customer"/>
<Level name="Yearly Income" column="yearly_income" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name='Scenario' foreignKey='time_id'>
<Hierarchy primaryKey='time_id' hasAll='true'>
<InlineTable alias='_dummy'>
<ColumnDefs>
<ColumnDef name='foo' type='Numeric'/>
</ColumnDefs>
<Rows/>
</InlineTable>
<Level name='Scenario' column='foo'/>
</Hierarchy>
</Dimension>
<Measure name="Unit Sales" column="unit_sales" aggregator="sum"
formatString="Standard"/>
<Measure name="Store Cost" column="store_cost" aggregator="sum"
formatString="#,###.00"/>
<Measure name="Store Sales" column="store_sales" aggregator="sum"
formatString="#,###.00"/>
<Measure name="Sales Count" column="product_id" aggregator="count"
formatString="#,###"/>
<Measure name="Customer Count" column="customer_id"
aggregator="distinct-count" formatString="#,###"/>
<Measure name="Promotion Sales" aggregator="sum" formatString="#,###.00">
<MeasureExpression>
<SQL dialect="access">
Iif("sales_fact_1997"."promotion_id" = 0, 0, "sales_fact_1997"."store_sales")
</SQL>
<SQL dialect="oracle">
(case when "sales_fact_1997"."promotion_id" = 0 then 0 else "sales_fact_1997"."store_sales" end)
</SQL>
<SQL dialect="postgres">
(case when "sales_fact_1997"."promotion_id" = 0 then 0 else "sales_fact_1997"."store_sales" end)
</SQL>
<SQL dialect="mysql">
(case when `sales_fact_1997`.`promotion_id` = 0 then 0 else `sales_fact_1997`.`store_sales` end)
</SQL>
<!-- Workaround the fact that Infobright does not have a CASE operator.
The simpler expression gives wrong results, so some tests are
disabled. -->
<SQL dialect="infobright">
`sales_fact_1997`.`store_sales`
</SQL>
<SQL dialect="derby">
(case when "sales_fact_1997"."promotion_id" = 0 then 0 else "sales_fact_1997"."store_sales" end)
</SQL>
<SQL dialect="luciddb">
(case when "sales_fact_1997"."promotion_id" = 0 then 0 else "sales_fact_1997"."store_sales" end)
</SQL>
<SQL dialect="db2">
(case when "sales_fact_1997"."promotion_id" = 0 then 0 else "sales_fact_1997"."store_sales" end)
</SQL>
<SQL dialect="generic">
(case when "sales_fact_1997"."promotion_id" = 0 then 0 else "sales_fact_1997"."store_sales" end)
</SQL>
</MeasureExpression>
</Measure>
<CalculatedMember
name="Profit"
dimension="Measures">
<Formula>[Measures].[Store Sales] - [Measures].[Store Cost]</Formula>
<CalculatedMemberProperty name="FORMAT_STRING" value="$#,##0.00"/>
</CalculatedMember>
<CalculatedMember
name="Profit last Period"
dimension="Measures"
formula="COALESCEEMPTY((Measures.[Profit], [Time].PREVMEMBER), Measures.[Profit])"
visible="false">
<CalculatedMemberProperty name="FORMAT_STRING" value="$#,##0.00"/>
<CalculatedMemberProperty name="MEMBER_ORDINAL" value="18"/>
</CalculatedMember>
<CalculatedMember
name="Profit Growth"
dimension="Measures"
formula="([Measures].[Profit] - [Measures].[Profit last Period]) / [Measures].[Profit last Period]"
visible="true"
caption="Gewinn-Wachstum">
<CalculatedMemberProperty name="FORMAT_STRING" value="0.0%"/>
</CalculatedMember>
</Cube>
<Cube name="Warehouse">
<Table name="inventory_fact_1997"/>
<DimensionUsage name="Store" source="Store" foreignKey="store_id"/>
<DimensionUsage name="Store Size in SQFT" source="Store Size in SQFT"
foreignKey="store_id"/>
<DimensionUsage name="Store Type" source="Store Type" foreignKey="store_id"/>
<DimensionUsage name="Time" source="Time" foreignKey="time_id"/>
<DimensionUsage name="Product" source="Product" foreignKey="product_id"/>
<DimensionUsage name="Warehouse" source="Warehouse" foreignKey="warehouse_id"/>
<Measure name="Store Invoice" column="store_invoice" aggregator="sum"/>
<Measure name="Supply Time" column="supply_time" aggregator="sum"/>
<Measure name="Warehouse Cost" column="warehouse_cost" aggregator="sum"/>
<Measure name="Warehouse Sales" column="warehouse_sales" aggregator="sum"/>
<Measure name="Units Shipped" column="units_shipped" aggregator="sum" formatString="#.0"/>
<Measure name="Units Ordered" column="units_ordered" aggregator="sum" formatString="#.0"/>
<Measure name="Warehouse Profit" aggregator="sum">
<MeasureExpression>
<SQL dialect="mysql">
`warehouse_sales` - `inventory_fact_1997`.`warehouse_cost`
</SQL>
<SQL dialect="infobright">
`warehouse_sales` - `inventory_fact_1997`.`warehouse_cost`
</SQL>
<SQL dialect="generic">
"warehouse_sales" - "inventory_fact_1997"."warehouse_cost"
</SQL>
</MeasureExpression>
</Measure>
<CalculatedMember
name="Average Warehouse Sale"
dimension="Measures">
<Formula>[Measures].[Warehouse Sales] / [Measures].[Warehouse Cost]</Formula>
<CalculatedMemberProperty name="FORMAT_STRING" value="$#,##0.00"/>
</CalculatedMember>
<NamedSet name="Top Sellers">
<Formula>TopCount([Warehouse].[Warehouse Name].MEMBERS, 5, [Measures].[Warehouse Sales])</Formula>
</NamedSet>
</Cube>
<!-- Test a cube based upon a single table. -->
<Cube name="Store">
<Table name="store"/>
<!-- We could have used the shared dimension "Store Type", but we
want to test private dimensions without primary key. -->
<Dimension name="Store Type">
<Hierarchy hasAll="true">
<Level name="Store Type" column="store_type" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<!-- We don't have to specify primary key or foreign key since the shared
dimension "Store" has the same underlying table as the cube. -->
<DimensionUsage name="Store" source="Store"/>
<Dimension name="Has coffee bar">
<Hierarchy hasAll="true">
<Level name="Has coffee bar" column="coffee_bar" uniqueMembers="true"
type="Boolean"/>
</Hierarchy>
</Dimension>
<Measure name="Store Sqft" column="store_sqft" aggregator="sum"
formatString="#,###"/>
<Measure name="Grocery Sqft" column="grocery_sqft" aggregator="sum"
formatString="#,###"/>
</Cube>
<Cube name="HR">
<Table name="salary"/>
<!-- Use private "Time" dimension because key is different than public
"Time" dimension. -->
<Dimension name="Time" type="TimeDimension" foreignKey="pay_date">
<Hierarchy hasAll="false" primaryKey="the_date">
<Table name="time_by_day"/>
<Level name="Year" column="the_year" type="Numeric" uniqueMembers="true"
levelType="TimeYears"/>
<Level name="Quarter" column="quarter" uniqueMembers="false"
levelType="TimeQuarters"/>
<!-- Use the_month as source for the name, so members look like
[Time].[1997].[Q1].[Jan] rather than [Time].[1997].[Q1].[1]. -->
<Level name="Month" column="month_of_year" nameColumn="the_month"
uniqueMembers="false" type="Numeric" levelType="TimeMonths"/>
</Hierarchy>
</Dimension>
<Dimension name="Store" foreignKey="employee_id" >
<Hierarchy hasAll="true" primaryKey="employee_id"
primaryKeyTable="employee">
<Join leftKey="store_id" rightKey="store_id">
<Table name="employee"/>
<Table name="store"/>
</Join>
<Level name="Store Country" table="store" column="store_country"
uniqueMembers="true"/>
<Level name="Store State" table="store" column="store_state"
uniqueMembers="true"/>
<Level name="Store City" table="store" column="store_city"
uniqueMembers="false"/>
<Level name="Store Name" table="store" column="store_name"
uniqueMembers="true">
<Property name="Store Type" column="store_type"/>
<Property name="Store Manager" column="store_manager"/>
<Property name="Store Sqft" column="store_sqft" type="Numeric"/>
<Property name="Grocery Sqft" column="grocery_sqft" type="Numeric"/>
<Property name="Frozen Sqft" column="frozen_sqft" type="Numeric"/>
<Property name="Meat Sqft" column="meat_sqft" type="Numeric"/>
<Property name="Has coffee bar" column="coffee_bar" type="Boolean"/>
<Property name="Street address" column="store_street_address"
type="String"/>
</Level>
</Hierarchy>
</Dimension>
<Dimension name="Pay Type" foreignKey="employee_id">
<Hierarchy hasAll="true" primaryKey="employee_id"
primaryKeyTable="employee">
<Join leftKey="position_id" rightKey="position_id">
<Table name="employee"/>
<Table name="position"/>
</Join>
<Level name="Pay Type" table="position" column="pay_type"
uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Store Type" foreignKey="employee_id">
<Hierarchy hasAll="true" primaryKeyTable="employee" primaryKey="employee_id">
<Join leftKey="store_id" rightKey="store_id">
<Table name="employee"/>
<Table name="store"/>
</Join>
<Level name="Store Type" table="store" column="store_type"
uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Position" foreignKey="employee_id">
<Hierarchy hasAll="true" allMemberName="All Position"
primaryKey="employee_id">
<Table name="employee"/>
<Level name="Management Role" uniqueMembers="true"
column="management_role"/>
<Level name="Position Title" uniqueMembers="false"
column="position_title" ordinalColumn="position_id"/>
</Hierarchy>
</Dimension>
<Dimension name="Department" foreignKey="department_id">
<Hierarchy hasAll="true" primaryKey="department_id">
<Table name="department"/>
<Level name="Department Description" uniqueMembers="true"
column="department_id"/>
</Hierarchy>
</Dimension>
<Dimension name="Employees" foreignKey="employee_id">
<Hierarchy hasAll="true" allMemberName="All Employees"
primaryKey="employee_id">
<Table name="employee"/>
<Level name="Employee Id" type="Numeric" uniqueMembers="true"
column="employee_id" parentColumn="supervisor_id"
nameColumn="full_name" nullParentValue="0">
<Closure parentColumn="supervisor_id" childColumn="employee_id">
<Table name="employee_closure"/>
</Closure>
<Property name="Marital Status" column="marital_status"/>
<Property name="Position Title" column="position_title"/>
<Property name="Gender" column="gender"/>
<Property name="Salary" column="salary"/>
<Property name="Education Level" column="education_level"/>
<Property name="Management Role" column="management_role"/>
</Level>
</Hierarchy>
</Dimension>
<Measure name="Org Salary" column="salary_paid" aggregator="sum"
formatString="Currency"/>
<Measure name="Count" column="employee_id" aggregator="count"
formatString="#,#"/>
<Measure name="Number of Employees" column="employee_id"
aggregator="distinct-count" formatString="#,#"/>
<CalculatedMember name="Avg Salary" dimension="Measures"
formatString="Currency"
formula="[Measures].[Org Salary]/[Measures].[Number of Employees]"/>
</Cube>
<!-- Cube with one ragged hierarchy (otherwise the same as the "Sales"
cube). -->
<Cube name="Sales Ragged">
<Table name="sales_fact_1997">
<AggExclude name="agg_pc_10_sales_fact_1997"/>
<AggExclude name="agg_lc_10_sales_fact_1997"/>
</Table>
<Dimension name="Store" foreignKey="store_id">
<Hierarchy hasAll="true" primaryKey="store_id">
<Table name="store_ragged"/>
<Level name="Store Country" column="store_country" uniqueMembers="true"
hideMemberIf="Never"/>
<Level name="Store State" column="store_state" uniqueMembers="true"
hideMemberIf="IfParentsName"/>
<Level name="Store City" column="store_city" uniqueMembers="false"
hideMemberIf="IfBlankName"/>
<Level name="Store Name" column="store_name" uniqueMembers="true"
hideMemberIf="Never">
<Property name="Store Type" column="store_type"/>
<Property name="Store Manager" column="store_manager"/>
<Property name="Store Sqft" column="store_sqft" type="Numeric"/>
<Property name="Grocery Sqft" column="grocery_sqft" type="Numeric"/>
<Property name="Frozen Sqft" column="frozen_sqft" type="Numeric"/>
<Property name="Meat Sqft" column="meat_sqft" type="Numeric"/>
<Property name="Has coffee bar" column="coffee_bar" type="Boolean"/>
<Property name="Street address" column="store_street_address" type="String"/>
</Level>
</Hierarchy>
</Dimension>
<Dimension name="Geography" foreignKey="store_id">
<Hierarchy hasAll="true" primaryKey="store_id">
<Table name="store_ragged"/>
<Level name="Country" column="store_country" uniqueMembers="true"
hideMemberIf="Never"/>
<Level name="State" column="store_state" uniqueMembers="true"
hideMemberIf="IfParentsName"/>
<Level name="City" column="store_city" uniqueMembers="false"
hideMemberIf="IfBlankName"/>
</Hierarchy>
</Dimension>
<DimensionUsage name="Store Size in SQFT" source="Store Size in SQFT"
foreignKey="store_id"/>
<DimensionUsage name="Store Type" source="Store Type" foreignKey="store_id"/>
<DimensionUsage name="Time" source="Time" foreignKey="time_id"/>
<DimensionUsage name="Product" source="Product" foreignKey="product_id"/>
<Dimension name="Promotion Media" foreignKey="promotion_id">
<Hierarchy hasAll="true" allMemberName="All Media" primaryKey="promotion_id">
<Table name="promotion"/>
<Level name="Media Type" column="media_type" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Promotions" foreignKey="promotion_id">
<Hierarchy hasAll="true" allMemberName="All Promotions" primaryKey="promotion_id">
<Table name="promotion"/>
<Level name="Promotion Name" column="promotion_name" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Customers" foreignKey="customer_id">
<Hierarchy hasAll="true" allMemberName="All Customers" primaryKey="customer_id">
<Table name="customer"/>
<Level name="Country" column="country" uniqueMembers="true"/>
<Level name="State Province" column="state_province" uniqueMembers="true"/>
<Level name="City" column="city" uniqueMembers="false"/>
<Level name="Name" uniqueMembers="true">
<KeyExpression>
<SQL dialect="oracle">
"fname" || ' ' || "lname"
</SQL>
<SQL dialect="access">
fname + ' ' + lname
</SQL>
<SQL dialect="postgres">
"fname" || ' ' || "lname"
</SQL>
<SQL dialect="mysql">
CONCAT(`customer`.`fname`, ' ', `customer`.`lname`)
</SQL>
<SQL dialect="mssql">
fname + ' ' + lname
</SQL>
<SQL dialect="derby">
"customer"."fullname"
</SQL>
<SQL dialect="db2">
CONCAT(CONCAT("customer"."fname", ' '), "customer"."lname")
</SQL>
<SQL dialect="luciddb">
"fname" || ' ' || "lname"
</SQL>
<SQL dialect="generic">
"fname"
</SQL>
</KeyExpression>
<Property name="Gender" column="gender"/>
<Property name="Marital Status" column="marital_status"/>
<Property name="Education" column="education"/>
<Property name="Yearly Income" column="yearly_income"/>
</Level>
</Hierarchy>
</Dimension>
<Dimension name="Education Level" foreignKey="customer_id">
<Hierarchy hasAll="true" primaryKey="customer_id">
<Table name="customer"/>
<Level name="Education Level" column="education" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Gender" foreignKey="customer_id">
<Hierarchy hasAll="true" allMemberName="All Gender" primaryKey="customer_id">
<Table name="customer"/>
<Level name="Gender" column="gender" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Marital Status" foreignKey="customer_id">
<Hierarchy hasAll="true" allMemberName="All Marital Status" primaryKey="customer_id">
<Table name="customer"/>
<Level name="Marital Status" column="marital_status" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Dimension name="Yearly Income" foreignKey="customer_id">
<Hierarchy hasAll="true" primaryKey="customer_id">
<Table name="customer"/>
<Level name="Yearly Income" column="yearly_income" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Measure name="Unit Sales" column="unit_sales" aggregator="sum"
formatString="Standard"/>
<Measure name="Store Cost" column="store_cost" aggregator="sum"
formatString="#,###.00"/>
<Measure name="Store Sales" column="store_sales" aggregator="sum"
formatString="#,###.00"/>
<Measure name="Sales Count" column="product_id" aggregator="count"
formatString="#,###"/>
<Measure name="Customer Count" column="customer_id" aggregator="distinct-count"
formatString="#,###"/>
</Cube>
<!-- a simpler version of "Sales" (with MEMBER_ORDINAL-properties) -->
<Cube name="Sales 2">
<Table name="sales_fact_1997"/>
<DimensionUsage name="Time" source="Time" foreignKey="time_id"/>
<DimensionUsage name="Product" source="Product" foreignKey="product_id"/>
<Dimension name="Gender" foreignKey="customer_id">
<Hierarchy hasAll="true" allMemberName="All Gender" primaryKey="customer_id">
<Table name="customer"/>
<Level name="Gender" column="gender" uniqueMembers="true"/>
</Hierarchy>
</Dimension>
<Measure name="Sales Count" column="product_id" aggregator="count" formatString="#,###">
<CalculatedMemberProperty name="MEMBER_ORDINAL" value="1"/>
</Measure>
<Measure name="Unit Sales" column="unit_sales" aggregator="sum" formatString="Standard">
<CalculatedMemberProperty name="MEMBER_ORDINAL" value="2"/>
</Measure>
<Measure name="Store Sales" column="store_sales" aggregator="sum" formatString="#,###.00">
<CalculatedMemberProperty name="MEMBER_ORDINAL" value="3"/>
</Measure>
<Measure name="Store Cost" column="store_cost" aggregator="sum" formatString="#,###.00">
<CalculatedMemberProperty name="MEMBER_ORDINAL" value="6"/>
</Measure>
<Measure name="Customer Count" column="customer_id" aggregator="distinct-count" formatString="#,###">
<CalculatedMemberProperty name="MEMBER_ORDINAL" value="7"/>
</Measure>
<CalculatedMember
name="Profit"
dimension="Measures">
<Formula>[Measures].[Store Sales] - [Measures].[Store Cost]</Formula>
<CalculatedMemberProperty name="FORMAT_STRING" expression="Iif(([Measures].[Store Sales] - [Measures].[Store Cost]) < 10000, '|(#,##0.00 €)|style=red', '|#,##0.00 €|style=green')"/>
<CalculatedMemberProperty name="MEMBER_ORDINAL" value="4"/>
</CalculatedMember>
<CalculatedMember
name="Profit last Period"
dimension="Measures"
formula="COALESCEEMPTY((Measures.[Profit], [Time].PREVMEMBER), Measures.[Profit])"
visible="false">
<CalculatedMemberProperty name="MEMBER_ORDINAL" value="5"/>
</CalculatedMember>
</Cube>
<VirtualCube name="Warehouse and Sales" defaultMeasure="Store Sales">
<VirtualCubeDimension cubeName="Sales" name="Customers"/>
<VirtualCubeDimension cubeName="Sales" name="Education Level"/>
<VirtualCubeDimension cubeName="Sales" name="Gender"/>
<VirtualCubeDimension cubeName="Sales" name="Marital Status"/>
<VirtualCubeDimension name="Product"/>
<VirtualCubeDimension cubeName="Sales" name="Promotion Media"/>
<VirtualCubeDimension cubeName="Sales" name="Promotions"/>
<VirtualCubeDimension name="Store"/>
<VirtualCubeDimension name="Time"/>
<VirtualCubeDimension cubeName="Sales" name="Yearly Income"/>
<VirtualCubeDimension cubeName="Warehouse" name="Warehouse"/>
<VirtualCubeMeasure cubeName="Sales" name="[Measures].[Sales Count]"/>
<VirtualCubeMeasure cubeName="Sales" name="[Measures].[Store Cost]"/>
<VirtualCubeMeasure cubeName="Sales" name="[Measures].[Store Sales]"/>
<VirtualCubeMeasure cubeName="Sales" name="[Measures].[Unit Sales]"/>
<VirtualCubeMeasure cubeName="Sales" name="[Measures].[Profit]"/>
<VirtualCubeMeasure cubeName="Sales" name="[Measures].[Profit Growth]"/>
<VirtualCubeMeasure cubeName="Warehouse" name="[Measures].[Store Invoice]"/>
<VirtualCubeMeasure cubeName="Warehouse" name="[Measures].[Supply Time]"/>
<VirtualCubeMeasure cubeName="Warehouse" name="[Measures].[Units Ordered]"/>
<VirtualCubeMeasure cubeName="Warehouse" name="[Measures].[Units Shipped]"/>
<VirtualCubeMeasure cubeName="Warehouse" name="[Measures].[Warehouse Cost]"/>
<VirtualCubeMeasure cubeName="Warehouse" name="[Measures].[Warehouse Profit]"/>
<VirtualCubeMeasure cubeName="Warehouse" name="[Measures].[Warehouse Sales]"/>
<VirtualCubeMeasure cubeName="Warehouse" name="[Measures].[Average Warehouse Sale]"/>
<!--
<VirtualCubeMeasure cubeName="Sales" name="[Measures].[Store Sales Net]"/>
-->
<CalculatedMember name="Profit Per Unit Shipped" dimension="Measures">
<Formula>[Measures].[Profit] / [Measures].[Units Shipped]</Formula>
</CalculatedMember>
</VirtualCube>
<!-- A California manager can only see customers and stores in California.
They cannot drill down on Gender. -->
<Role name="California manager">
<SchemaGrant access="none">
<CubeGrant cube="Sales" access="all">
<HierarchyGrant hierarchy="[Store]" access="custom"
topLevel="[Store].[Store Country]">
<MemberGrant member="[Store].[USA].[CA]" access="all"/>
<MemberGrant member="[Store].[USA].[CA].[Los Angeles]" access="none"/>
</HierarchyGrant>
<HierarchyGrant hierarchy="[Customers]" access="custom"
topLevel="[Customers].[State Province]" bottomLevel="[Customers].[City]">
<MemberGrant member="[Customers].[USA].[CA]" access="all"/>
<MemberGrant member="[Customers].[USA].[CA].[Los Angeles]" access="none"/>
</HierarchyGrant>
<HierarchyGrant hierarchy="[Gender]" access="none"/>