Hitachi Vantara Pentaho Community Forums
Results 1 to 7 of 7

Thread: Calculated member and CellFormatter

  1. #1

    Default Calculated member and CellFormatter

    Hi!

    I've coded some CellFormatters for Mondrian in order to transform seconds in minutes or hours.
    They work very well on Static measures, but I tried to use them on calculated members (an average duration) and it's not working.
    Is CellFormatter implemented for Calculated members?
    I tried this syntax in my schema:
    Code:
    <CalculatedMember name="Duree Moyenne" dimension="Measures">
           <Formula>[Measures].[Duree] / [Measures].[Nombres]</Formula>
           <CalculatedMemberProperty name="formatter" value="my.mondrian.SecondsToMinutesFormatter"/>
    </CalculatedMember>

  2. #2

    Default

    I just forgot to tell: I'm using Pentaho 1.6.0-RC1.782 PCI (with Mondrian-2.3).

  3. #3
    Join Date
    Nov 1999
    Posts
    1,618

    Default

    Reading the code, it looks like calculated members never have a cell formatter. Here's the code, which lives in RolapHierarchy.java:

    Code:
        private static class RolapCalculatedMeasure
            extends RolapCalculatedMember
            implements RolapMeasure
        {
            public RolapCalculatedMeasure(
                RolapMember parent, RolapLevel level, String name, Formula formula) {
                super(parent, level, name, formula);
            }
    
            public CellFormatter getFormatter() {
                return null;
            }
        }
    It would be easy to lookup the formatter based on a member property. We'd also need to document in schema.html and write a unit test. Can you log a bug please?

    Julian

  4. #4

    Default

    I submit this on the afternoon (french time).

  5. #5

    Default

    I wanted to submit the new bug but I can't find Pentaho Analysis in Jira Submit form.
    I can read Analysis Archive that's all.

  6. #6

    Default

    I found the Mondrian sourceforge bug tracker and this bug was already submitted:
    http://sourceforge.net/tracker/index...02&atid=414616

  7. #7
    Join Date
    Nov 1999
    Posts
    1,618

    Default

    Fixed in change 9854; will be in mondrian-3.0. Details here:

    http://perforce.eigenbase.org:8080/o...Cell_formatter

    Julian

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.