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

Wrong results when TopCount evaluated non-natively on range in slicer

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Severity: Urgent
    • Resolution: Cannot Reproduce
    • Affects Version/s: 3.4.1 GA (4.5.0 GA Suite Release)
    • Fix Version/s: None
    • Component/s: 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.
    • Sprint Team:
      Maintenance

      Description

      While using a MDX query with a DISTINCT inside a TOPCOUNT, which in turn is inside a named SET, produces wrong results. On the the other hand, if using the same TOPCOUNT directly in the SELECT, it presents the right results. This behaviour is only seen when using a Range or a set with more than one member in the WHERE clause.

      Also important, if I remove the DISTINCT from the TOPCOUNT, the results are correct.

      A simple example:

      WITH
      SET [Top Count] AS
      {
      TOPCOUNT(
      DISTINCT([Customers].[Name].Members),
      5,
      [Measures].[Unit Sales]
      )
      }
      SELECT
      [Top Count] * [Measures].[Unit Sales] on 0
      FROM [Sales]
      WHERE [Time].[1997].[Q1].[1] : [Time].[1997].[Q3].[8]

      This query should give the same results as the following one, which uses the TOPCOUNT directly in the SELECT clause:

      SELECT
      TOPCOUNT( DISTINCT( [Customers].[Name].Members), 5, [Measures].[Unit Sales]) * [Measures].[Unit Sales] on 0
      FROM [Sales]
      WHERE [Time].[1997].[Q1].[1]:[Time].[1997].[Q3].[8]

      Also, if removing the DISTINCT from the TOPCOUNT in the first query, the results are correct.

      This behaviour can be replicated using Mondrian master branch (3.4) together with the Foodmart cube which ships in Mondrain.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                upihin Uladzimir Pihin (Inactive)
                Reporter:
                pds pedro Salgueiro
              • Votes:
                1 Vote for this issue
                Watchers:
                10 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: