Pentaho Analysis - Mondrian
  1. Pentaho Analysis - Mondrian
  2. MONDRIAN-1279

VisualTotals name only applies to member name not caption

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 3.5.0 GA (4.8.0 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.
    • QA Validation Status:
      Unvalidatable

      Description

      When I pass a name for VisualTotals() it is only applied to the member.getName() not member.getCaption()

      It should be in the caption of the member in the result as well

        Activity

        Hide
        Paul Stoellberger added a comment -
        Here is a Test Case i put in VisualTotalsTest to verify this issue:

            /**
             * Test case for bug <a href="http://jira.pentaho.com/browse/MONDRIAN-1279">
             * MONDRIAN-1279, "VisualTotals name only applies to member name not caption"</a>.
             *
             * @throws java.sql.SQLException on error
             */
            public void testVisualTotalCaptionBug() throws SQLException {
                CellSet cellSet =
                    TestContext.instance().executeOlap4jQuery(
                        "select {[Measures].[Unit Sales]} on columns, "
                        + "VisualTotals("
                        + " {[Product].[Food].[Baked Goods].[Bread],"
                        + " [Product].[Food].[Baked Goods].[Bread].[Bagels],"
                        + " [Product].[Food].[Baked Goods].[Bread].[Muffins]},"
                        + " \"**Subtotal - *\") on rows "
                        + "from [Sales]");
                List<Position> positions = cellSet.getAxes().get(1).getPositions();
                Cell cell;
                Member member;

                cell = cellSet.getCell(Arrays.asList(0, 0));
                member = positions.get(0).getMembers().get(0);
                assertEquals("*Subtotal - Bread", member.getName());
                assertEquals("*Subtotal - Bread", member.getCaption());
            }
        Show
        Paul Stoellberger added a comment - Here is a Test Case i put in VisualTotalsTest to verify this issue:     /**      * Test case for bug <a href=" http://jira.pentaho.com/browse/MONDRIAN-1279 ">      * MONDRIAN-1279 , "VisualTotals name only applies to member name not caption"</a>.      *      * @throws java.sql.SQLException on error      */     public void testVisualTotalCaptionBug() throws SQLException {         CellSet cellSet =             TestContext.instance().executeOlap4jQuery(                 "select {[Measures].[Unit Sales]} on columns, "                 + "VisualTotals("                 + " {[Product].[Food].[Baked Goods].[Bread],"                 + " [Product].[Food].[Baked Goods].[Bread].[Bagels],"                 + " [Product].[Food].[Baked Goods].[Bread].[Muffins]},"                 + " \"**Subtotal - *\") on rows "                 + "from [Sales]");         List<Position> positions = cellSet.getAxes().get(1).getPositions();         Cell cell;         Member member;         cell = cellSet.getCell(Arrays.asList(0, 0));         member = positions.get(0).getMembers().get(0);         assertEquals("*Subtotal - Bread", member.getName());         assertEquals("*Subtotal - Bread", member.getCaption());     }
        Hide
        Julian Hyde added a comment -
        Agreed. This should be a nice easy fix for someone.
        Show
        Julian Hyde added a comment - Agreed. This should be a nice easy fix for someone.
        Hide
        Paul Stoellberger added a comment -
        Ok I gave it a shot: https://github.com/pentaho/mondrian/pull/28

        I'm not sure if thats the way to go, didn't know how to push the caption property change upstream in the class hierarchy. And since it was overriding already... i thought this might do it. The test case seems to work now anyhow
        Show
        Paul Stoellberger added a comment - Ok I gave it a shot: https://github.com/pentaho/mondrian/pull/28 I'm not sure if thats the way to go, didn't know how to push the caption property change upstream in the class hierarchy. And since it was overriding already... i thought this might do it. The test case seems to work now anyhow
        Hide
        Luc Boudreau added a comment -
        This contribution was merged in both master and 3.5.0 branches.
        Show
        Luc Boudreau added a comment - This contribution was merged in both master and 3.5.0 branches.
        Hide
        Luc Boudreau added a comment -
        We don't have any repro steps other than the results of the unit test in VisualTotalsTest.testVisualTotalCaptionBug(). None of our tools use visual totals. I have tried to write a MDX query to get the caption out of a VisualTotals() function call but it is not supported by MDX.



        Show
        Luc Boudreau added a comment - We don't have any repro steps other than the results of the unit test in VisualTotalsTest.testVisualTotalCaptionBug(). None of our tools use visual totals. I have tried to write a MDX query to get the caption out of a VisualTotals() function call but it is not supported by MDX.
        Show
        Brandon Bruce added a comment - I validated that the unit test passed in the current mondrian build: http://ci.pentaho.com/view/Analysis/job/mondrian-git/lastCompletedBuild/testReport/mondrian.olap.fun/VisualTotalsTest/testVisualTotalCaptionBug/

          People

          • Assignee:
            Unassigned User
            Reporter:
            Paul Stoellberger
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: