EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics

KB32415: How to sort by metric subtotals and attribute elements together, while ignoring the row-level metric values in MicroStrategy


Stefan Zepeda

Salesforce Solutions Architect • Strategy


This article describes how to sort metric subtotals and elements together while ignoring row level metric values.

SYMPTOM:
Users may observer that when creating a report that contains advance sorting with a metric that contains subtotals the report results appear to be only sorted by the metric values specified. Even if a sort is specified for the attribute elements on the report, the results in the report appear as if the attribute sort was not defined.
In the screenshot below, the results for a report are shown where the Advance Sorting option 'Sort metrics hierarchically using: Total' is selected. For this report, a second sort is defined on the Customer Gender - 'DESC' form, users would notice that the ordering of the this attribute is not consistent:
 

ka02R000000kX48QAE_0EM440000002EBu.jpeg

 
The sort definition for the report is shown below:

ka02R000000kX48QAE_0EM440000002EBs.jpeg

 
CAUSE:
When the option to 'Sort metrics hierarchically using: Total' option is selected, the Strategy Engine first sorts the results based on the Total values, and then sorts the non-total metric values within each total. Because the sort order for the non-total metric values has a higher precedence than the attribute form sort defined, the results are displayed as observed above.
An underlying problem with the current product design is there is no way to inform the Strategy Engine that a sort for the non-total metric values is not desired, even though such a sort is indeed possible.
 
ACTION:
This is the behavior expected for metric sorting as any metric sort will sort for all rows with a metric value
 
WORKAROUND:
To allow sorting on the attribute elements after sorting by the metric total value, users may follow the steps below:

  •  Create a level derived metric to calculate on the attribute level at which the subtotal is calculated.
ka02R000000kX48QAE_0EM440000002EBX.jpeg
  •  Add the derived metric to the report and hide it by setting the column width to 0.
ka02R000000kX48QAE_0EM440000002EC1.jpeg
  • Define the advance sort on the derived metric and then sort on Gender DESC.
ka02R000000kX48QAE_0EM440000002EBr.jpeg
  •  
       * Make sure that the derived metric has to be on the view template to make sorting work.

The final report with the correct sorting of the attribute is shown below:

ka02R000000kX48QAE_0EM440000002EBw.jpeg

 


Comment

0 comments

Details

Knowledge Article

Published:

April 10, 2017

Last Updated:

April 10, 2017