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

KB8815: How to replace a null value with a zero in a count metric for a MicroStrategy Developer 9.x and 10.x


Stefan Zepeda

Salesforce Solutions Architect • Strategy


KB8815: How to replace a null value with a zero in a count metric for a MicroStrategy Developer 9.x and 10.x

Consider the following example:
A report displays the number of employees with a certain salary. For a specified salary level, there are no employees that satisfy that qualification. The report appears as follows:
 

ka02R000000kbfzQAA_0EM440000002G3z.jpeg

 
The user would like to display a zero ("0") rather than the null value for the salary 31000. There are two options to achieve this:
 
On the report level:

  • In the Data menu, go to Report Data Options… > Display > Null Values.
  • Under "Null display settings", uncheck the option "Use default". In the first field for "Set the value to be displayed in the reports when there is an empty value in the data retrieved from the warehouse", set a value to "0", as shown below:
ka02R000000kbfzQAA_0EM440000002G41.jpeg
  • Click 'OK'.

The null value has now been replaced by "0".
 

ka02R000000kbfzQAA_0EM440000002G40.jpeg

 
On the metric level:

  • Rename the metric "Count Employee" to "Count Employee temp"
  • Create a second metric, "Zero" as SUM(0), as shown below:
ka02R000000kbfzQAA_0EM440000002G3u.jpeg
  • Create a compound metric "Count Employee" as "Count Employee temp" + "Zero" with the definition:
    ( + Zero)
ka02R000000kbfzQAA_0EM440000002G3t.jpeg
  • Under the "Subtotals/Aggregation" tab, enable the setting "Allow Smart Metric", at the bottom of the pane:
ka02R000000kbfzQAA_0EM440000002G3y.jpeg
  • Use the compound metric "Count Employee" on the report.

Observe that the null value is displayed as "0", as shown below:
 

ka02R000000kbfzQAA_0EM440000002G3v.jpeg

Additionally, the NulltoZero() function can be applied to the metric formula.


Comment

0 comments

Details

Knowledge Article

Published:

June 12, 2017

Last Updated:

June 12, 2017