[Mondrian] Truncate decimal places in a measure aggregation

Julian Hyde jhyde at pentaho.com
Fri Aug 7 13:56:42 EDT 2009

I don't think you can achieve this using formatting alone. I think you need
to calculate a new measure.
Analysis Services has a Floor function (inherited from Excel) but it is not
implemented in Mondrian. So we can achieve the behavior using Round.
(Formula is a bit more complicated if [Dias] can be negative. Exercise for
the reader.)
<CalculatedMember name="Floor Dias" dimension="Measures">
    <Formula>Round([Measures].[Dias] - 0.5)</Formula>
Someone could contribute the Floor function. Code changes would be required
to Excel.java and ExcelTest.java.


From: mondrian-bounces at pentaho.org [mailto:mondrian-bounces at pentaho.org] On
Behalf Of Eduardo Andrade
Sent: Friday, August 07, 2009 9:15 AM
To: Mondrian Mailing List
Subject: [Mondrian] Truncate decimal places in a measure aggregation

Hello guys,
I'm here knocking with my head and I can't get the result that I want. I've
searched on the xml_Schema page, the mondrian-2.2.2-technical-guide.pdf, and
on the forums, but failed to find an anser to my question.

Is it possible to format a measure truncating decimal places to its
aggregated value in the mondrian xml definition ?

Example :
I've got the measure :
    <Measure column="IPAPERIODOCALC" name="Dias" aggregator="sum"

And the sum is 134.87.
What I would like to show is 134 only, but it shows 135.

Does anyone knows if it is possible to do this ?

Thank you.

Eduardo Andrade
eduardofandrade at gmail.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pentaho.org/pipermail/mondrian/attachments/20090807/c5a6eb4b/attachment.html 

More information about the Mondrian mailing list