Skip to content

Commit

Permalink
MONDRIAN: Obsolete some more monrg files;
Browse files Browse the repository at this point in the history
describe how to write an MDX query so cells change color based upon their value;
don't remove checked-in JAR files from lib on clean;
fix log4j.properties path (on Windows, the URL was incorrect).

[git-p4: depot-paths = "//open/mondrian/": change = 3394]
  • Loading branch information
julianhyde committed Mar 21, 2005
1 parent a1195f5 commit 9eb41bc
Show file tree
Hide file tree
Showing 8 changed files with 135 additions and 170 deletions.
13 changes: 4 additions & 9 deletions build.xml
Expand Up @@ -72,12 +72,6 @@ ${lib.dir}/optional.jar,
${lib.dir}/xalan.jar,
${lib.dir}/xercesImpl.jar,
${lib.dir}/xml-apis.jar,
${lib.dir}/servlet.jar,
${lib.dir}/jsp-api.jar,
${lib.dir}/commons-collections.jar,
${lib.dir}/commons-dbcp.jar,
${lib.dir}/commons-pool.jar,
${testlib.dir}/junit.jar,
demo/FoodMartCreateData.sql"/>

<path id="project.classpath">
Expand Down Expand Up @@ -266,7 +260,8 @@ unzip-FoodMartCreateData"/>

<!-- Before you run it, you will need to set the
"mondrian.jdbcDrivers", "mondrian.foodmart.jdbcURL", and
"mondrian.foodmart.catalogURL" properties. -->
"mondrian.foodmart.catalogURL" properties. The easiest way to
do this is to edit the file "build.properties". -->

<target name="FoodMartTest"
description="Runs a few queries using the FoodMart schema.">
Expand All @@ -279,7 +274,7 @@ unzip-FoodMartCreateData"/>
value="${mondrian.foodmart.catalogURL}"/>

<!-- mondrian.test.connectString is the mondrian connect-string.
Provider must be 'mondrian'. Jdbc is the Catalog is the -->
Provider must be 'mondrian'. -->
<sysproperty key="mondrian.test.connectString"
value="Provider=mondrian;Jdbc='${mondrian.foodmart.jdbcURL}';Catalog='${mondrian.foodmart.catalogURL}';JdbcUser='${mondrian.foodmart.jdbcUser}';JdbcPassword='${mondrian.foodmart.jdbcPassword}'"/>

Expand Down Expand Up @@ -324,7 +319,7 @@ in {mondrian.foodmart.jdbcURL}.">
</classpath>

<sysproperty key="log4j.configuration"
value="file://${project.location}/log4j.properties"/>
value="log4j.properties"/>
<sysproperty key="mondrian.jdbcDrivers"
value="${mondrian.jdbcDrivers}"/>
<sysproperty key="mondrian.test.connectString"
Expand Down
50 changes: 0 additions & 50 deletions demo/monrg/build.xml

This file was deleted.

26 changes: 0 additions & 26 deletions demo/monrg/source/Birthday.java

This file was deleted.

13 changes: 0 additions & 13 deletions demo/monrg/source/happy/BirthdayResource.xml

This file was deleted.

3 changes: 0 additions & 3 deletions demo/monrg/source/happy/BirthdayResource_fr_FR.properties

This file was deleted.

59 changes: 59 additions & 0 deletions doc/mdx.html
Expand Up @@ -79,6 +79,65 @@ <h3>Parameters</h3>
<p>Pseudo-functions <code>Param()</code> and <code>ParamRef()</code> allow
you to create parameterized MDX statements.</p>

<h2><a name="Format_strings">Format strings</a></h2><p>Every member has a
FORMAT_STRING property, which affects how its raw value is rendered into text in
the user interface. For example, the query</p>

<blockquote>

<p><code>WITH MEMBER [Measures].[Profit] AS '([Measures].[Store Sales] - [Measures].[Store Cost])',<br>
&nbsp;&nbsp;FORMAT_STRING = &quot;$#,###.00&quot;<br/>
SELECT {[Measures].[Store Sales], [Measures].[Profit]} ON COLUMNS,<br/>
&nbsp;&nbsp;{[Product].CurrentMember.Children} ON ROWS<br/>
FROM [Sales]</code></p>
</blockquote>

<p>yields cells formatted in dollar and cent amounts.</p>

<p>Members defined in a schema file can also have format strings. Measures use
the <code>formatString</code> attribute:</p>

<blockquote>

<p><code>&lt;Measure name=&quot;Store Sales&quot; column=&quot;store_sales&quot; aggregator=&quot;sum&quot;
formatString=&quot;#,###.00&quot;/&gt;</code></p>
</blockquote>

<p>and calculated members use the <code>&lt;CalculatedMemberProperty&gt;</code>
sub-element:</p>

<blockquote>

<p><code>&lt;CalculatedMember name=&quot;Profit&quot; dimension=&quot;Measures&quot; formula=&quot;[Measures].[Store
Sales] - [Measures].[Store Cost]&quot;&gt;<br>
&nbsp; &lt;CalculatedMemberProperty name=&quot;FORMAT_STRING&quot; value=&quot;$#,##0.00&quot;/&gt;<br>
&lt;/CalculatedMember&gt;</code></p>
</blockquote>

<p>Format strings use Visual Basic formatting syntax; see
<a href="http://mondrian.sourceforge.net/api/mondrian/olap/Format.html">class
mondrian.olap.Format</a> for more details.</p>

<p>A measure's format string is usually a fixed string, but is really
an expression, which is evaluated in the same context as the cell. You can
therefore change the formatting of a cell depending upon the cell's value.</p>

<p>The format string can even contain 'style' attributes which are interpreted
specially by JPivot. If present, JPivot will render cells in color.

<p>The following example combines a dynamic formula with style attributes. The
result is that cells are displayed with green background if they are less than
$100,000, or a red background if they are greater than $100,000:<blockquote>
<code>WITH MEMBER [Measures].[Profit] AS<br/>
&nbsp;
&nbsp;&nbsp;'([Measures].[Store Sales] - [Measures].[Store Cost])',<br>
&nbsp;&nbsp;&nbsp;FORMAT_STRING = Iif([Measures].[Profit] < 100000, '|#|style=green', '|#|style=red')<br/>
SELECT {[Measures].[Store Sales], [Measures].[Profit]} ON COLUMNS,<br/>
&nbsp;&nbsp;{[Product].CurrentMember.Children} ON ROWS<br/>
FROM [Sales]</code></blockquote>

</p>

<h2>Function list</h2>

<p>These are the functions implemented in the current Mondrian release.</p>
Expand Down

0 comments on commit 9eb41bc

Please sign in to comment.