Uploaded image for project: 'Pentaho Analysis - Mondrian'
  1. Pentaho Analysis - Mondrian
  2. MONDRIAN-747

When joining a shared dimension into a cube at a level other than its leaf level, Mondrian gives wrong results.

    Details

    • Type: Bug
    • Status: Closed
    • Severity: High
    • Resolution: Cannot Reproduce
    • Affects Version/s: 3.1.6 (3.5.2 GA Suite Release)
    • Component/s: None
    • Labels:
      None
    • Notice:
      When an issue is open, the "Fix Version/s" field conveys a target, not necessarily a commitment. When an issue is closed, the "Fix Version/s" field conveys the version that the issue was fixed in.

      Description

      This is related to a customer case. The customer has tested this issue on the Foodmart DB. He has added a fact table (transformation attached).

      I observed the same behavior locally. Following are the case comments from the customer:

      ========================================================================
      I have a schema with 3 cubes (2 cubes and 1 virtual cube) and 2 shared dimensions.
      I want to use DimensionUsage - to join a shared dimension into a cube at a level other than its leaf level.
      So, in one of the cubes, I am using the following code : <DimensionUsage source="Store" level="state" name="Store" foreignKey="sales_state_province"> cf Schema2.xml attached.

      I am using foodmart data set available in mondrian demo folder (http://sourceforge.net/projects/mondrian/). I have created a transformation (ss.ktr attached) that create a new fact table named sales_fact_1997_test with the additional column sales_state_province. The aim is to have a cube with store dimension at the level of the city (leaf of the dimension) (cube1) and a second one (cube2) that use the same dimension but at diferent level (state : not the leaf). An additional requirement is the use of a virtual cube that uses this shared dimension and virtual measures that come from both cubes cube1 and cube2.

      The issues are the following one :

      1 : on the cube2
      open analyzer
      open cube2 : unexpected behaviour of analyzer : I can see the level city in my dimension store
      add the levels country and state to the cube
      add the measure unitsales2
      add the level city : it crashes with the error "java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.NullPointerException"

      2 : on the cube named virtual_cube
      open analyzer
      open virtual_cube
      add the levels country and state to the cube
      add the measure unitsales2
      add the measure unitsales1
      add the level city
      add the level product_name as column : it crashes with the error "java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.NullPointerException"

      Using the same measure and the same levels (country, state) in both cube cube1 and cube2 doesn't show the same result.
      It seems that the result from cube2 is X time bigger that cube1; X is the number of members "city" below the level "state".
      ========================================================================

      I have verified the behavior on both, JPivot and the Analyzer. The only difference in the two tools is that the JPivot does not crash due to the null pointer exception. But it does not give any output.

      I am attaching the schema and the transformation, to create/populate the "sales_fact_1997_test " table in foodmart, to the JIRA.

      1. Schema2.xml
        2 kB
        Rahul Gurjar
      2. ss.ktr
        15 kB
        Rahul Gurjar

        Issue Links

          Activity

            People

            • Assignee:
              jhyde Julian Hyde
              Reporter:
              rgurjar Rahul Gurjar (Inactive)
            • Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: