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

KB16881: How to create an adaptive metric that will calculate different metrics based on the DESC attribute form of an attribute in MicroStrategy Developer 9.x


Stefan Zepeda

Salesforce Solutions Architect • Strategy


How to create an adaptive metric that will calculate different metrics based on the DESC attribute form of an attribute in MicroStrategy Developer 9.x

Consider the following scenario using the Strategy Tutorial project. A user wants to calculate the 'Revenue' value when the attribute 'Category' displays the value 'Books' but wants to display the 'Profit' value when Category displays any other value.
 
The user must create an adaptive metric that decides which metric to apply depending on the value of the attribute. To achieve this, follow the steps below:
 

  • Create a metric with the following definition:
     
ka02R000000kcZMQAY_0EM440000002F5z.jpeg
  •  
    Max(Category@DESC) {~, Category}
  • Save this metric as M1.
  • Create a new metric with the following definition and save it:
     
ka02R000000kcZMQAY_0EM440000002F5x.jpeg
  •  
    Case(( = "Books"), Revenue, ( <> "Books"), Profit)
  • Add it to the report. Notice that the 'case statement' metric calculates the Revenue value when the attribute 'Category' displays 'Books' and calculates the 'Profit' value for any other elements of 'Category', as shown below:
ka02R000000kcZMQAY_0EM440000002F64.jpeg

For more information on adaptive metrics, refer to the following Strategy Knowledge Base technical note:
 
KB11067 (KB5200-75x-0459): What is an adaptive metric in Strategy?
 


Comment

0 comments

Details

Knowledge Article

Published:

April 12, 2017

Last Updated:

April 12, 2017