Skip to content

Commit

Permalink
MONDRIAN: Integrate from //open/mondrian/release/2 to //open/mondrian…
Browse files Browse the repository at this point in the history
… up to change 5418.

[git-p4: depot-paths = "//open/mondrian/": change = 5419]
  • Loading branch information
julianhyde committed Feb 13, 2006
1 parent 9a688e5 commit 14a4f66
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/mondrian/rolap/RolapEvaluator.java
Expand Up @@ -453,6 +453,9 @@ String getFormatString() {
}
Calc formatCalc = root.getCompiled(formatExp, true);
Object o = formatCalc.evaluate(this);
if (o == null) {
return "Standard";
}
return o.toString();
}

Expand Down
35 changes: 35 additions & 0 deletions testsrc/main/mondrian/test/TestCalculatedMembers.java
Expand Up @@ -388,6 +388,41 @@ public void testBracketInCalcMemberName() {
"Row #0: Unit Sales" + nl);
}

/**
* Tests that IIf works OK even if its argument returns the NULL
* value. (Bug 1418689.)
*/
public void testNpeInIif() {
assertQueryReturns(
fold(new String[] {
"WITH MEMBER [Measures].[Foo] AS ' 1 / [Measures].[Unit Sales] ',",
" FORMAT_STRING=IIf([Measures].[Foo] < .3, \"|0.0|style=red\",\"0.0\")",
"SELECT {[Store].[USA].[WA].children} on columns",
"FROM Sales",
"WHERE ( [Time].[1997].[Q4].[12],",
" [Product].[All Products].[Drink].[Alcoholic Beverages].[Beer and Wine].[Beer].[Portsmouth].[Portsmouth Imported Beer],",
" [Measures].[Foo])"}),
fold(new String[] {
"Axis #0:",
"{[Time].[1997].[Q4].[12], [Product].[All Products].[Drink].[Alcoholic Beverages].[Beer and Wine].[Beer].[Portsmouth].[Portsmouth Imported Beer], [Measures].[Foo]}",
"Axis #1:",
"{[Store].[All Stores].[USA].[WA].[Bellingham]}",
"{[Store].[All Stores].[USA].[WA].[Bremerton]}",
"{[Store].[All Stores].[USA].[WA].[Seattle]}",
"{[Store].[All Stores].[USA].[WA].[Spokane]}",
"{[Store].[All Stores].[USA].[WA].[Tacoma]}",
"{[Store].[All Stores].[USA].[WA].[Walla Walla]}",
"{[Store].[All Stores].[USA].[WA].[Yakima]}",
"Row #0: (null)",
"Row #0: (null)",
"Row #0: 0.5",
"Row #0: (null)",
"Row #0: |0.1|style=red",
"Row #0: (null)",
"Row #0: |0.2|style=red",
""}));
}

/**
* Tests that calculated members defined in the schema can have brackets in
* their names. (Bug 1251683.)
Expand Down

0 comments on commit 14a4f66

Please sign in to comment.