Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: Please help

  1. #1
    Join Date
    Sep 2007
    Posts
    17

    Post Please help

    Hello Friends,
    I want to format a calculated measure in my mondrian schema.In my calculated measure I am getting total seconds I want to convert that total time into days,hours,minutes,seconds format.......please help.Im able to do it for measure but not for calculated measure.

    Thanks In Advance,
    Sarath.

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

    Default

    How did you manage to do it for a measure? Did you use a format string? I'm not sure that you are able to apply a date/time format string to integer values, but if you succeeded, great!

    If you aren't able to get this to work using a format string, try using a custom formatter class. You can easily convert a seconds value into a timestamp value, then apply java.text.DateFormat to it.

    Here's a calculated member defined in a cube with a custom formatter:

    Code:
    <CalculatedMember
        name="Profit Formatted"
        dimension="Measures"
        formula="[Measures].[Store Sales]-[Measures].[Store Cost]">
      <CalculatedMemberProperty name="CELL_FORMATTER"
           value="mondrian.test.FooBarCellFormatter"/>
    </CalculatedMember>
    See also http://mondrian.pentaho.org/document...ulated_members

    Julian

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

    Default

    PS Just checked the source code. Looks like support for properties of calculated members in the schema was only added in change 9854 - that is, after mondrian 2.4.2 was released. If you want these, you'll have to build from source or wait for 3.0.

    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.