Obviously you need to filter out the rows before you sum them, not after.
(After you have summed, say, all of the sales in a particular year and
region, the total will obviously be large, even though many of the
contributing cells might be <4.)

In cases such as this, you need to do the filtering in SQL, viz:

<Measure name="Quantity" datatype="Integer" aggregator="sum" visible="true">
<SQL dialect="generic">
case when quantity > 4 then quantity else null end


PS Please send future emails to mondrian (AT) pentaho (DOT) org. The
mondrian-devel (AT) lists (DOT) sourceforge.net list is obsolete.


From: Anderson C. Carniel [mailto:anderson_lp789 (AT) hotmail (DOT) com]
Sent: Wednesday, March 02, 2011 5:24 AM
To: mondrian-devel-owner (AT) lists (DOT) sourceforge.net
Subject: Filtering measure values


I would like to aggregate the sum of revenue and filter the measure
value, e.g., where quantity>4, following this description:

<Measure name="Quantity" column="quantity" datatype="Integer"
aggregator="sum" visible="true">
<Measure name="Revenue" column="revenue" datatype="Numeric"
aggregator="sum" visible="true">

Using SQL, I would simply issue: select sum(revenue) from table where
quantity > 4;

However, how could I perform such filter using MDX?



Mondrian mailing list
Mondrian (AT) pentaho (DOT) org