Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: Possible bug in Order() (Mondrian 3.5)

  1. #1
    Join Date
    Feb 2013
    Posts
    14

    Default Possible bug in Order() (Mondrian 3.5)

    I've been experiencing some wierd behaviour with Mondrian 3.5 and the Order() function.
    Now I've also figured out why this is happening and how to prevent/reproduce it.
    However, due to the particular nature of the issue I'd like to report my experience in order to see
    if I did something wrong or if there is indeed a problem with the Order() function.


    First of all, I'll list 3 queries that are supposed to return the same results (but they don't).
    Later on I'll describe the wrong results and what is causing them.


    All queries should to return a list of locations with the correspondent average temperature during the month 2012/08, listed in descendant order:



    Code:
    ___________________________________________________________________________________________
    Query 1: Gives EXPECTED result!
    
    
    SELECT
    NON EMPTY [Measures].[Temperatura Media] ON COLUMNS,
    NON EMPTY Order({[Filiali].[Filiale].Members},[Measures].[Temperatura Media],BDESC) ON ROWS
    FROM [Unigest Temperature]
    WHERE {[Dati].[Temperature].[Ambiente].[Temperatura Esterna]}*{[Periodo].[2012].[8]}
    ____________________________________________________________________________________________
    
    
    
    
    ___________________________________________________________________________________________
    Query 2: Gives WRONG result!
    
    
    WITH SET [AllMembers] AS {[Filiali].[Filiale].Members}
    SELECT
    NON EMPTY [Measures].[Temperatura Media] ON COLUMNS,
    NON EMPTY Order([AllMembers],[Measures].[Temperatura Media],BDESC) ON ROWS
    FROM [Unigest Temperature]
    WHERE {[Dati].[Temperature].[Ambiente].[Temperatura Esterna]}*{[Periodo].[2012].[8]}
    ____________________________________________________________________________________________
    
    
    ___________________________________________________________________________________________
    Query 3: Gives EXPECTED result!
    
    
    /*  Like Query 2 + a filter operation which should not have any effect from a logical point of view*/
    
    
    WITH SET [AllMembers] AS Filter({[Filiali].[Filiale].Members}, [Measures].[Temperatura Media]>-1000) 
    SELECT
    NON EMPTY [Measures].[Temperatura Media] ON COLUMNS,
    NON EMPTY Order([AllMembers],[Measures].[Temperatura Media],BDESC) ON ROWS
    FROM [Unigest Temperature]
    WHERE {[Dati].[Temperature].[Ambiente].[Temperatura Esterna]}*{[Periodo].[2012].[8]}
    ____________________________________________________________________________________________


    OK now I'll describe how the results are wrong:


    The first chunk of the list looks fine and correctly ordered, however at the bottom there is a chunk of apparently unsorted entries. That chunk always contains the same entries in the same order no matter how I slice the time dimension.


    After some analysis I realized that the last part contains entries whose NAME is duplicated, and they are ordered according to the ID of their first occurrence in the database table.
    I'd lilke to point out that only the NAME is duplicated, not their ID. Here's the xml schema definition of the correspondent dimension:


    Code:
        <Dimension name="Filiali">
          <Hierarchy hasAll="true" primaryKey="ID">
            <Table name="branches"/>
            <Level name="Filiale" column="ID" nameColumn="NOME" uniqueMembers="true" type="Numeric"/>
           </Hierarchy>
        </Dimension>
    Entries in "ID" column are UNIQUE, whereas entries in "NOME" column are not. If I make them unique the list is correctly sorted on all cases.
    Last edited by exeba; 03-01-2013 at 12:34 PM.

  2. #2
    Join Date
    Jan 2013
    Posts
    796

    Default

    Sounds like a bug. Any chance you could reproduce this with Foodmart and log a JIRA case?

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.