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

KB45708: "Invalid metric formula" error shows when trying to create derived metric formulas containing text output in MicroStrategy Analytics Desktop 9.x and 10.x


Community Admin

• Strategy


This technical note shows how to solve one particular cause of the error "Invalid metric formula". The cause described in this technical note is due to incorrect syntax of the metric formula.  The impact is limited to MicroStrategy Analytics Desktop 9.x and 10.x product only with dashboards using new derived metrics. The correct solution is described in this document, but there are other solutions available here for similar errors.

SUMMARY:
This technical note shows how to solve one particular cause of the error "Invalid metric formula". The cause described in this technical note is due to incorrect syntax of the metric formula.  The impact is limited to Strategy Analytics Desktop 9.x and 10.x product only with dashboards using new derived metrics. The correct solution is described in this document, but there are other solutions available here for similar errors.
SYMPTOM:
When trying to create a new derived metric with text output, users receive the error "Invalid metric formula".  This occurs in dashboards viewed in Strategy Analytics Desktop 9.x and 10.x.

ka04W000000OemyQAC_0EM4400000026ON.png

Sample Code/Error
Invalid metric formula
STEPS TO REPRODUCE:
Follow these instructions to reproduce the issue in Strategy Analytics Desktop 9.x and 10.x.

  • Open the "Airline Flight Analysis" sample dashboard in Strategy Desktop Analytics.
ka04W000000OemyQAC_0EM4400000026O0.png
  • Select the "Day of the Week Stats" grid on the bottom left of the sample dashboard.
ka04W000000OemyQAC_0EM4400000026Nz.png
  • In the Grid properties, select the drop down beside the "Number of Flights" metric.
  • Choose New Metric > Enter Formula...
ka04W000000OemyQAC_0EM4400000026O1.png
  • Create a Metric Name called "Pass or Fail"
  • Enter in the formula below:

    Sample Code/Error
    IF(>800,'Pass','Fail')

  • Click OK.  The error should display.

Video:
You can find a detailed video on how this issue is reproduced here:  Tech Note 45708. Steps to reproduce
CAUSE:
The cause of this issue is because single quotations are being used in the formula.  Single quotations are not allowed in metric formulas for Strategy Analytics Desktop 9.x and 10.x, and this is the incorrect way to specify text output in a metric.  The correct way to specify text output is to use double quotations around the text.
ACTION:
When creating a formula to display text, include double quotations around the text instead of single quotes.  Below is a correct formula:
Sample Code/Error
IF(>800,"Pass","Fail")
The formula should show correctly in the grid like seen below.

ka04W000000OemyQAC_0EM4400000026Nx.png

ADDITIONAL TROUBLESHOOTING:
If the steps above do not resolve the issue, consider calling Strategy technical support with the following information of troubleshooting already done:

  • Results of testing with a user with the appropriate permissions to access Strategy Web, or with the Administrator user account if possible.
  • Results or output of following the above Action steps. 

​TO LEARN MORE:
Related technotes:
TN43576 "Formula Incorrect" error displayed when attempting to validate a metric in the highest level of the metric editor, when it validates without error in the formula section of the metric editor in Strategy 9.3.0 or 9.3.1. 
TN41618 "Formula Incorrect" error message for a valid expression when editing a metric in the Metric Editor.
TN13776 How to create a metric that will use an ‘If’ statement to perform different calculations based on the values returned by a second metric in Strategy Desktop 8.x and 9.0.x
 
Strategy Analytics Desktop Help
Section: Interfaces for Data Import, Visualizations and Functions > Interfaces for functions > New Metric dialog box


Comment

0 comments

Details

Knowledge Article

Published:

June 6, 2017

Last Updated:

June 6, 2017