MicroStrategy ONE

Create Metric statement

Creates a metric within an existing project.

Copy
CREATE METRICmetric_nameIN [FOLDER]location_pathEXPRESSIONexpression[DESCRIPTIONdescription][LONGDESCRIPTIONlong_description][HIDDEN (TRUE | FALSE)] [ALLOWSMARTMETRIC (TRUE | FALSE)] [REMOVEREPORTFILTERELEMENTS (TRUE | FALSE)] [TOTALSUBTOTALFUNCTION (AVERAGE | COUNT | DEFAULT| GEOMETRICMEAN | MAXIMUM | MEDIAN | MINIMUM | MODE | NONE | PRODUCT | STANDARDDEVIATION | SUM | VARIANCE)] [DYNAMICAGGREGATIONFUNCTION (AVERAGE | COUNT | DEFAULT| GEOMETRICMEAN | MAXIMUM | MEDIAN | MINIMUM | MODE | NONE | PRODUCT | STANDARDDEVIATION | SUM | VARIANCE)] [COLUMNALIAS column_alias] ON PROJECTproject_name;

where:

  • metric_name is the name of the metric, of type string, between double quotes (" ").

  • location_path is the folder path where the metric is to be placed, of type string, between double quotes (" ").

  • expression is the metric expression, of type string, between double quotes (" "). For the syntax of metric expressions in Command Manager, see Metric expressions syntax.

  • description is the description of the metric, of type string, between double quotes (" ").

  • long_description is the long description of the metric, of type string, between double quotes (").

  • column_alias is the column alias for the metric, of type string, between double quotes (").

  • project_name is the name of the project that will contain the new metric, of type string, between double quotes (" ").

This statement can only be executed in a Windows environment.

Examples

Copy
CREATE 
 METRIC "New Metric" IN FOLDER "\Public Objects\Metrics\Count 
 Metrics" EXPRESSION "Count(Customer) 
 {Country} [ON Promotion] FOR PROJECT MicroStrategy 
 Tutorial;
Copy
CREATE METRIC "New Metric" IN FOLDER "\Public 
 Objects\Metrics\Count Metrics" EXPRESSION "Count([\Schema 
 Objects\Attributes\Customers\Customer]) {[Schema Objects\Attributes\Geography\Country]} 
 [\Public Objects\Filters\Western United States Customers] 
 FOR PROJECT MicroStrategy Tutorial;