Commit ad48ebf1c625c949318dea9d168f79ce2a93cfca
1 parent
4a9b29d3
Exists in
master
and in
7 other branches
--no commit message
Showing
1 changed file
with
1006 additions
and
0 deletions
Show diff stats
| @@ -0,0 +1,1006 @@ | @@ -0,0 +1,1006 @@ | ||
| 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 | +<Cube name="Sales Scenario" defaultMeasure="Unit Sales"> | ||
| 338 | + <Table name="sales_fact_1997"> | ||
| 339 | +<!-- | ||
| 340 | + <AggExclude name="agg_l_03_sales_fact_1997" /> | ||
| 341 | + <AggExclude name="agg_ll_01_sales_fact_1997" /> | ||
| 342 | + <AggExclude name="agg_pl_01_sales_fact_1997" /> | ||
| 343 | + <AggExclude name="agg_l_05_sales_fact_1997" /> | ||
| 344 | +--> | ||
| 345 | + <AggExclude name="agg_c_special_sales_fact_1997" /> | ||
| 346 | +<!-- | ||
| 347 | + <AggExclude name="agg_c_14_sales_fact_1997" /> | ||
| 348 | +--> | ||
| 349 | + <AggExclude name="agg_lc_100_sales_fact_1997" /> | ||
| 350 | + <AggExclude name="agg_lc_10_sales_fact_1997" /> | ||
| 351 | + <AggExclude name="agg_pc_10_sales_fact_1997" /> | ||
| 352 | + <AggName name="agg_c_special_sales_fact_1997"> | ||
| 353 | + <AggFactCount column="FACT_COUNT"/> | ||
| 354 | + <AggIgnoreColumn column="foo"/> | ||
| 355 | + <AggIgnoreColumn column="bar"/> | ||
| 356 | + <AggForeignKey factColumn="product_id" aggColumn="PRODUCT_ID" /> | ||
| 357 | + <AggForeignKey factColumn="customer_id" aggColumn="CUSTOMER_ID" /> | ||
| 358 | + <AggForeignKey factColumn="promotion_id" aggColumn="PROMOTION_ID" /> | ||
| 359 | + <AggForeignKey factColumn="store_id" aggColumn="STORE_ID" /> | ||
| 360 | +<!-- | ||
| 361 | + <AggMeasure name="[Measures].[Avg Unit Sales]" column="UNIT_SALES_AVG"/> | ||
| 362 | +--> | ||
| 363 | + <AggMeasure name="[Measures].[Unit Sales]" column="UNIT_SALES_SUM" /> | ||
| 364 | + <AggMeasure name="[Measures].[Store Cost]" column="STORE_COST_SUM" /> | ||
| 365 | + <AggMeasure name="[Measures].[Store Sales]" column="STORE_SALES_SUM" /> | ||
| 366 | + <AggLevel name="[Time].[Year]" column="TIME_YEAR" /> | ||
| 367 | + <AggLevel name="[Time].[Quarter]" column="TIME_QUARTER" /> | ||
| 368 | + <AggLevel name="[Time].[Month]" column="TIME_MONTH" /> | ||
| 369 | + </AggName> | ||
| 370 | + </Table> | ||
| 371 | + | ||
| 372 | + <DimensionUsage name="Store" source="Store" foreignKey="store_id"/> | ||
| 373 | + <DimensionUsage name="Store Size in SQFT" source="Store Size in SQFT" | ||
| 374 | + foreignKey="store_id"/> | ||
| 375 | + <DimensionUsage name="Store Type" source="Store Type" foreignKey="store_id"/> | ||
| 376 | + <DimensionUsage name="Time" source="Time" foreignKey="time_id"/> | ||
| 377 | + <DimensionUsage name="Product" source="Product" foreignKey="product_id"/> | ||
| 378 | + <Dimension name="Promotion Media" foreignKey="promotion_id"> | ||
| 379 | + <Hierarchy hasAll="true" allMemberName="All Media" primaryKey="promotion_id" defaultMember="All Media"> | ||
| 380 | + <Table name="promotion"/> | ||
| 381 | + <Level name="Media Type" column="media_type" uniqueMembers="true"/> | ||
| 382 | + </Hierarchy> | ||
| 383 | + </Dimension> | ||
| 384 | + <Dimension name="Promotions" foreignKey="promotion_id"> | ||
| 385 | + <Hierarchy hasAll="true" allMemberName="All Promotions" primaryKey="promotion_id" defaultMember="[All Promotions]"> | ||
| 386 | + <Table name="promotion"/> | ||
| 387 | + <Level name="Promotion Name" column="promotion_name" uniqueMembers="true"/> | ||
| 388 | + </Hierarchy> | ||
| 389 | + </Dimension> | ||
| 390 | + <Dimension name="Customers" foreignKey="customer_id"> | ||
| 391 | + <Hierarchy hasAll="true" allMemberName="All Customers" primaryKey="customer_id"> | ||
| 392 | + <Table name="customer"/> | ||
| 393 | + <Level name="Country" column="country" uniqueMembers="true"/> | ||
| 394 | + <Level name="State Province" column="state_province" uniqueMembers="true"/> | ||
| 395 | + <Level name="City" column="city" uniqueMembers="false"/> | ||
| 396 | + <Level name="Name" column="customer_id" type="Numeric" uniqueMembers="true"> | ||
| 397 | + <NameExpression> | ||
| 398 | + <SQL dialect="oracle"> | ||
| 399 | +"fname" || ' ' || "lname" | ||
| 400 | + </SQL> | ||
| 401 | + <SQL dialect="access"> | ||
| 402 | +fname + ' ' + lname | ||
| 403 | + </SQL> | ||
| 404 | + <SQL dialect="postgres"> | ||
| 405 | +"fname" || ' ' || "lname" | ||
| 406 | + </SQL> | ||
| 407 | + <SQL dialect="mysql"> | ||
| 408 | +CONCAT(`customer`.`fname`, ' ', `customer`.`lname`) | ||
| 409 | + </SQL> | ||
| 410 | + <SQL dialect="mssql"> | ||
| 411 | +fname + ' ' + lname | ||
| 412 | + </SQL> | ||
| 413 | + <SQL dialect="derby"> | ||
| 414 | +"customer"."fullname" | ||
| 415 | + </SQL> | ||
| 416 | + <SQL dialect="db2"> | ||
| 417 | +CONCAT(CONCAT("customer"."fname", ' '), "customer"."lname") | ||
| 418 | + </SQL> | ||
| 419 | + <SQL dialect="luciddb"> | ||
| 420 | +"fname" || ' ' || "lname" | ||
| 421 | + </SQL> | ||
| 422 | + <SQL dialect="teradata"> | ||
| 423 | +"fname" || ' ' || "lname" | ||
| 424 | + </SQL> | ||
| 425 | + <SQL dialect="generic"> | ||
| 426 | +"fname" | ||
| 427 | + </SQL> | ||
| 428 | + </NameExpression> | ||
| 429 | + <OrdinalExpression> | ||
| 430 | + <SQL dialect="oracle"> | ||
| 431 | +"fname" || ' ' || "lname" | ||
| 432 | + </SQL> | ||
| 433 | + <SQL dialect="access"> | ||
| 434 | +fname + ' ' + lname | ||
| 435 | + </SQL> | ||
| 436 | + <SQL dialect="postgres"> | ||
| 437 | +"fname" || ' ' || "lname" | ||
| 438 | + </SQL> | ||
| 439 | + <SQL dialect="mysql"> | ||
| 440 | +CONCAT(`customer`.`fname`, ' ', `customer`.`lname`) | ||
| 441 | + </SQL> | ||
| 442 | + <SQL dialect="mssql"> | ||
| 443 | +fname + ' ' + lname | ||
| 444 | + </SQL> | ||
| 445 | + <SQL dialect="derby"> | ||
| 446 | +"customer"."fullname" | ||
| 447 | + </SQL> | ||
| 448 | + <SQL dialect="db2"> | ||
| 449 | +CONCAT(CONCAT("customer"."fname", ' '), "customer"."lname") | ||
| 450 | + </SQL> | ||
| 451 | + <SQL dialect="luciddb"> | ||
| 452 | +"fname" || ' ' || "lname" | ||
| 453 | + </SQL> | ||
| 454 | + <SQL dialect="generic"> | ||
| 455 | +"fname" | ||
| 456 | + </SQL> | ||
| 457 | + </OrdinalExpression> | ||
| 458 | + <Property name="Gender" column="gender"/> | ||
| 459 | + <Property name="Marital Status" column="marital_status"/> | ||
| 460 | + <Property name="Education" column="education"/> | ||
| 461 | + <Property name="Yearly Income" column="yearly_income"/> | ||
| 462 | + </Level> | ||
| 463 | + </Hierarchy> | ||
| 464 | + </Dimension> | ||
| 465 | + <Dimension name="Education Level" foreignKey="customer_id"> | ||
| 466 | + <Hierarchy hasAll="true" primaryKey="customer_id"> | ||
| 467 | + <Table name="customer"/> | ||
| 468 | + <Level name="Education Level" column="education" uniqueMembers="true"/> | ||
| 469 | + </Hierarchy> | ||
| 470 | + </Dimension> | ||
| 471 | + <Dimension name="Gender" foreignKey="customer_id"> | ||
| 472 | + <Hierarchy hasAll="true" allMemberName="All Gender" primaryKey="customer_id"> | ||
| 473 | + <Table name="customer"/> | ||
| 474 | + <Level name="Gender" column="gender" uniqueMembers="true"/> | ||
| 475 | + </Hierarchy> | ||
| 476 | + </Dimension> | ||
| 477 | + <Dimension name="Marital Status" foreignKey="customer_id"> | ||
| 478 | + <Hierarchy hasAll="true" allMemberName="All Marital Status" primaryKey="customer_id"> | ||
| 479 | + <Table name="customer"/> | ||
| 480 | + <Level name="Marital Status" column="marital_status" uniqueMembers="true" approxRowCount="111"/> | ||
| 481 | + </Hierarchy> | ||
| 482 | + </Dimension> | ||
| 483 | + <Dimension name="Yearly Income" foreignKey="customer_id"> | ||
| 484 | + <Hierarchy hasAll="true" primaryKey="customer_id"> | ||
| 485 | + <Table name="customer"/> | ||
| 486 | + <Level name="Yearly Income" column="yearly_income" uniqueMembers="true"/> | ||
| 487 | + </Hierarchy> | ||
| 488 | + </Dimension> | ||
| 489 | + <Dimension name='Scenario' foreignKey='time_id'> | ||
| 490 | +<Hierarchy primaryKey='time_id' hasAll='true'> | ||
| 491 | +<InlineTable alias='_dummy'> | ||
| 492 | +<ColumnDefs> | ||
| 493 | +<ColumnDef name='foo' type='Numeric'/> | ||
| 494 | +</ColumnDefs> | ||
| 495 | +<Rows/> | ||
| 496 | +</InlineTable> | ||
| 497 | +<Level name='Scenario' column='foo'/> | ||
| 498 | +</Hierarchy> | ||
| 499 | +</Dimension> | ||
| 500 | + | ||
| 501 | + <Measure name="Unit Sales" column="unit_sales" aggregator="sum" | ||
| 502 | + formatString="Standard"/> | ||
| 503 | + <Measure name="Store Cost" column="store_cost" aggregator="sum" | ||
| 504 | + formatString="#,###.00"/> | ||
| 505 | + <Measure name="Store Sales" column="store_sales" aggregator="sum" | ||
| 506 | + formatString="#,###.00"/> | ||
| 507 | + <Measure name="Sales Count" column="product_id" aggregator="count" | ||
| 508 | + formatString="#,###"/> | ||
| 509 | + <Measure name="Customer Count" column="customer_id" | ||
| 510 | + aggregator="distinct-count" formatString="#,###"/> | ||
| 511 | + <Measure name="Promotion Sales" aggregator="sum" formatString="#,###.00"> | ||
| 512 | + <MeasureExpression> | ||
| 513 | + <SQL dialect="access"> | ||
| 514 | +Iif("sales_fact_1997"."promotion_id" = 0, 0, "sales_fact_1997"."store_sales") | ||
| 515 | + </SQL> | ||
| 516 | + <SQL dialect="oracle"> | ||
| 517 | +(case when "sales_fact_1997"."promotion_id" = 0 then 0 else "sales_fact_1997"."store_sales" end) | ||
| 518 | + </SQL> | ||
| 519 | + <SQL dialect="postgres"> | ||
| 520 | +(case when "sales_fact_1997"."promotion_id" = 0 then 0 else "sales_fact_1997"."store_sales" end) | ||
| 521 | + </SQL> | ||
| 522 | + <SQL dialect="mysql"> | ||
| 523 | +(case when `sales_fact_1997`.`promotion_id` = 0 then 0 else `sales_fact_1997`.`store_sales` end) | ||
| 524 | + </SQL> | ||
| 525 | + <!-- Workaround the fact that Infobright does not have a CASE operator. | ||
| 526 | + The simpler expression gives wrong results, so some tests are | ||
| 527 | + disabled. --> | ||
| 528 | + <SQL dialect="infobright"> | ||
| 529 | +`sales_fact_1997`.`store_sales` | ||
| 530 | + </SQL> | ||
| 531 | + <SQL dialect="derby"> | ||
| 532 | +(case when "sales_fact_1997"."promotion_id" = 0 then 0 else "sales_fact_1997"."store_sales" end) | ||
| 533 | + </SQL> | ||
| 534 | + <SQL dialect="luciddb"> | ||
| 535 | +(case when "sales_fact_1997"."promotion_id" = 0 then 0 else "sales_fact_1997"."store_sales" end) | ||
| 536 | + </SQL> | ||
| 537 | + <SQL dialect="db2"> | ||
| 538 | +(case when "sales_fact_1997"."promotion_id" = 0 then 0 else "sales_fact_1997"."store_sales" end) | ||
| 539 | + </SQL> | ||
| 540 | + <SQL dialect="generic"> | ||
| 541 | +(case when "sales_fact_1997"."promotion_id" = 0 then 0 else "sales_fact_1997"."store_sales" end) | ||
| 542 | + </SQL> | ||
| 543 | + </MeasureExpression> | ||
| 544 | + </Measure> | ||
| 545 | + <CalculatedMember | ||
| 546 | + name="Profit" | ||
| 547 | + dimension="Measures"> | ||
| 548 | + <Formula>[Measures].[Store Sales] - [Measures].[Store Cost]</Formula> | ||
| 549 | + <CalculatedMemberProperty name="FORMAT_STRING" value="$#,##0.00"/> | ||
| 550 | + </CalculatedMember> | ||
| 551 | + <CalculatedMember | ||
| 552 | + name="Profit last Period" | ||
| 553 | + dimension="Measures" | ||
| 554 | + formula="COALESCEEMPTY((Measures.[Profit], [Time].PREVMEMBER), Measures.[Profit])" | ||
| 555 | + visible="false"> | ||
| 556 | + <CalculatedMemberProperty name="FORMAT_STRING" value="$#,##0.00"/> | ||
| 557 | + <CalculatedMemberProperty name="MEMBER_ORDINAL" value="18"/> | ||
| 558 | + </CalculatedMember> | ||
| 559 | + <CalculatedMember | ||
| 560 | + name="Profit Growth" | ||
| 561 | + dimension="Measures" | ||
| 562 | + formula="([Measures].[Profit] - [Measures].[Profit last Period]) / [Measures].[Profit last Period]" | ||
| 563 | + visible="true" | ||
| 564 | + caption="Gewinn-Wachstum"> | ||
| 565 | + <CalculatedMemberProperty name="FORMAT_STRING" value="0.0%"/> | ||
| 566 | + </CalculatedMember> | ||
| 567 | +</Cube> | ||
| 568 | + | ||
| 569 | +<Cube name="Warehouse"> | ||
| 570 | + <Table name="inventory_fact_1997"/> | ||
| 571 | + | ||
| 572 | + <DimensionUsage name="Store" source="Store" foreignKey="store_id"/> | ||
| 573 | + <DimensionUsage name="Store Size in SQFT" source="Store Size in SQFT" | ||
| 574 | + foreignKey="store_id"/> | ||
| 575 | + <DimensionUsage name="Store Type" source="Store Type" foreignKey="store_id"/> | ||
| 576 | + <DimensionUsage name="Time" source="Time" foreignKey="time_id"/> | ||
| 577 | + <DimensionUsage name="Product" source="Product" foreignKey="product_id"/> | ||
| 578 | + <DimensionUsage name="Warehouse" source="Warehouse" foreignKey="warehouse_id"/> | ||
| 579 | + | ||
| 580 | + <Measure name="Store Invoice" column="store_invoice" aggregator="sum"/> | ||
| 581 | + <Measure name="Supply Time" column="supply_time" aggregator="sum"/> | ||
| 582 | + <Measure name="Warehouse Cost" column="warehouse_cost" aggregator="sum"/> | ||
| 583 | + <Measure name="Warehouse Sales" column="warehouse_sales" aggregator="sum"/> | ||
| 584 | + <Measure name="Units Shipped" column="units_shipped" aggregator="sum" formatString="#.0"/> | ||
| 585 | + <Measure name="Units Ordered" column="units_ordered" aggregator="sum" formatString="#.0"/> | ||
| 586 | + <Measure name="Warehouse Profit" aggregator="sum"> | ||
| 587 | + <MeasureExpression> | ||
| 588 | + <SQL dialect="mysql"> | ||
| 589 | +`warehouse_sales` - `inventory_fact_1997`.`warehouse_cost` | ||
| 590 | + </SQL> | ||
| 591 | + <SQL dialect="infobright"> | ||
| 592 | +`warehouse_sales` - `inventory_fact_1997`.`warehouse_cost` | ||
| 593 | + </SQL> | ||
| 594 | + <SQL dialect="generic"> | ||
| 595 | +"warehouse_sales" - "inventory_fact_1997"."warehouse_cost" | ||
| 596 | + </SQL> | ||
| 597 | + </MeasureExpression> | ||
| 598 | + </Measure> | ||
| 599 | + <CalculatedMember | ||
| 600 | + name="Average Warehouse Sale" | ||
| 601 | + dimension="Measures"> | ||
| 602 | + <Formula>[Measures].[Warehouse Sales] / [Measures].[Warehouse Cost]</Formula> | ||
| 603 | + <CalculatedMemberProperty name="FORMAT_STRING" value="$#,##0.00"/> | ||
| 604 | + </CalculatedMember> | ||
| 605 | + <NamedSet name="Top Sellers"> | ||
| 606 | + <Formula>TopCount([Warehouse].[Warehouse Name].MEMBERS, 5, [Measures].[Warehouse Sales])</Formula> | ||
| 607 | + </NamedSet> | ||
| 608 | +</Cube> | ||
| 609 | + | ||
| 610 | +<!-- Test a cube based upon a single table. --> | ||
| 611 | +<Cube name="Store"> | ||
| 612 | + <Table name="store"/> | ||
| 613 | + <!-- We could have used the shared dimension "Store Type", but we | ||
| 614 | + want to test private dimensions without primary key. --> | ||
| 615 | + <Dimension name="Store Type"> | ||
| 616 | + <Hierarchy hasAll="true"> | ||
| 617 | + <Level name="Store Type" column="store_type" uniqueMembers="true"/> | ||
| 618 | + </Hierarchy> | ||
| 619 | + </Dimension> | ||
| 620 | + | ||
| 621 | + <!-- We don't have to specify primary key or foreign key since the shared | ||
| 622 | + dimension "Store" has the same underlying table as the cube. --> | ||
| 623 | + <DimensionUsage name="Store" source="Store"/> | ||
| 624 | + | ||
| 625 | + <Dimension name="Has coffee bar"> | ||
| 626 | + <Hierarchy hasAll="true"> | ||
| 627 | + <Level name="Has coffee bar" column="coffee_bar" uniqueMembers="true" | ||
| 628 | + type="Boolean"/> | ||
| 629 | + </Hierarchy> | ||
| 630 | + </Dimension> | ||
| 631 | + | ||
| 632 | + <Measure name="Store Sqft" column="store_sqft" aggregator="sum" | ||
| 633 | + formatString="#,###"/> | ||
| 634 | + <Measure name="Grocery Sqft" column="grocery_sqft" aggregator="sum" | ||
| 635 | + formatString="#,###"/> | ||
| 636 | + | ||
| 637 | +</Cube> | ||
| 638 | + | ||
| 639 | +<Cube name="HR"> | ||
| 640 | + <Table name="salary"/> | ||
| 641 | + <!-- Use private "Time" dimension because key is different than public | ||
| 642 | + "Time" dimension. --> | ||
| 643 | + <Dimension name="Time" type="TimeDimension" foreignKey="pay_date"> | ||
| 644 | + <Hierarchy hasAll="false" primaryKey="the_date"> | ||
| 645 | + <Table name="time_by_day"/> | ||
| 646 | + <Level name="Year" column="the_year" type="Numeric" uniqueMembers="true" | ||
| 647 | + levelType="TimeYears"/> | ||
| 648 | + <Level name="Quarter" column="quarter" uniqueMembers="false" | ||
| 649 | + levelType="TimeQuarters"/> | ||
| 650 | + <!-- Use the_month as source for the name, so members look like | ||
| 651 | + [Time].[1997].[Q1].[Jan] rather than [Time].[1997].[Q1].[1]. --> | ||
| 652 | + <Level name="Month" column="month_of_year" nameColumn="the_month" | ||
| 653 | + uniqueMembers="false" type="Numeric" levelType="TimeMonths"/> | ||
| 654 | + </Hierarchy> | ||
| 655 | + </Dimension> | ||
| 656 | + | ||
| 657 | + <Dimension name="Store" foreignKey="employee_id" > | ||
| 658 | + <Hierarchy hasAll="true" primaryKey="employee_id" | ||
| 659 | + primaryKeyTable="employee"> | ||
| 660 | + <Join leftKey="store_id" rightKey="store_id"> | ||
| 661 | + <Table name="employee"/> | ||
| 662 | + <Table name="store"/> | ||
| 663 | + </Join> | ||
| 664 | + <Level name="Store Country" table="store" column="store_country" | ||
| 665 | + uniqueMembers="true"/> | ||
| 666 | + <Level name="Store State" table="store" column="store_state" | ||
| 667 | + uniqueMembers="true"/> | ||
| 668 | + <Level name="Store City" table="store" column="store_city" | ||
| 669 | + uniqueMembers="false"/> | ||
| 670 | + <Level name="Store Name" table="store" column="store_name" | ||
| 671 | + uniqueMembers="true"> | ||
| 672 | + <Property name="Store Type" column="store_type"/> | ||
| 673 | + <Property name="Store Manager" column="store_manager"/> | ||
| 674 | + <Property name="Store Sqft" column="store_sqft" type="Numeric"/> | ||
| 675 | + <Property name="Grocery Sqft" column="grocery_sqft" type="Numeric"/> | ||
| 676 | + <Property name="Frozen Sqft" column="frozen_sqft" type="Numeric"/> | ||
| 677 | + <Property name="Meat Sqft" column="meat_sqft" type="Numeric"/> | ||
| 678 | + <Property name="Has coffee bar" column="coffee_bar" type="Boolean"/> | ||
| 679 | + <Property name="Street address" column="store_street_address" | ||
| 680 | + type="String"/> | ||
| 681 | + </Level> | ||
| 682 | + </Hierarchy> | ||
| 683 | + </Dimension> | ||
| 684 | + | ||
| 685 | + <Dimension name="Pay Type" foreignKey="employee_id"> | ||
| 686 | + <Hierarchy hasAll="true" primaryKey="employee_id" | ||
| 687 | + primaryKeyTable="employee"> | ||
| 688 | + <Join leftKey="position_id" rightKey="position_id"> | ||
| 689 | + <Table name="employee"/> | ||
| 690 | + <Table name="position"/> | ||
| 691 | + </Join> | ||
| 692 | + <Level name="Pay Type" table="position" column="pay_type" | ||
| 693 | + uniqueMembers="true"/> | ||
| 694 | + </Hierarchy> | ||
| 695 | + </Dimension> | ||
| 696 | + | ||
| 697 | + <Dimension name="Store Type" foreignKey="employee_id"> | ||
| 698 | + <Hierarchy hasAll="true" primaryKeyTable="employee" primaryKey="employee_id"> | ||
| 699 | + <Join leftKey="store_id" rightKey="store_id"> | ||
| 700 | + <Table name="employee"/> | ||
| 701 | + <Table name="store"/> | ||
| 702 | + </Join> | ||
| 703 | + <Level name="Store Type" table="store" column="store_type" | ||
| 704 | + uniqueMembers="true"/> | ||
| 705 | + </Hierarchy> | ||
| 706 | + </Dimension> | ||
| 707 | + | ||
| 708 | + <Dimension name="Position" foreignKey="employee_id"> | ||
| 709 | + <Hierarchy hasAll="true" allMemberName="All Position" | ||
| 710 | + primaryKey="employee_id"> | ||
| 711 | + <Table name="employee"/> | ||
| 712 | + <Level name="Management Role" uniqueMembers="true" | ||
| 713 | + column="management_role"/> | ||
| 714 | + <Level name="Position Title" uniqueMembers="false" | ||
| 715 | + column="position_title" ordinalColumn="position_id"/> | ||
| 716 | + </Hierarchy> | ||
| 717 | + </Dimension> | ||
| 718 | + | ||
| 719 | + <Dimension name="Department" foreignKey="department_id"> | ||
| 720 | + <Hierarchy hasAll="true" primaryKey="department_id"> | ||
| 721 | + <Table name="department"/> | ||
| 722 | + <Level name="Department Description" uniqueMembers="true" | ||
| 723 | + column="department_id"/> | ||
| 724 | + </Hierarchy> | ||
| 725 | + </Dimension> | ||
| 726 | + <Dimension name="Employees" foreignKey="employee_id"> | ||
| 727 | + <Hierarchy hasAll="true" allMemberName="All Employees" | ||
| 728 | + primaryKey="employee_id"> | ||
| 729 | + <Table name="employee"/> | ||
| 730 | + <Level name="Employee Id" type="Numeric" uniqueMembers="true" | ||
| 731 | + column="employee_id" parentColumn="supervisor_id" | ||
| 732 | + nameColumn="full_name" nullParentValue="0"> | ||
| 733 | + <Closure parentColumn="supervisor_id" childColumn="employee_id"> | ||
| 734 | + <Table name="employee_closure"/> | ||
| 735 | + </Closure> | ||
| 736 | + <Property name="Marital Status" column="marital_status"/> | ||
| 737 | + <Property name="Position Title" column="position_title"/> | ||
| 738 | + <Property name="Gender" column="gender"/> | ||
| 739 | + <Property name="Salary" column="salary"/> | ||
| 740 | + <Property name="Education Level" column="education_level"/> | ||
| 741 | + <Property name="Management Role" column="management_role"/> | ||
| 742 | + </Level> | ||
| 743 | + </Hierarchy> | ||
| 744 | + </Dimension> | ||
| 745 | + | ||
| 746 | + <Measure name="Org Salary" column="salary_paid" aggregator="sum" | ||
| 747 | + formatString="Currency"/> | ||
| 748 | + <Measure name="Count" column="employee_id" aggregator="count" | ||
| 749 | + formatString="#,#"/> | ||
| 750 | + <Measure name="Number of Employees" column="employee_id" | ||
| 751 | + aggregator="distinct-count" formatString="#,#"/> | ||
| 752 | + <CalculatedMember name="Avg Salary" dimension="Measures" | ||
| 753 | + formatString="Currency" | ||
| 754 | + formula="[Measures].[Org Salary]/[Measures].[Number of Employees]"/> | ||
| 755 | +</Cube> | ||
| 756 | + | ||
| 757 | +<!-- Cube with one ragged hierarchy (otherwise the same as the "Sales" | ||
| 758 | + cube). --> | ||
| 759 | +<Cube name="Sales Ragged"> | ||
| 760 | + <Table name="sales_fact_1997"> | ||
| 761 | + <AggExclude name="agg_pc_10_sales_fact_1997"/> | ||
| 762 | + <AggExclude name="agg_lc_10_sales_fact_1997"/> | ||
| 763 | + </Table> | ||
| 764 | + <Dimension name="Store" foreignKey="store_id"> | ||
| 765 | + <Hierarchy hasAll="true" primaryKey="store_id"> | ||
| 766 | + <Table name="store_ragged"/> | ||
| 767 | + <Level name="Store Country" column="store_country" uniqueMembers="true" | ||
| 768 | + hideMemberIf="Never"/> | ||
| 769 | + <Level name="Store State" column="store_state" uniqueMembers="true" | ||
| 770 | + hideMemberIf="IfParentsName"/> | ||
| 771 | + <Level name="Store City" column="store_city" uniqueMembers="false" | ||
| 772 | + hideMemberIf="IfBlankName"/> | ||
| 773 | + <Level name="Store Name" column="store_name" uniqueMembers="true" | ||
| 774 | + hideMemberIf="Never"> | ||
| 775 | + <Property name="Store Type" column="store_type"/> | ||
| 776 | + <Property name="Store Manager" column="store_manager"/> | ||
| 777 | + <Property name="Store Sqft" column="store_sqft" type="Numeric"/> | ||
| 778 | + <Property name="Grocery Sqft" column="grocery_sqft" type="Numeric"/> | ||
| 779 | + <Property name="Frozen Sqft" column="frozen_sqft" type="Numeric"/> | ||
| 780 | + <Property name="Meat Sqft" column="meat_sqft" type="Numeric"/> | ||
| 781 | + <Property name="Has coffee bar" column="coffee_bar" type="Boolean"/> | ||
| 782 | + <Property name="Street address" column="store_street_address" type="String"/> | ||
| 783 | + </Level> | ||
| 784 | + </Hierarchy> | ||
| 785 | + </Dimension> | ||
| 786 | + | ||
| 787 | + <Dimension name="Geography" foreignKey="store_id"> | ||
| 788 | + <Hierarchy hasAll="true" primaryKey="store_id"> | ||
| 789 | + <Table name="store_ragged"/> | ||
| 790 | + <Level name="Country" column="store_country" uniqueMembers="true" | ||
| 791 | + hideMemberIf="Never"/> | ||
| 792 | + <Level name="State" column="store_state" uniqueMembers="true" | ||
| 793 | + hideMemberIf="IfParentsName"/> | ||
| 794 | + <Level name="City" column="store_city" uniqueMembers="false" | ||
| 795 | + hideMemberIf="IfBlankName"/> | ||
| 796 | + </Hierarchy> | ||
| 797 | + </Dimension> | ||
| 798 | + | ||
| 799 | + <DimensionUsage name="Store Size in SQFT" source="Store Size in SQFT" | ||
| 800 | + foreignKey="store_id"/> | ||
| 801 | + <DimensionUsage name="Store Type" source="Store Type" foreignKey="store_id"/> | ||
| 802 | + <DimensionUsage name="Time" source="Time" foreignKey="time_id"/> | ||
| 803 | + <DimensionUsage name="Product" source="Product" foreignKey="product_id"/> | ||
| 804 | + <Dimension name="Promotion Media" foreignKey="promotion_id"> | ||
| 805 | + <Hierarchy hasAll="true" allMemberName="All Media" primaryKey="promotion_id"> | ||
| 806 | + <Table name="promotion"/> | ||
| 807 | + <Level name="Media Type" column="media_type" uniqueMembers="true"/> | ||
| 808 | + </Hierarchy> | ||
| 809 | + </Dimension> | ||
| 810 | + <Dimension name="Promotions" foreignKey="promotion_id"> | ||
| 811 | + <Hierarchy hasAll="true" allMemberName="All Promotions" primaryKey="promotion_id"> | ||
| 812 | + <Table name="promotion"/> | ||
| 813 | + <Level name="Promotion Name" column="promotion_name" uniqueMembers="true"/> | ||
| 814 | + </Hierarchy> | ||
| 815 | + </Dimension> | ||
| 816 | + <Dimension name="Customers" foreignKey="customer_id"> | ||
| 817 | + <Hierarchy hasAll="true" allMemberName="All Customers" primaryKey="customer_id"> | ||
| 818 | + <Table name="customer"/> | ||
| 819 | + <Level name="Country" column="country" uniqueMembers="true"/> | ||
| 820 | + <Level name="State Province" column="state_province" uniqueMembers="true"/> | ||
| 821 | + <Level name="City" column="city" uniqueMembers="false"/> | ||
| 822 | + <Level name="Name" uniqueMembers="true"> | ||
| 823 | + <KeyExpression> | ||
| 824 | + <SQL dialect="oracle"> | ||
| 825 | +"fname" || ' ' || "lname" | ||
| 826 | + </SQL> | ||
| 827 | + <SQL dialect="access"> | ||
| 828 | +fname + ' ' + lname | ||
| 829 | + </SQL> | ||
| 830 | + <SQL dialect="postgres"> | ||
| 831 | +"fname" || ' ' || "lname" | ||
| 832 | + </SQL> | ||
| 833 | + <SQL dialect="mysql"> | ||
| 834 | +CONCAT(`customer`.`fname`, ' ', `customer`.`lname`) | ||
| 835 | + </SQL> | ||
| 836 | + <SQL dialect="mssql"> | ||
| 837 | +fname + ' ' + lname | ||
| 838 | + </SQL> | ||
| 839 | + <SQL dialect="derby"> | ||
| 840 | +"customer"."fullname" | ||
| 841 | + </SQL> | ||
| 842 | + <SQL dialect="db2"> | ||
| 843 | +CONCAT(CONCAT("customer"."fname", ' '), "customer"."lname") | ||
| 844 | + </SQL> | ||
| 845 | + <SQL dialect="luciddb"> | ||
| 846 | +"fname" || ' ' || "lname" | ||
| 847 | + </SQL> | ||
| 848 | + <SQL dialect="generic"> | ||
| 849 | +"fname" | ||
| 850 | + </SQL> | ||
| 851 | + </KeyExpression> | ||
| 852 | + <Property name="Gender" column="gender"/> | ||
| 853 | + <Property name="Marital Status" column="marital_status"/> | ||
| 854 | + <Property name="Education" column="education"/> | ||
| 855 | + <Property name="Yearly Income" column="yearly_income"/> | ||
| 856 | + </Level> | ||
| 857 | + </Hierarchy> | ||
| 858 | + </Dimension> | ||
| 859 | + <Dimension name="Education Level" foreignKey="customer_id"> | ||
| 860 | + <Hierarchy hasAll="true" primaryKey="customer_id"> | ||
| 861 | + <Table name="customer"/> | ||
| 862 | + <Level name="Education Level" column="education" uniqueMembers="true"/> | ||
| 863 | + </Hierarchy> | ||
| 864 | + </Dimension> | ||
| 865 | + <Dimension name="Gender" foreignKey="customer_id"> | ||
| 866 | + <Hierarchy hasAll="true" allMemberName="All Gender" primaryKey="customer_id"> | ||
| 867 | + <Table name="customer"/> | ||
| 868 | + <Level name="Gender" column="gender" uniqueMembers="true"/> | ||
| 869 | + </Hierarchy> | ||
| 870 | + </Dimension> | ||
| 871 | + <Dimension name="Marital Status" foreignKey="customer_id"> | ||
| 872 | + <Hierarchy hasAll="true" allMemberName="All Marital Status" primaryKey="customer_id"> | ||
| 873 | + <Table name="customer"/> | ||
| 874 | + <Level name="Marital Status" column="marital_status" uniqueMembers="true"/> | ||
| 875 | + </Hierarchy> | ||
| 876 | + </Dimension> | ||
| 877 | + <Dimension name="Yearly Income" foreignKey="customer_id"> | ||
| 878 | + <Hierarchy hasAll="true" primaryKey="customer_id"> | ||
| 879 | + <Table name="customer"/> | ||
| 880 | + <Level name="Yearly Income" column="yearly_income" uniqueMembers="true"/> | ||
| 881 | + </Hierarchy> | ||
| 882 | + </Dimension> | ||
| 883 | + <Measure name="Unit Sales" column="unit_sales" aggregator="sum" | ||
| 884 | + formatString="Standard"/> | ||
| 885 | + <Measure name="Store Cost" column="store_cost" aggregator="sum" | ||
| 886 | + formatString="#,###.00"/> | ||
| 887 | + <Measure name="Store Sales" column="store_sales" aggregator="sum" | ||
| 888 | + formatString="#,###.00"/> | ||
| 889 | + <Measure name="Sales Count" column="product_id" aggregator="count" | ||
| 890 | + formatString="#,###"/> | ||
| 891 | + <Measure name="Customer Count" column="customer_id" aggregator="distinct-count" | ||
| 892 | + formatString="#,###"/> | ||
| 893 | +</Cube> | ||
| 894 | + | ||
| 895 | +<!-- a simpler version of "Sales" (with MEMBER_ORDINAL-properties) --> | ||
| 896 | +<Cube name="Sales 2"> | ||
| 897 | + <Table name="sales_fact_1997"/> | ||
| 898 | + | ||
| 899 | + <DimensionUsage name="Time" source="Time" foreignKey="time_id"/> | ||
| 900 | + <DimensionUsage name="Product" source="Product" foreignKey="product_id"/> | ||
| 901 | + | ||
| 902 | + <Dimension name="Gender" foreignKey="customer_id"> | ||
| 903 | + <Hierarchy hasAll="true" allMemberName="All Gender" primaryKey="customer_id"> | ||
| 904 | + <Table name="customer"/> | ||
| 905 | + <Level name="Gender" column="gender" uniqueMembers="true"/> | ||
| 906 | + </Hierarchy> | ||
| 907 | + </Dimension> | ||
| 908 | + | ||
| 909 | + <Measure name="Sales Count" column="product_id" aggregator="count" formatString="#,###"> | ||
| 910 | + <CalculatedMemberProperty name="MEMBER_ORDINAL" value="1"/> | ||
| 911 | + </Measure> | ||
| 912 | + | ||
| 913 | + <Measure name="Unit Sales" column="unit_sales" aggregator="sum" formatString="Standard"> | ||
| 914 | + <CalculatedMemberProperty name="MEMBER_ORDINAL" value="2"/> | ||
| 915 | + </Measure> | ||
| 916 | + | ||
| 917 | + <Measure name="Store Sales" column="store_sales" aggregator="sum" formatString="#,###.00"> | ||
| 918 | + <CalculatedMemberProperty name="MEMBER_ORDINAL" value="3"/> | ||
| 919 | + </Measure> | ||
| 920 | + | ||
| 921 | + <Measure name="Store Cost" column="store_cost" aggregator="sum" formatString="#,###.00"> | ||
| 922 | + <CalculatedMemberProperty name="MEMBER_ORDINAL" value="6"/> | ||
| 923 | + </Measure> | ||
| 924 | + | ||
| 925 | + <Measure name="Customer Count" column="customer_id" aggregator="distinct-count" formatString="#,###"> | ||
| 926 | + <CalculatedMemberProperty name="MEMBER_ORDINAL" value="7"/> | ||
| 927 | + </Measure> | ||
| 928 | + | ||
| 929 | + <CalculatedMember | ||
| 930 | + name="Profit" | ||
| 931 | + dimension="Measures"> | ||
| 932 | + <Formula>[Measures].[Store Sales] - [Measures].[Store Cost]</Formula> | ||
| 933 | +<CalculatedMemberProperty name="FORMAT_STRING" expression="Iif(([Measures].[Store Sales] - [Measures].[Store Cost]) < 10000, '|(#,##0.00 €)|style=red', '|#,##0.00 €|style=green')"/> | ||
| 934 | +<CalculatedMemberProperty name="MEMBER_ORDINAL" value="4"/> | ||
| 935 | + </CalculatedMember> | ||
| 936 | + | ||
| 937 | + <CalculatedMember | ||
| 938 | + name="Profit last Period" | ||
| 939 | + dimension="Measures" | ||
| 940 | + formula="COALESCEEMPTY((Measures.[Profit], [Time].PREVMEMBER), Measures.[Profit])" | ||
| 941 | + visible="false"> | ||
| 942 | + <CalculatedMemberProperty name="MEMBER_ORDINAL" value="5"/> | ||
| 943 | + </CalculatedMember> | ||
| 944 | +</Cube> | ||
| 945 | + | ||
| 946 | +<VirtualCube name="Warehouse and Sales" defaultMeasure="Store Sales"> | ||
| 947 | + <VirtualCubeDimension cubeName="Sales" name="Customers"/> | ||
| 948 | + <VirtualCubeDimension cubeName="Sales" name="Education Level"/> | ||
| 949 | + <VirtualCubeDimension cubeName="Sales" name="Gender"/> | ||
| 950 | + <VirtualCubeDimension cubeName="Sales" name="Marital Status"/> | ||
| 951 | + <VirtualCubeDimension name="Product"/> | ||
| 952 | + <VirtualCubeDimension cubeName="Sales" name="Promotion Media"/> | ||
| 953 | + <VirtualCubeDimension cubeName="Sales" name="Promotions"/> | ||
| 954 | + <VirtualCubeDimension name="Store"/> | ||
| 955 | + <VirtualCubeDimension name="Time"/> | ||
| 956 | + <VirtualCubeDimension cubeName="Sales" name="Yearly Income"/> | ||
| 957 | + <VirtualCubeDimension cubeName="Warehouse" name="Warehouse"/> | ||
| 958 | + <VirtualCubeMeasure cubeName="Sales" name="[Measures].[Sales Count]"/> | ||
| 959 | + <VirtualCubeMeasure cubeName="Sales" name="[Measures].[Store Cost]"/> | ||
| 960 | + <VirtualCubeMeasure cubeName="Sales" name="[Measures].[Store Sales]"/> | ||
| 961 | + <VirtualCubeMeasure cubeName="Sales" name="[Measures].[Unit Sales]"/> | ||
| 962 | + <VirtualCubeMeasure cubeName="Sales" name="[Measures].[Profit]"/> | ||
| 963 | + <VirtualCubeMeasure cubeName="Sales" name="[Measures].[Profit Growth]"/> | ||
| 964 | + <VirtualCubeMeasure cubeName="Warehouse" name="[Measures].[Store Invoice]"/> | ||
| 965 | + <VirtualCubeMeasure cubeName="Warehouse" name="[Measures].[Supply Time]"/> | ||
| 966 | + <VirtualCubeMeasure cubeName="Warehouse" name="[Measures].[Units Ordered]"/> | ||
| 967 | + <VirtualCubeMeasure cubeName="Warehouse" name="[Measures].[Units Shipped]"/> | ||
| 968 | + <VirtualCubeMeasure cubeName="Warehouse" name="[Measures].[Warehouse Cost]"/> | ||
| 969 | + <VirtualCubeMeasure cubeName="Warehouse" name="[Measures].[Warehouse Profit]"/> | ||
| 970 | + <VirtualCubeMeasure cubeName="Warehouse" name="[Measures].[Warehouse Sales]"/> | ||
| 971 | + <VirtualCubeMeasure cubeName="Warehouse" name="[Measures].[Average Warehouse Sale]"/> | ||
| 972 | + <!-- | ||
| 973 | + <VirtualCubeMeasure cubeName="Sales" name="[Measures].[Store Sales Net]"/> | ||
| 974 | + --> | ||
| 975 | + <CalculatedMember name="Profit Per Unit Shipped" dimension="Measures"> | ||
| 976 | + <Formula>[Measures].[Profit] / [Measures].[Units Shipped]</Formula> | ||
| 977 | + </CalculatedMember> | ||
| 978 | +</VirtualCube> | ||
| 979 | + | ||
| 980 | +<!-- A California manager can only see customers and stores in California. | ||
| 981 | + They cannot drill down on Gender. --> | ||
| 982 | +<Role name="California manager"> | ||
| 983 | + <SchemaGrant access="none"> | ||
| 984 | + <CubeGrant cube="Sales" access="all"> | ||
| 985 | + <HierarchyGrant hierarchy="[Store]" access="custom" | ||
| 986 | + topLevel="[Store].[Store Country]"> | ||
| 987 | + <MemberGrant member="[Store].[USA].[CA]" access="all"/> | ||
| 988 | + <MemberGrant member="[Store].[USA].[CA].[Los Angeles]" access="none"/> | ||
| 989 | + </HierarchyGrant> | ||
| 990 | + <HierarchyGrant hierarchy="[Customers]" access="custom" | ||
| 991 | + topLevel="[Customers].[State Province]" bottomLevel="[Customers].[City]"> | ||
| 992 | + <MemberGrant member="[Customers].[USA].[CA]" access="all"/> | ||
| 993 | + <MemberGrant member="[Customers].[USA].[CA].[Los Angeles]" access="none"/> | ||
| 994 | + </HierarchyGrant> | ||
| 995 | + <HierarchyGrant hierarchy="[Gender]" access="none"/> | ||
| 996 | + </CubeGrant> | ||
| 997 | + </SchemaGrant> | ||
| 998 | +</Role> | ||
| 999 | + | ||
| 1000 | +<Role name="No HR Cube"> | ||
| 1001 | + <SchemaGrant access="all"> | ||
| 1002 | + <CubeGrant cube="HR" access="none"/> | ||
| 1003 | + </SchemaGrant> | ||
| 1004 | +</Role> | ||
| 1005 | + | ||
| 1006 | +</Schema> |