US and Worldwide: +1 (866) 660-7555
Results 1 to 4 of 4

Thread: How to handle parameters in CalculatedMember

  1. #1

    Default How to handle parameters in CalculatedMember

    Hi Julian Hyde.
    Can you give me an example of like managing parameters received by the user and these can be part of a calculated member or statement MDX (<CalculatedMember name="" dimension="Measures", ...) to execute an operation with those data.
    I check the example the UserDefinedFunction (PlusOneUdf) but it throws me the following error:
    Mondrian Error:No function matches signature 'PlusOne(<Member>)'
    In the statement MDX
    WITH MEMBER [Measures].[Unit Sales Plus One]
    AS 'PlusOne([Measures].[Unit Sales])'
    SELECT
    {[Measures].[Unit Sales]} ON COLUMNS,
    {[Gender].MEMBERS} ON ROWS
    FROM [Sales]
    En the file xml I have:
    <UserDefinedFunction name="PlusOne" class="com.acme.PlusOneUdf"/>
    <CalculatedMember name="PlusOne" dimension="Measures" formula="PlusOne([Measures].[unit_sales])">
    <CalculatedMemberProperty name="FORMAT_STRING" value="$#,###.##"/>
    </CalculatedMember>
    In the file .java (PlusOneUdf.java) implements UserDefinedFunction and import the follow:
    import mondrian.olap.*;
    import mondrian.olap.type.*;
    import mondrian.spi.UserDefinedFunction;
    Thank you, very much.

  2. #2

    Default RE: How to handle parameters in CalculatedMem

    Hi. I change the position the the function UserDefinedFunction and CalculatedMember until last the code the file xml (before </Schema>) and throw me the follow error:
    javax.servlet.ServletException: javax.servlet.jsp.JspException: javax.servlet.jsp.JspException: Mondrian Error:Failed to load user-defined function 'PlusOne': class 'com.acme.PlusOneUdf' not found
    mondrian.olap.MondrianException: Mondrian Error:Failed to load user-defined function 'PlusOne': class 'com.acme.PlusOneUdf' not found
    Please, help me. Thank yoy

  3. #3
    Join Date
    Sep 2002
    Posts
    475

    Default RE: How to handle parameters in CalculatedMem

    It looks like the class is not on the classpath.
    Sherman

  4. #4

    Default RE: How to handle parameters in CalculatedMem

    I change the path of the class and it's run correctly.
    Thank you very much.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •