MicroStrategy ONE

The Basics of MicroStrategy Objects, Object Definitions, and Functions

To understand functions and their role in MicroStrategy, it is important to grasp the basic concepts underlying objects and expressions.

An object is a basic building block in MicroStrategy. There are three types of objects: schema objects, application objects, and configuration objects. Schema objects include facts, hierarchies, and custom groups; application objects include reports, documents, and metrics; and configuration objects include project sources, database instances, and users. (This list of objects is not exhaustive.)

MicroStrategy objects are created, maintained and deleted by you. Your Architect, for instance, will create attributes by mapping conceptual data from your data warehouse to names like Month, Customer Name, or Product Category that will appear on your reports. Your Designer will create metrics that access and manipulate numeric data from your data warehouse.

Many objects require you to specify an expression when creating or modifying them. An expression is any combination of characters that can be used as a result. Examples include the following:

  • Month + 5
  • Sum(Revenue)
  • New York AND Los Angeles

In the first example, each Month element in your data warehouse is assigned a numeric ID between 1 and 12, where January is 1, February is 2, and so on. You want to generate a report with a five-month forecast. One approach would begin with creating a new attribute called 5 Months Ahead, using the expression Month + 5 in its attribute definition.

Expressions can be used in many places. Metrics in particular often require complicated expressions. In the second example above, the expression Sum(Revenue) is used to define a relatively simple metric. "Sum" tells MicroStrategy to read individual Revenue entries from the data warehouse and add them together to produce one single number that will be displayed as Revenue on your report. This metric is a MicroStrategy object that you can create.

The last example above shows a logical expression, which might be used in a filter. A filter comprised of the expression New York AND Los Angeles would let a user answer questions such as "Which business travelers flew out of New York and out of Los Angeles in 2006?"

Expressions often form the basis of objects, which are the basic building blocks of all MicroStrategy content and functionality. Objects that rely on these expressions are often edited by changing the object expressions.

In this book, the terms "object expression" and "object definition" are interchangeable unless otherwise noted.

To create an expression that accomplishes your goal, you will almost always utilize a MicroStrategy function. Functions in MicroStrategy are powerful tools used to define MicroStrategy objects (when they are integrated into object definitions) and initiate complex user-selected calculations. The example Sum(Profit) in a metric definition uses the Sum function to add various Profit entries in a data warehouse to arrive at one final number to display on a report.

Wherever you use an expression, you can use a function. From creating basic objects to building complex reports and analyzing data, you can create custom expressions using a large library of functions that come with and are supported by MicroStrategy. Although functions are most commonly used in metric expressions, they are also used to define attribute forms, consolidation elements, custom groups, filters, facts, subtotals, and transformations, all of which are MicroStrategy objects.

Functions Commonly Used to Create Specific Objects

The following table lists the function types described above, several functions belonging to each type, and the MicroStrategy objects that can be created using those functions.

Function Type Function Examples MicroStrategy Objects That Can Use These Functions

Single-value

Arithmetic operators
(–, +, /, *)

Abs

Round

Ln

Cos

Attribute form

Consolidation

Custom group

Fact

Metric

Subtotal

Transformation

Group-value

Avg

Count

Sum

Metric

Subtotal

OLAP

Rank

MovingMin

NTile

Metric

Logical

And

Or

Filter

Comparison

Between

ApplyComparison

Filter

Apply

ApplySimple

ApplyAgg

ApplyOLAP

ApplyLogic

ApplyComparison

Attribute form

Consolidation

Custom group

Fact

Metric

Transformation

Filter