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

KB18705: How to create a custom subtotal to display the grand total of a metric that uses the 'End on hand' metric in MicroStrategy Developer 9.4.x-10.x


Stefan Zepeda

Salesforce Solutions Architect • Strategy


This KB article explains how to calculate a subtotal of an inventory across an attribute based on time

SYMPTOM:
Users might want to create a grand total of an inventory metric based on the 'End on hand' metric. 'Last' is the function used to calculate subtotals for 'End on hand' metrics as mentioned in the following Strategy Knowledge Base article:
KB9666: How to create a custom subtotal using the “Last” function to display the Subtotal for an 'End on hand' metric in MicroStrategy Desktop
When including grand totals in a report, the 'Last' function will be used showing an incorrect number in the report, as shown below:

ka04W000001Ir5JQAS_0EM440000002VAf.jpeg

 
CAUSE:
The total will be calculated using the same 'Last' function which will select a value from all the subtotals calculated in the report. To calculate a subtotal of the inventory across an attribute based on time, the correct function is 'Last'. However, if the attribute is not based on time, the correct behavior will be the sum of all the subtotals.
 
ACTION:
To obtain the correct grand total of an inventory metric, users will have to create a subtotal based from an auxiliary metric, as described below:

  • Create a subtotal based on the 'Last' function, as shown below:
ka04W000001Ir5JQAS_0EM440000002b4P.png
  • Use the subtotal created on the 'End on Hand' metric in the report, as shown below:
ka04W000001Ir5JQAS_0EM440000002b4U.png
  • Create an auxiliary metric that uses the 'End on hand' fact but aggregates values one level higher than the one in the report, as shown below:
ka04W000001Ir5JQAS_0EM440000002b4Z.png
ka04W000001Ir5JQAS_0EM440000002b4e.png
  • Create a subtotal based on the auxiliary metric, as shown below:
ka04W000001Ir5JQAS_0EM440000002b4j.png
  • Add this new subtotal to the list of available subtotals for the 'End on Hand' metric.
  • Include the auxiliary metric in the report, as shown below:
ka04W000001Ir5JQAS_0EM440000002b4o.png
  • Create a new custom subtotal, as shown below:
ka04W000001Ir5JQAS_0EM440000002VAh.jpeg
ka04W000001Ir5JQAS_0EM440000002b4t.png

This will generate a report with the sum of all the 'End on hand' across subcategory, as shown below:

ka04W000001Ir5JQAS_0EM440000002b4y.png

 
To hide the auxiliary metric, in the grid options menu from the Columns and Rows tab, change the selection to fixed, as shown below:

ka04W000001Ir5JQAS_0EM440000002VAj.jpeg
ka04W000001Ir5JQAS_0EM440000002b53.png

 


Comment

0 comments

Details

Knowledge Article

Published:

July 17, 2017

Last Updated:

July 17, 2017