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

KB41691: How to create a metric that counts the unique combinations of two attributes in MicroStrategy 9.4.1 and 10.x.


Stefan Zepeda

Salesforce Solutions Architect • Strategy


Users may have a requirement to create a metric that counts the unique combination of two different attributes.

SYMPTOM:
Users may have a requirement to create a metric that counts the unique combination of two different attributes. This can be done in Strategy 9.4.1 and 10.x.
 
STEPS TO REPRODUCE:
Follow the steps below to create a metric that counts the unique combination of two different attributes:
 
1. Create a report with the attributes Region and Promotion Type as seen below:
 

ka02R000000kVkHQAU_0EM440000002D3y.png

 
2. Create a metric  that is defined as Max(Promotion Type @ DESC). The level of this metric should be report level.
 

ka02R000000kVkHQAU_0EM440000002D42.png

3. Create a second metric  that is defined as Max(Region@ DESC). The level of this metric should be report level.
 

ka02R000000kVkHQAU_0EM440000002D44.png

4. Create a third metric that is defined as a concatenation of the two previous metrics as seen below. The concat() function can be found in the string functions.
 

ka02R000000kVkHQAU_0EM440000002D3u.png

5. Add these metrics into the report objects window of the report. These metrics do not need to be in the template.
6. Create a derived metric on the report that is defined as Count distinct of the concat() metric in step 4.
 

ka02R000000kVkHQAU_0EM440000002D47.png

 
 
7.Add the metric in step 6 to the report. This metric will count the unique combinations of the two attributes as seen below:
 

ka02R000000kVkHQAU_0EM440000002D40.png

Comment

0 comments

Details

Knowledge Article

Published:

May 25, 2017

Last Updated:

May 25, 2017