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

KB39189: How to create a count of different attribute element values using subtotals in MicroStrategy Desktop 9.x.


Community Admin

• Strategy


In certain scenarios, it is necessary to count the number of unique attribute elements that appear in a column.

In certain scenarios, it is necessary to count the number of unique attribute elements that appear in a column. The steps below show how to achieve this in Strategy Desktop 9.x.

  • Consider a scenario where an attribute contains a list of Y’s and N’s as show below:
ka04W000000OcaQQAS_0EM440000002HOt.png
  • Create a metric based off this attribute defined as the maximum value of the attribute's description as shown below:
ka04W000000OcaQQAS_0EM440000002HP1.png
  • Create a subtotal to count the number of Y's. This formula uses an IF statement saying if the Flag Metric is Y, return 1, otherwise return 0. The number of 1's is summed to get the count. 

     
ka04W000000OcaQQAS_0EM440000002HOu.png
  • Create a subtotal to count the number of N's. This formula uses an IF statement saying if the Flag Metric is N, return 1, otherwise return 0. The number of 1's is summed to get the count. >

ka04W000000OcaQQAS_0EM440000002HOz.png
  • Ceate a copy of the Flag Test Metric so no recursive definitions exist and enable custom subtotals for this metric. To do this, edit the subtotal> subtotals/aggregation tab> Total subtotal function> More> Add Count N's and Count Y's subtotals. Move these subtotals from Project Subtotals to Available Subtotals for metric.  
ka04W000000OcaQQAS_0EM440000002HOr.png
  • Put this metric on a report and enable subtotals. To do this data> subtotals> select Count N's and Count Y's. Execute. >

ka04W000000OcaQQAS_0EM440000002HOs.png

 
 
 
 


Comment

0 comments

Details

Knowledge Article

Published:

April 16, 2017

Last Updated:

May 5, 2017