Skip to content

Commit

Permalink
MONDRIAN: Cleanup FoodMart.xml: eliminate 'Has bought dairy' dimensio…
Browse files Browse the repository at this point in the history
…n and unused 'table' parameter to <Property> elements.

[git-p4: depot-paths = "//open/mondrian/": change = 2117]
  • Loading branch information
julianhyde committed Jun 11, 2004
1 parent 3042001 commit b21961b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 45 deletions.
22 changes: 8 additions & 14 deletions demo/FoodMart.xml
Expand Up @@ -173,12 +173,6 @@ CONCAT(`customer`.`fname`, ' ', `customer`.`lname`)
</Hierarchy>
</Dimension>

<Dimension name="Has bought dairy">
<Hierarchy hasAll="true" memberReaderClass="mondrian.rolap.HasBoughtDairySource">
<Level name="Has bought dairy" uniqueMembers="true"/>
<Param name="expression" value="not used"/>
</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"/>
Expand Down Expand Up @@ -257,14 +251,14 @@ CONCAT(`customer`.`fname`, ' ', `customer`.`lname`)
<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" table="store" column="store_type"/>
<Property name="Store Manager" table="store" column="store_manager"/>
<Property name="Store Sqft" table="store" column="store_sqft" type="Numeric"/>
<Property name="Grocery Sqft" table="store" column="grocery_sqft" type="Numeric"/>
<Property name="Frozen Sqft" table="store" column="frozen_sqft" type="Numeric"/>
<Property name="Meat Sqft" table="store" column="meat_sqft" type="Numeric"/>
<Property name="Has coffee bar" table="store" column="coffee_bar" type="Boolean"/>
<Property name="Street address" table="store" column="store_street_address" type="String"/>
<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>
Expand Down
8 changes: 0 additions & 8 deletions testsrc/main/mondrian/test/BasicQueryTest.java
Expand Up @@ -661,14 +661,6 @@ public void _testDairy() {
"from Sales\r\n", null);
}

public void testHasBoughtDairy() {
Util.discard(runQuery(
"select {[Has bought dairy].members} on columns," + nl +
" {[Customers].[USA]} on rows" + nl +
"from Sales" + nl +
"where ([Measures].[Unit Sales])"));
}

public void testSolveOrder() {
runQueryCheckResult(
"WITH" + nl +
Expand Down
30 changes: 7 additions & 23 deletions webapp/adhoc.jsp
Expand Up @@ -86,12 +86,6 @@
"from Sales\r\n",
// #10
"select {[Has bought dairy].members} on columns," + nl +
" {[Customers].[USA]} on rows" + nl +
"from Sales" + nl +
"where ([Measures].[Unit Sales])",
// #11
"WITH" + nl +
" MEMBER [Measures].[StoreType] AS " + nl +
" '[Store].CurrentMember.Properties(\"Store Type\")'," + nl +
Expand All @@ -105,7 +99,7 @@
" [Measures].[ProfitPct] } ON ROWS" + nl +
"FROM Sales",
// #12
// #11
"WITH" + nl +
" MEMBER [Product].[All Products].[Drink].[Alcoholic Beverages].[Beer and Wine].[BigSeller] AS" + nl +
" 'IIf([Product].[All Products].[Drink].[Alcoholic Beverages].[Beer and Wine] > 100, \"Yes\",\"No\")'" + nl +
Expand All @@ -114,7 +108,7 @@
" {Store.[Store Name].Members} ON ROWS" + nl +
"FROM Sales",
// #13
// #12
"WITH" + nl +
" MEMBER [Measures].[ProfitPct] AS " + nl +
" 'Val((Measures.[Store Sales] - Measures.[Store Cost]) / Measures.[Store Sales])'," + nl +
Expand All @@ -128,7 +122,7 @@
" [Measures].[ProfitPct] } ON ROWS" + nl +
"FROM Sales",
// #14: cyclical calculated members
// #13: cyclical calculated members
"WITH" + nl +
" MEMBER [Product].[X] AS '[Product].[Y]'" + nl +
" MEMBER [Product].[Y] AS '[Product].[X]'" + nl +
Expand All @@ -137,7 +131,7 @@
" {Store.[Store Name].Members} ON ROWS" + nl +
"FROM Sales",
// #15
// #14
"WITH MEMBER MEASURES.ProfitPercent AS" + nl +
" '([Measures].[Store Sales]-[Measures].[Store Cost])/([Measures].[Store Cost])'," + nl +
" FORMAT_STRING = '#.00%', SOLVE_ORDER = 1" + nl +
Expand All @@ -150,31 +144,21 @@
" FROM [Sales]" + nl +
" WHERE ([Measures].[ProfitPercent])",
// #16 (= mdx sample #7, but uses virtual cube)
// #15 (= mdx sample #7, but uses virtual cube)
"with member [Measures].[Accumulated Sales] as 'Sum(YTD(),[Measures].[Store Sales])'" + nl +
"select" + nl +
" {[Measures].[Store Sales],[Measures].[Accumulated Sales]} on columns," + nl +
" {Descendants([Time].[1997],[Time].[Month])} on rows" + nl +
"from [Warehouse and Sales]",
// #17 Virtual cube. Note that Unit Sales is independent of Warehouse.
// #16 Virtual cube. Note that Unit Sales is independent of Warehouse.
"select CrossJoin(\r\n"+
" {[Warehouse].DefaultMember, [Warehouse].[USA].children}," + nl +
" {[Measures].[Unit Sales], [Measures].[Units Shipped]}) on columns," + nl +
" [Time].children on rows" + nl +
"from [Warehouse and Sales]",
// #18 bug: should allow dimension to be used as shorthand for member
"select {[Measures].[Unit Sales]} on columns," + nl +
" {[Store], [Store].children} on rows" + nl +
"from [Sales]",
// #19 bug: should allow 'members(n)' (and do it efficiently)
"select {[Measures].[Unit Sales]} on columns," + nl +
" {[Customers].members} on rows" + nl +
"from [Sales]",
// #20 crossjoins on rows and columns, and a slicer
// #17 crossjoins on rows and columns, and a slicer
"select" + nl +
" CrossJoin(" + nl +
" {[Measures].[Unit Sales], [Measures].[Store Sales]}," + nl +
Expand Down

0 comments on commit b21961b

Please sign in to comment.