Skip to content

Commit

Permalink
MONDRIAN:
Browse files Browse the repository at this point in the history
ORDER() now looks at parent values (maybe hidden).
Fix bug 631470: ORDER() can now handle tuples (resulting from CrossJoin).
Can now specify name of 'all' members; change some in FoodMart.xml.
Set evaluator context correctly when creating cells, so they get the right format.
Allow 'format_string', 'FORMAT', 'FORMAT_STRING' as synonyms for 'format'.
Fix bug 622203: testSample3 (dimension to member conversion was using DefaultMember, not CurrentMember).

[git-p4: depot-paths = "//open/mondrian/": change = 225]
  • Loading branch information
julianhyde committed Nov 3, 2002
1 parent 589a6b4 commit a99d355
Show file tree
Hide file tree
Showing 16 changed files with 1,061 additions and 370 deletions.
14 changes: 7 additions & 7 deletions demo/FoodMart.xml
Expand Up @@ -102,19 +102,19 @@ WHERE "product"."product_class_id" = "product_class"."product_class_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" primaryKey="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" primaryKey="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" primaryKey="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"/>
Expand Down Expand Up @@ -151,13 +151,13 @@ CONCAT(`customer`.`fname`, " ", `customer`.`lname`)
</Hierarchy>
</Dimension>
<Dimension name="Gender" foreignKey="customer_id">
<Hierarchy hasAll="true" primaryKey="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" primaryKey="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>
Expand All @@ -174,9 +174,9 @@ CONCAT(`customer`.`fname`, " ", `customer`.`lname`)
<Param name="expression" value="not used"/>
</Hierarchy>
</Dimension>
<Measure name="Unit Sales" column="unit_sales" aggregator="sum" formatString="#,###.00"/>
<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="#,###.##"/>
<Measure name="Store Sales" column="store_sales" aggregator="sum" formatString="#,###.00"/>
<Measure name="Sales Count" column="product_id" aggregator="count" formatString="#,###"/>
<Measure name="Store Sales Net" column="&quot;sales_fact_1997&quot;.&quot;store_sales&quot;-&quot;sales_fact_1997&quot;.&quot;store_cost&quot;" aggregator="sum" formatString="#,###.00"/>
</Cube>
Expand Down
9 changes: 3 additions & 6 deletions src/main/mondrian/olap/HierarchyBase.java
Expand Up @@ -14,7 +14,7 @@
import java.io.PrintWriter;

/**
* todo:
* Skeleton implementation for {@link Hierarchy}.
*
* @author jhyde
* @since 6 August, 2001
Expand All @@ -41,6 +41,7 @@ public abstract class HierarchyBase
protected String description;
protected LevelBase[] levels;
protected boolean hasAll;
protected String allMemberName;

// implement MdxElement
public String getUniqueName() { return uniqueName; }
Expand Down Expand Up @@ -129,12 +130,8 @@ public void childrenAccept(Visitor visitor)

public String getAllMemberName()
{
boolean alreadyPlural = name.equals("Customers") ||
name.equals("Promotions") ||
name.equals("Promotion Media");
return "All " + name + (alreadyPlural ? "" : "s");
return allMemberName;
}
}


// End HierarchyBase.java
9 changes: 9 additions & 0 deletions src/main/mondrian/olap/Mondrian.xml
Expand Up @@ -218,6 +218,15 @@ todo:
</Attribute>
<Attribute name="hasAll" type="Boolean" required="true">
<Doc>
Whether this hierarchy has an 'all' member.
</Doc>
</Attribute>
<Attribute name="allMemberName" required="false">
<Doc>
Name of the 'all' member. If this attribute is not specified,
the all member is named 'All <i>hierarchyName</i>', for
example, 'All Store'. Note that the 'all' level is always
called '(All)'.
</Doc>
</Attribute>
<Attribute name="primaryKey">
Expand Down
3 changes: 2 additions & 1 deletion src/main/mondrian/olap/Parser.cup
Expand Up @@ -1112,8 +1112,9 @@ comma_member_property_def_list_opt ::=
:}
;
member_property_def_list ::=
member_property_definition {:
member_property_definition:m {:
RESULT = new ArrayList();
RESULT.add(m);
:}
| member_property_definition:hd COMMA member_property_def_list:tl {:
RESULT = tl;
Expand Down

0 comments on commit a99d355

Please sign in to comment.