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

KB485552: Percent to Total metric with dynamic target level


Andre Moolman

Senior Consultant • MicroStrategy


When you create a percent-to-total shortcut metric on a report, you have to specify the level at which it needs to be calculated. This is selected under the “Total for each” setting:
ka04W000001IwFAQA0_0EM4W000004bAjk.png

Doing this, you select one of the attributes on the report for which the shortcut metric must calculate the % to Total for (level).  The limitation of this method is that the specified attribute must be on the report and if the user chooses to have other attribute levels, new shortcut metrics need to be defined for those.
There is another way to dynamically specify at which level the % to Total must be calculated.  This is done, based on the position of attributes that are present on the report.  By adding “{@r+1}” after the metric to be used in the calculation, you dynamically force the derived metric to be calculated at the level of the attribute that is one position to the left of the first row attribute when counting from right to left. 

ka04W000001IwFAQA0_0EM4W000004bAjl.png

Consider the example below:
On a report, there are the attributes Category, Subcategory and Brand and the metric for Revenue.  When adding the derived metric above, the % to Total will be calculated at the level of Subcategory, which is the attribute that is 1 position to the left of the lowest level attribute (Brand).  For illustration, a similar metri has been added, but it uses “{@r+2}”, which means the attribute 2 positions left of Brand, which is Category. 

ka04W000001IwFAQA0_0EM4W000004bAjm.png

Note that the r+1 metric adds up to 100% for each Subcategory (1 position to the left of Brand), whereas the r+2 metric adds up to 100% for each Category (which is 2 positions to the left of Brand)
 


Comment

0 comments

Details

Knowledge Article

Published:

June 21, 2022

Last Updated:

August 11, 2022