You are on page 1of 260

Advanced

Analytics Reporting

10.8
CONTENTS

1. Introduction to Course overview ......................................................................................................... 7


Advanced Analytics MicroStrategy Analytics platform overview ..................................................... 8
Platform overview.............................................................................................. 8
MicroStrategy Desktop .................................................................................... 8
Data sources......................................................................................................... 8
Data Import .......................................................................................................... 9
Intelligence Server ...........................................................................................10
MicroStrategy Usher........................................................................................12
Metadata objects and dependencies .......................................................13
MicroStrategy tools and interfaces............................................................15
MicroStrategy Developer and MicroStrategy Web......................................16
Developer............................................................................................................16
Web .......................................................................................................................17
Final objectives .........................................................................................................17
Employee Performance Analysis ................................................................18
Sales Comparison Analysis............................................................................19
Market Basket Analysis ...................................................................................19
Customer Attrition ...........................................................................................20

2. Base Formulas and Introduction ...............................................................................................................21


Advanced Subtotals Reusing metric formulas for consistency and time-saving: Base
formulas....................................................................................................................... 21
Exercise 2.1: Access MicroStrategy Developer.......................................24
Exercise 2.2: Create a base formula for profit.........................................30
Customizing subtotals: Advanced subtotals..................................................33
Custom subtotals .............................................................................................34
Exercise 2.3: Create a custom subtotal with a dynamic name.........36

2017 MicroStrategy, Inc. 1


Contents Advanced Analytics Reporting

User-defined subtotals ...................................................................................40


Exercise 2.4: Last Quarter subtotal .............................................................41
Lesson summary.......................................................................................................46

3. Advanced Metrics Calculating business data: Metrics.....................................................................47


Applying filters to metrics: Conditional metrics ...........................................49
Exercise 3.1: Create a Northwest Revenue conditional metric ........51
How conditional metrics and report filters interact: Advanced
options for conditional metrics...................................................................57
Ignoring related report filter elements.....................................................57
Exercise 3.2: Access MicroStrategy Web ..................................................59
Exercise 3.3: Create a conditional metric to use the report
filter and the metric filter...............................................................................60
Merging metric and report filters ...............................................................66
Exercise 3.4: Merge metric filters and report filters in
conditional metrics..........................................................................................69
Time-based comparisons: Transformation metrics .....................................79
Exercise 3.5: Create a transformation metric to calculate the
quarterly profit to date...................................................................................81
Exercise 3.6: Create transformation metrics as derived
metrics to calculate last years revenue ...................................................85
Counting objects: Count metrics........................................................................87
Exercise 3.7: Create Count Item metrics...................................................91
Using advanced functions in metrics................................................................93
Exercise 3.8: Create a Revenue Rank metric ...........................................93
Exercise 3.9: Create a RunningSum Revenue metric ...........................99
Calculating metrics at different levels on a report: Dynamic
aggregation..............................................................................................................104
Changing the dynamic aggregation function.....................................109
Exercise 3.10: Change the dynamic aggregation function .............109
Metric summary......................................................................................................114

4. Level and Inventory Introduction .............................................................................................................115


Metrics Level metric example: Contribution metric..........................................117
Defining a level .......................................................................................................118
Defining whether the level metric aggregates (groups) by
the target attribute........................................................................................118
Defining the level metrics relationship with the report filter........119
Combining aggregation and filtering options to create a
level metric .......................................................................................................120

2 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Contents

Exercise 4.1: Create level metrics with standard aggregation


and different filtering options ...................................................................121
Exercise 4.2: Create level metrics with no aggregation and
different filtering options ............................................................................133
Standard aggregation compared to no aggregation .......................140
Interacting with the context of reports: Report level................................141
Removing the report level ..........................................................................141
Exercise 4.3: Removing the report level to calculate all
revenue ..............................................................................................................144
Level metric summary ..........................................................................................147
Review level metrics..............................................................................................148
Non-aggregatable metrics..................................................................................155
Defining a non-aggregatable metric ......................................................156
Exercise 4.4: Create a yearly beginning inventory metric................158
Creating advanced metrics using the Formula Editor ..............................162
Nested metrics ........................................................................................................165
Exercise 4.5: Create a nested metric ........................................................168
Level metric summary ..........................................................................................172

5. Advanced Filters Introduction .............................................................................................................173


Advanced attribute qualifications ...................................................................173
Attribute-to-attribute filtering...................................................................173
Joint element list ............................................................................................174
Exercise 5.1: Access MicroStrategy Developer.....................................174
Exercise 5.2: Create a Joint element list filter .......................................175
Dynamic dates.................................................................................................177
Exercise 5.3: Create a dynamic date filter for Last 7 Days ................179
Import filter elements...................................................................................181
Exercise 5.4: Import filter elements of Region .....................................182
Pass-through functions................................................................................183
Exercise 5.5: Profit Greater Less Than Last Years Profit....................185
Set qualifications ............................................................................................186
Advanced metric qualifications ................................................................186
Exercise 5.6: Create a Revenue over 1000 metric ...............................190
Relationship filters .........................................................................................191
Exercise 5.7: Create a Relationship filter.................................................192
Filter summary ........................................................................................................193

6. Advanced Attributes Derived attributes ..................................................................................................195

2017 MicroStrategy, Inc. 3


Contents Advanced Analytics Reporting

Exercise 6.1: Access MicroStrategy Web ................................................195


Derived elements ...................................................................................................196
Filter derived elements ................................................................................196
Group derived elements..............................................................................197
Calculation derived elements ....................................................................198
The All Other derived element...............................................................198
Creating derived elements .........................................................................198
Exercise 6.2: Create a quick group ...................................................................199
Exercise 6.3: Create a quick calculation..................................................200
Create stand-alone derived elements ....................................................204
Formatting derived elements....................................................................205
Interaction with other reporting features .............................................205
Consolidations and custom groups ................................................................212
Consolidations.................................................................................................212
Exercise 6.4: Create North Region Consolidation ...............................213
Custom groups................................................................................................213
Exercise 6.5: Create Custom Regions Group.........................................213
Custom group banding................................................................................215

7. Improving Introduction .............................................................................................................219


Performance: Intelligent Cubes ....................................................................................................219
Intelligent Cubes
Creating Intelligent Cubes ..........................................................................221
Converting reports into Intelligent Cubes ............................................222
Monitoring Intelligent Cubes.....................................................................223

8. Advanced Reporting Introduction .............................................................................................................225


Options Report data options...............................................................................................225
Calculations ......................................................................................................225
Exercise 8.1: Metric join................................................................................228

9. Workshops Before you begin ....................................................................................................233


Workshop 1: Employee Performance Analysis ............................................234
Workshop 2: Sales Comparison Analysis .......................................................240
Workshop 3: Market Basket Analysis...............................................................243
Workshop 4: Customer Attrition Analysis .....................................................247

A. Metric Symbols Metric formulas .......................................................................................................253

4 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Contents

Metric level symbols..............................................................................................254


Metric conditional symbols ................................................................................255
Metric transformation symbols.........................................................................255

2017 MicroStrategy, Inc. 5


Contents Advanced Analytics Reporting

6 2017 MicroStrategy, Inc.


1
INTRODUCTION TO ADVANCED
ANALYTICS

Course overview
The complicated information analysis needs of modern businesses frequently
necessitate complex representations of data. For example, a report may require
profit for this year placed between last years numbers and next years projections.
A regional breakdown of profit might summarize all profits by Region except for
the West Region, where California is shown separately. These are precisely the
kinds of information needs that advanced analytics is designed to address.
Advanced analytics offers significantly more detailed information than simpler
representations can provide. Businesses may already be in possession of the raw
data they need, but through advanced analytics, they can visualize that
information in ways that enable them to glean valuable insights.

Over the course of this workshop, participants will learn how to leverage the tools
and interfaces in MicroStrategy to generate and apply advanced analytics. By the
end of the workshop, participants will have acquired hands-on experience
transforming reports using MicroStrategy Developer and Web.

2017 MicroStrategy, Inc. Course overview 7


1 Introduction to Advanced Analytics Advanced Analytics Reporting

MicroStrategy Analytics platform overview

Platform overview
MicroStrategy Analytics platform is a comprehensive software platform that
provides enterprise analytics secured with enterprise-grade cybersecurity. By
integrating the MicroStrategy Analytics platform with MicroStrategy Usher, you
can provide advanced security and convenient user verification without the use
of logins and passwords.

MicroStrategy Desktop
MicroStrategy Desktop makes data source and architecture configuration almost
transparent to end users, while MicroStrategy Enterprises suite of applications
caters to larger, more sophisticated implementations. Because of this, this course
focuses on the administration of the MicroStrategy Analytics Enterprise
architectural components.

Data sources
At the base of the MicroStrategy Analytics platform architecture is your data.
MicroStrategy supports a spectrum of data sources, such as:

User or departmental data (spreadsheets, small databases, or text files)

ERP, CRM, and Web applications such as SalesForce.com

Multidimensional data sources

Relational databases

Data warehouse appliances

Columnar databases

8 MicroStrategy Analytics platform overview 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Introduction to Advanced Analytics 1

MapReduce databases
Supported Data Sources

Data Import
MicroStrategy takes things a step further with Data Import, a tool that enables
users to quickly and independently import data from a wide variety of sources,
including spreadsheets, databases, social data, Cloud sources, warehouse

2017 MicroStrategy, Inc. MicroStrategy Analytics platform overview 9


1 Introduction to Advanced Analytics Advanced Analytics Reporting

appliances, SaaS apps (such as Dropbox and Google Drive), or a Web service, with
no modeling or coding.
Data Import Sources

With Data Import, a single business analyst can use MicroStrategy Web to jump
from loading a dataset into MicroStrategy to building an interactive visual
representation or dashboard in minutes.

Intelligence Server
MicroStrategy Intelligence Server is the core component of the MicroStrategy
platform. This server manages communication between clients (such as
MicroStrategy Developer, MicroStrategy Web, or MicroStrategy Office users) and

10 MicroStrategy Analytics platform overview 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Introduction to Advanced Analytics 1

the metadata and warehouse. The following image shows the role of Intelligence
Server in the MicroStrategy architecture:
Role of MicroStrategy Intelligence Server

Whether a report developer is testing a report, a mobile user is launching a


dashboard, or a subscriber is receiving a report by emailall of these users rely
on the Intelligence Server to pass requests to the data sources and retrieve report
results. As part of this process, everything from authenticating user permissions
to prioritizing jobs to caching report results is performed by the Intelligence
Server.

Intelligence Server also houses the Engine which consists of three primary
components, each with its own unique functions:

SQL Engine: Generates the SQL for report requests

Query Engine: Submits SQL to the data warehouse and retrieves result sets

Analytical Engine: Performs any analytical functions that cannot be handled


by the data warehouse

2017 MicroStrategy, Inc. MicroStrategy Analytics platform overview 11


1 Introduction to Advanced Analytics Advanced Analytics Reporting

The following image shows the components of the MicroStrategy Engine:


MicroStrategy Intelligence Server Engine

Finally, Intelligence Server provides a variety of functionality to assist with project


administration and maintenance such as monitors, governing parameters,
application-level security, caching, clustering, and so on.

MicroStrategy Usher
MicroStrategy Usher is a revolutionary mobile identity platform designed to
provide security for every business process and system access across an
enterprise. It incorporates traditional forms of identity into a mobile identity
Usher badge, enabling users to access physical resources such as doors and

12 MicroStrategy Analytics platform overview 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Introduction to Advanced Analytics 1

elevators, and applications such as MicroStrategy Web using the Usher Security
app on their mobile devices.
Usher App and Usher Badge

Each user downloads the Usher Security app to their mobile device and then can
use it to validate their identities or to access Usher-enabled systems and
resources.

Metadata objects and dependencies


The MicroStrategy metadata repository stores MicroStrategy object definitions
and information about the data warehouse. Additionally, it maps MicroStrategy
objects to the data warehouse structures and content. MicroStrategy applications
use the metadata database to translate user requests into SQL queries and
translate the results of those queries back into MicroStrategy objects, such as
reports and documents. The MicroStrategy metadata stores a variety of data. This
workshop will focus on three main subject areas:

Metrics: Using complex calculations to compare data including using


advanced functions like statistics.

Attributes: Extending basic attributes by grouping data into virtual


attributes and elements

Filters: Applying complex conditions on data to obtain specific values. For


example, comparing sales from one set of data to another set (i.e., a market
basket analysis).

In creating advanced analytics, objects in the above subject areas will modify the
data that is obtained from data sources. In addition to modifying the data
returned, users have the option of changing how the data is presented in

2017 MicroStrategy, Inc. MicroStrategy Analytics platform overview 13


1 Introduction to Advanced Analytics Advanced Analytics Reporting

Advanced Reporting Options. Many reports may require combining results from
different queries and users may change options like the evaluation order of the
calculation, or change whether the data is to be the union of different queries or
the intersection of them.

As reference, the core objects used to build advanced analytics are described in
greater below:

Attributes: An attribute is a business concept, such as Product, Employee,


Month, and so on. Attributes provide a context for the data calculations
(metrics) that are usually the core of any business reporting. Attributes based
on the data in your data source are generally created by your organizations
project designer. An attribute on a report serves as a label for a group of
metric values.

Attribute elements: The elements of a business attribute are the unique


values for that attribute. For example, 2015 and 2016 are elements of the Year
attribute, while New York and London are elements of the City attribute. On a
report, attributes are chosen to build the report, but once the report is
executed, the attributes elements are displayed in the rows or columns.

Attribute forms: Attribute forms are additional descriptive information about


a business attribute. Attribute forms are mapped to columns in your data
warehouse. The ID column in your data warehouse provides a unique
identifier for each attribute element, and the Description column provides the
name of each attribute element. In MicroStrategy, only the IDs are used to
identify the datasets to find corresponding parent-child relationships for
calculation purposes. But an attribute can have many other forms. For
example, the attribute Customer has the forms First Name, Last Name,
Address, Email Address, and so on. A form is a descriptive category for any
data your organization saves about any of its attributes.

You can decide which form of the attribute to display on a report. For
example, in some circumstances, displaying the attributes ID is more useful
for certain users, such as a project designer. For most users, displaying the
Description form of an attribute is more useful.

Metrics: A metric is a business measure or key performance indicator, such as


Revenue, Profit, Employee Headcount, or Probability of Purchase. From a
practical perspective, metrics are the calculations performed on data stored in
your database, the results of which are displayed on a report. A metric on a
report shows a list of values used for analytical calculations. Metrics are similar
to formulas in spreadsheet software.

Most of the decisions you make about the other objects to include on a report
depend on the metrics you use on the report. Questions such as What were
the sales for the eastern region during the fourth quarter? or Are inventory

14 MicroStrategy Analytics platform overview 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Introduction to Advanced Analytics 1

counts being consistently replenished at the beginning of each week? can


easily be answered by metrics.

Facts: A metric is made up of data source facts and the mathematical


operations to be performed on those facts, so that meaningful business
analysis can be performed on the results. Facts are MicroStrategy objects
which do not appear on a report, but which do reflect data values from your
data warehouse that represent business performance.

Facts are typically numerical.

Facts are mapped to columns in your data warehouse schema. The fact
object serves as a bridge between fact values stored in your data
warehouse and the metrics users want to see on reports.

Facts are used to define metrics.

Metrics perform aggregations on fact columns.

Fact objects provide the following benefits:



Report designers and end users do not need to understand the structure
of the data warehouse when building reports.

The data warehouse can contain columns with different names that store
the same type of fact data; they are all resolved with a single-named fact
object in MicroStrategy.

You do not have to resolve discrepancies in the data warehouse to make
reporting seamless for users.

MicroStrategy tools and interfaces


The MicroStrategy analytics platform includes the following tools and interfaces
that enable you to logically organize data so that you can quickly and easily
analyze complex data relationships:

MicroStrategy Web: An intuitive reporting interface for business users that


offers interactive reporting and analysis through a Web browser.

Visual Insight: An innovative tool for business users. VI provides a powerful


way to explore data without prior business intelligence experience.

MicroStrategy Office: Enables business users to run and analyze reports in


Microsoft Excel, Word, or PowerPoint using a Microsoft.NET-compliant
Web services architecture.

MicroStrategy Mobile: An interactive interface to MicroStrategy Analytics


Enterprise that lets mobile business users run reports, documents, and

2017 MicroStrategy, Inc. MicroStrategy Analytics platform overview 15


1 Introduction to Advanced Analytics Advanced Analytics Reporting

dashboards directly from their Apple iPhone, iPad, or Android smartphone


or tablet.

MicroStrategy Developer: A client/server application that report developers


use to create reports, documents, and other reporting objects.

MicroStrategy Architect: An application to create the lowest-level metadata


objects in a MicroStrategy project, such as logical tables that map to database
tables.

MicroStrategy SDK: A collection of development tools that enable users to


customize and extend MicroStrategy products and to integrate them within
other applications.

MicroStrategy Developer and MicroStrategy


Web
To transform a business concept into a report can require using different
interfaces in MicroStrategy. Two of the tools you will use in this course are
Developer and Web. Those tools will be used to create analytics and show the
results to users.

Developer
A key component to build the objects needed is MicroStrategy Developer. This
interface allows you to create and modify analytics but also perform
administrative tasks as well. Analytics are divided into different types of objects.

16 MicroStrategy Developer and MicroStrategy Web 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Introduction to Advanced Analytics 1

There are schema objects and there are public objects. For this course, the
administrative functionality of Developer will not be discussed.
Developer Interface

Web
The final tool is the Web interface. The Web interface allows for the creation and
modification of objects, just like Developer. More importantly, Web focuses more
on the visual layout of the report, document, or dashboard. With Web, users can
also share and distribute reports to other users. While MicroStrategy Web can be
used for almost all functionality, some of the more complicated aspects of
advanced analytics are often done in Developer.

Final objectives
The ultimate objective of this course will be to create a series of reports that
demonstrate the full range of advanced analytics. There are four main reports that
will be created: Employee Performance, Sales Comparison, Market Basket
Analysis, and Customer Attrition.

2017 MicroStrategy, Inc. Final objectives 17


1 Introduction to Advanced Analytics Advanced Analytics Reporting

Employee Performance Analysis


Employee Performance depicts how different sales employees have performed
compared to each other, using multiple metrics as a basis for comparison. The
report also compares employee performance according to Region using Revenue
and Profit. Pictured below is the final result of Employee Performance:
Employee Performance Analysis Report

18 Final objectives 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Introduction to Advanced Analytics 1

Sales Comparison Analysis


The Sales Comparison report examines the Sales from different Call Centers
during different time periods. It also shows the difference of sales on a year to year
basis.
Sales Comparison Analysis Report

Market Basket Analysis


The Market Basket Analysis report allows users identify the call centers that sold a
selected item in a certain time frame and compare their overall sales
performance. On the same report, users should see the sale amount for the orders

2017 MicroStrategy, Inc. Final objectives 19


1 Introduction to Advanced Analytics Advanced Analytics Reporting

that included the selected item, as well as the count of all items in those orders.
Users should be able to pick any item at report run time.
Market Basket Analysis Report

Customer Attrition
The Customer Attrition Analysis report shows how many customers were
acquired, lost, and retained within a certain block of time. Users should be able to
select a starting month and ending month.
Customer Attrition Report

20 Final objectives 2017 MicroStrategy, Inc.


2
BASE FORMULAS AND ADVANCED
SUBTOTALS

Introduction
We start working with metrics by using the MicroStrategy Developer interface to
create base formulas and subtotals.

Base formulas can be used to create other metrics, to ensure consistency


between metrics that use the same mathematical expressions.
Customized subtotals display the subtotal name dynamically, use a different
subtotal function, and otherwise control the subtotal definition.

Reusing metric formulas for consistency and


time-saving: Base formulas
A metrics formula is made up of a mathematical function and the facts stored in
your data source. You can save metric formulas as objects that you can use to
create other metrics. These formula objects are called base formulas. Instead of
redefining a formula that you frequently use, you can save it as a base formula.

2017 MicroStrategy, Inc. Introduction 21


2 Base Formulas and Advanced Subtotals Advanced Analytics Reporting

In metrics, a base formula can determine what calculations are made and how.
Advanced metrics can build upon the base formula and modify the context of the
calculation. For example, Profit is normally expressed as:

Sum(Profit)

Where Profit is a fact. In the Metric Editor, this Profit base formula looks like the
following:

This formula does not change when dealing with advanced calculations like
Northeast Profit (a conditional metric, with a filter applied to it) or Last Years Profit
(a transformation metric, which is defined as profit limited by a certain time
frame). Such a transformation metric is shown below in the Metric Editor:

Advanced metrics can be extensions of this base formula. Base formulas allow
calculations like Sum(Profit) or Revenue/Profit to be reused again and again. If you
use other metrics to define a metric, you cannot change the level (the attribute
level that the metric calculates at), condition (filter), or transformation (offset

22 Reusing metric formulas for consistency and time-saving: Base formulas 2017 MicroStrategy, Inc.
Advanced Analytics Reporting Base Formulas and Advanced Subtotals 2

value) for the metric as a whole, as they are grayed out and unavailable, as in the
metric shown below. It is defined as the Revenue metric - Cost metric.

For instance, you cannot add a filter to this metric, to calculate profit only for the
northeast region. Contrast this metric with Last Years Profit shown previously,
where these components are available. This is the disadvantage of using metrics
to define other metrics: you cannot change the components.

2017 MicroStrategy, Inc. Reusing metric formulas for consistency and time-saving: Base formulas 23
2 Base Formulas and Advanced Subtotals Advanced Analytics Reporting

If you use a base formula instead, you can change the level and other
components:

Why should you use base formulas?

They are useful for object maintenance. If the formula for a metric changes,
you only need to edit the definition once in the base formula. All metrics that
use that base formula are automatically updated with the new definition.

Base formulas also help ensure that metrics are created with consistent
definitions, which is helpful if the formula is complex and likely to be entered
incorrectly.

Finally, base formulas help you categorize and identify the metrics that use
the same formula since you can search for metrics that contain a particular
base formula object.

Exercise 2.1: Access MicroStrategy Developer


In this exercise we access our MicroStrategy Cloud environment and then open
MicroStrategy Developer, which you will use for the exercises in this lesson.

24 Reusing metric formulas for consistency and time-saving: Base formulas 2017 MicroStrategy, Inc.
Advanced Analytics Reporting Base Formulas and Advanced Subtotals 2

Access your MicroStrategy Cloud environment

1 In the Welcome to MicroStrategy on AWS email, click Access MicroStrategy


Platform.

2 In the Login MicroStrategy web page, scroll down, and click Credentials.

3 In the User name and Password boxes, type (or copy and paste) the login
credentials provided in the Welcome to MicroStrategy on AWS email.

2017 MicroStrategy, Inc. Reusing metric formulas for consistency and time-saving: Base formulas 25
2 Base Formulas and Advanced Subtotals Advanced Analytics Reporting

4 Click Login. The MicroStrategy Cloud landing page displays in the Chrome
browser window of your Cloud environment.

5 Add a bookmark to the landing page, so that you can use it later. Drag and
drop the URL to the browsers bookmarks bar.

6 On the MicroStrategy Cloud landing page, under Essential Connections, click


the icon to copy the Intelligence Server address, as shown below. Paste the
address in Notepad on your local computer to display it, so that you can use it
to configure the hosts file later in this procedure.

7 Under Administration, click Remote Desktop Gateway, as shown below.

8 In the Remote Desktop Connection window, in the Username and Password


boxes, enter the user name and password listed in your Welcome to
MicroStrategy on AWS email.

9 On the web page, under All Connections, click Developer Instance RDP.

26 Reusing metric formulas for consistency and time-saving: Base formulas 2017 MicroStrategy, Inc.
Advanced Analytics Reporting Base Formulas and Advanced Subtotals 2

You are connected to the Windows machine in your cloud environment.

Configure the hosts file

10 On the Windows desktop of your cloud environment, double-click the


shortcut for the hosts file.

11 In the User Account Control window, click Yes to allow control.

2017 MicroStrategy, Inc. Reusing metric formulas for consistency and time-saving: Base formulas 27
2 Base Formulas and Advanced Subtotals Advanced Analytics Reporting

12 At the end of the hosts file, add the following line:

Intelligence Server IP Address i-server

where you replace Intelligence Server IP Address with the actual IP address of
your Intelligence Server copied from the MicroStrategy Cloud landing page.

At your site, you can use any host name. However, for the purposes of this
class, you will use i-server as your host name.

For example, if your Intelligence Server IP address is 10.250.151.130, type:

10.250.151.130 i-server

13 Save and close your hosts file.

Open Developer and add the project source

14 Click the Developer shortcut icon.

15 In the Project Source Manager window, click Add.

16 In the Project source box, type MicroStrategy Analytics Modules.

17 In the Connection mode drop-down list, leave Server selected.

18 On the Connection tab, in the Server name box, type i-server as the host
name of the Intelligence Server.

19 Click OK twice to close the Project Source Manager.

20 To log into Developer, double-click the MicroStrategy Analytics Module


project source name in the Folder List pane.

21 Log in with the user name and password listed in your Welcome to
MicroStrategy on AWS email.

MicroStrategy Developer opens.

28 Reusing metric formulas for consistency and time-saving: Base formulas 2017 MicroStrategy, Inc.
Advanced Analytics Reporting Base Formulas and Advanced Subtotals 2

22 Double-click MicroStrategy Tutorial in the Folder List pane to open the


project.

2017 MicroStrategy, Inc. Reusing metric formulas for consistency and time-saving: Base formulas 29
2 Base Formulas and Advanced Subtotals Advanced Analytics Reporting

Exercise 2.2: Create a base formula for profit


This exercise creates a base formula for profit, and then uses it to create a metric.
The metric will be used in the next exercise.

Create a base formula for Profit

1 In the MicroStrategy Tutorial project, click the My Personal Objects folder,


and then click My Reports.

2 From the File menu, point to New and select Metric.

3 If the New Metric window opens:

a Select Empty Metric.

b Select Dont show this dialog in the future.

c Click OK.

4 In the Metric Editor, in the Definition area, type the following formula:

Sum(Profit)

Although the status message indicates that the expression needs validation,
do not validate the formula. You will need it without any levels, as shown
above.

30 Reusing metric formulas for consistency and time-saving: Base formulas 2017 MicroStrategy, Inc.
Advanced Analytics Reporting Base Formulas and Advanced Subtotals 2

A level allows you to specify the attribute(s) to use in the metric calculation,
regardless of what is contained on any report the metric is placed upon.

Save the base formula

5 Click Save and Close.

6 In the Ambiguity dialog box, select the Profit Fact and click OK.

7 In the Save As dialog box, type Profit in the Object Name box.

8 From the Save As Type drop-down list, select Base Formula.

9 Click Save.

Create a metric using the base formula

1 Right-click in the Object Browser area, point to New, and select Metric.

2 In the My Shortcuts pane of the Metric Editor, click My Personal Objects.

3 In the Object Browser pane, double-click My Reports (the folder that you
saved the Profit Base Formula in).

2017 MicroStrategy, Inc. Reusing metric formulas for consistency and time-saving: Base formulas 31
2 Base Formulas and Advanced Subtotals Advanced Analytics Reporting

4 Drag the Profit base formula from the Object Browser to the Definition pane.

Notice that the metric includes a default level, called ReportLevel. The report
level allows the metric to calculate at the level of the lowest attribute on each
report that the metric is placed on. Because you used a base formula, you
could change the level if you wanted to.

The metric has been automatically validated, as indicated by the green check.

32 Reusing metric formulas for consistency and time-saving: Base formulas 2017 MicroStrategy, Inc.
Advanced Analytics Reporting Base Formulas and Advanced Subtotals 2

Format the metric

5 Click the Show Metric Values Formatting Properties icon in the toolbar.

6 On the Number tab of the Format Cells dialog box, click Currency in the
Category list.

7 Change Decimal Places to 0.

8 From the Currency Symbol drop-down list, select $.

9 Click OK.

Save the metric

10 Click Save and Close.

11 In the Save As dialog box, type Profit in the Object Name box.

12 Click Save.

Notice that the My Reports folder contains two objects called Profit, but that
they have different icons. The metric is indicated by this icon , while the
base formula is indicated by this icon .

Customizing subtotals: Advanced subtotals


Subtotals allow you to calculate and display metric values in attribute groupings
that you can specify dynamically while viewing a report.

When you show totals in a report, the metric totals are calculated using the sum
function by default. This means that the metric values are added together. When
you define a metric, you can:

Change the default subtotal function, so that the default subtotal is calculated
with a different function, such as average or count.

Select which subtotal functions are available for the metric.

In a report, you can select additional subtotals, such as standard deviation or


maximum, to display. The Introduction to Analytics Reporting 10.112 class covers
these basic subtotal tasks.

2017 MicroStrategy, Inc. Customizing subtotals: Advanced subtotals 33


2 Base Formulas and Advanced Subtotals Advanced Analytics Reporting

You can also create custom subtotals and user-defined subtotals:

Custom subtotals are created within a report. Because they are primarily
used for display purposes, you can use them to enhance reporting, by
modifying the name of the subtotal, selecting a different subtotal function,
and specifying the level of the subtotal. You can also hide specific subtotals.

User-defined subtotals are created in the Subtotal Editor and can be used on
different reports. They allow you to control the definition of each subtotal. For
example, you may need a subtotal that always calculates the average
derivation at the Year level regardless of the level of the report.

Custom subtotals
By default, when you add subtotals to a report, the same subtotal function is used
for all the metrics on the report. The name of the subtotal also displays in the
subtotal line items on the report. For example, if you show totals on a report, the
standard totals calculate for each level in the report. In the report shown below,
regional totals and a grand total (of all regions) are displayed:
Standard Subtotals Example

34 Customizing subtotals: Advanced subtotals 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Base Formulas and Advanced Subtotals 2

Custom subtotals allow you to define custom subtotal line items which display on
a specific report. They can be created at the report level, and are primarily used for
display purposes. Custom subtotals allow you to:

Customize the subtotal name that displays in the subtotal line item

Specify different subtotal functions for different metrics on a report

Specify the level of each subtotal

Disable subtotaling for specific metrics on a report

The name can be a static name, like Total Region, or a dynamic name that
changes with each region displayed, like Southwest Total and Northeast Total.
Use wild card characters to create dynamic names. The following table shows the
different wild card characters:

Character Description

#A The name of the attribute that the subtotal displays under

#P The name of the attribute to the left of or above the attribute that the subtotal
displays under

#0 All the forms of the parent element

#1 The first form of the parent element, reading from left to right or from top to
bottom

#2 The second form of the parent element, reading from left to right or from top to
bottom

#3 The third form of the parent element, reading from left to right or from top to
bottom

#4 The fourth form of the parent element, reading from left to right or from top to
bottom

2017 MicroStrategy, Inc. Customizing subtotals: Advanced subtotals 35


2 Base Formulas and Advanced Subtotals Advanced Analytics Reporting

Exercise 2.3: Create a custom subtotal with a dynamic


name
The subtotals in the Standard Subtotals Example, page 34 calculate a subtotal for
each region on a report, but labels it as only as Total. You want to customize the
subtotal to display each regions name, as shown below:
Custom Subtotal Sample

Create a custom subtotal

Create the report

1 From the File menu, point to New, and select Report.

2 In the New Grid dialog box, select Blank Report and click OK.

3 In the My Shortcuts pane, double-click Attributes.

4 In the Object Browser, double-click the Geography folder.

5 Double-click the Region attribute to add it to the reports rows.

36 Customizing subtotals: Advanced subtotals 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Base Formulas and Advanced Subtotals 2

6 Double-click the Call Center attribute to add it to the reports rows.

7 In the My Shortcuts pane, double-click Public Objects.

8 In the Object Browser, double-click the Metrics folder and then the Sales
Metrics folder.

9 Double-click Revenue to add it to the reports columns.

Add the Profit metric created in the last exercise

10 In the My Shortcuts pane, double-click My Personal Objects.

11 In the Object Browser, double-click My Reports.

12 Double-click Profit to add it to the reports columns. (Notice that the Profit
metric is displayed in the Object Browser, but not the Profit base formula. Base
formulas cannot be included on a report; they are only used to create metrics.)

The report should resemble the following:

Run the report

13 Click the Run Report icon .

2017 MicroStrategy, Inc. Customizing subtotals: Advanced subtotals 37


2 Base Formulas and Advanced Subtotals Advanced Analytics Reporting

The report should resemble the following.

Create and display a custom subtotal

14 On the Data menu, select Subtotals.

15 In the Subtotals dialog box, on the Definition tab, click Advanced.

16 In the Advanced Subtotals Options dialog box, click New.

38 Customizing subtotals: Advanced subtotals 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Base Formulas and Advanced Subtotals 2

17 In the Custom Subtotal Properties dialog box, type #1 #P in the Name box.
This creates a dynamic name, where #1 represents the region name and #P
represents the attribute name.

All the metrics used in the report are listed, along with their assigned subtotal. You
can change the subtotal for each metric independently. For this exercise, keep the
default subtotals (Total).

18 Click OK.

The new subtotal is displayed in the list.

19 Click OK.

20 In the Subtotals dialog box, select the check box for #1 #P (your new subtotal)
and click OK.

2017 MicroStrategy, Inc. Customizing subtotals: Advanced subtotals 39


2 Base Formulas and Advanced Subtotals Advanced Analytics Reporting

Your new custom subtotal is displayed, and the report should resemble the
Custom Subtotal Sample, page 36.

Because the custom total is dynamic, if you add another level to the report,
the name would adapt. For example, add Employee and see that the new total
is the name of the Call Center and Call Center (the attribute name for that
level).

Save the report

21 In the toolbar, click Save and Close.

22 In the drop-down list at the top of the Save Report As dialog box, select My
Reports.

23 In the Object Name box, type Regional Custom Subtotals.

24 Click Save.

User-defined subtotals
MicroStrategy provides standard, predefined subtotals that are available for use
with any metric or report. These predefined subtotals use simple aggregation
functions to address the most common subtotaling requirements, such as Count,
Average, and Max. If these predefined subtotals do not satisfy your subtotaling
needs, create user-defined subtotals. User-defined subtotals allow you to control
the definition of each subtotal. For example, you may need a subtotal that always
calculates at the Year level regardless of the level of the report.

40 Customizing subtotals: Advanced subtotals 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Base Formulas and Advanced Subtotals 2

User-defined subtotals can be created using any combination of the following:

An aggregation function, such as average deviation, internal rate of return,


modified internal rate of return, or net present value, that is not one of the
standard, predefined subtotal functions

Multiple functions

Constants in conjunction with aggregation functions

Nested functions

Dimensional subtotals

Other metrics

User-defined subtotals are different from custom subtotals because user-defined


subtotals are independent objects. They are created using the Subtotal Editor and
can be used on different reports. Custom subtotals exist on a specific report and
can be used only on that report.

Exercise 2.4: Last Quarter subtotal


In this exercise, you will create a user-defined subtotal that uses the Last function.
Sort the subtotal by the Category and Quarter attributes, in ascending order by
ID.

Apply the new Last Quarter subtotal to a Units Received metric, then place the
metric on a report with the Category and Quarter attributes. When you display
subtotals, the Last Quarter subtotal returns the units received in the last quarter
for category. It does not calculate the sum of all units received in 2016 for each

2017 MicroStrategy, Inc. Customizing subtotals: Advanced subtotals 41


2 Base Formulas and Advanced Subtotals Advanced Analytics Reporting

category. Notice that the name is not dynamic, unlike the custom subtotal
created in the last exercise. Each subtotal is displayed as Last Quarter.
Last Quarter Units Received Report

Create a user-defined subtotal

1 From the File menu, point to New and select Subtotal.

2 In the Subtotal Editor, the Object Browser lists the basic functions by default.
Drag Last to the Definition pane.

42 Customizing subtotals: Advanced subtotals 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Base Formulas and Advanced Subtotals 2

3 In the Definition pane, click Last to select it. Right-click the function and select
Last parameters.

4 Sort the Category and Quarter attributes by ID:

a Click the Sort By tab.

b Select Sort By Objects.

c Click Add.

d Add Category and Quarter to the Selected Objects list.

e Click OK.

f For both attributes, select ID from the Special drop-down list. By default,
the order for ID is set to Ascending.

g Click OK.

2017 MicroStrategy, Inc. Customizing subtotals: Advanced subtotals 43


2 Base Formulas and Advanced Subtotals Advanced Analytics Reporting

The subtotal should resemble the following. Note that you can change the
level here, if you wanted the subtotal to always calculate at a specific level.

Save the subtotal

5 Click Save and Close.

6 From the drop-down list at the top of the Save As dialog box, select My
Reports.

7 Change the Object Name to Last Quarter.

8 Click Save.

Notice that Last Quarter is saved as a subtotal, with a subtotal icon:

Apply the subtotal to a metric

1 In the Folder List pane, select the Public Objects folder.

2 In the Object Browser pane, double-click the Metrics folder and then the
Inventory Metrics folder.

3 Double-click the Units Received metric to edit it.

4 In the Metric Editor, click the Subtotals\Aggregation tab.

5 In the Project subtotals list, double-click Last Quarter to move it to the


Available Subtotals for Metric list.

44 Customizing subtotals: Advanced subtotals 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Base Formulas and Advanced Subtotals 2

6 From the File menu, select Save As.

7 In the drop-down list at the top of the Save As dialog box, select My Personal
Objects and then My Reports.

Since this metric already exists, we want to save our changes in a different folder
to avoid modifying any reports that rely on the original metric.

8 Click Save.

9 Close the Metric Editor.

Create a report to display the subtotals

1 Right-click in the Object Browser area, point to New, and select Report.

2 In the New Grid dialog box, select Blank Report and click OK.

3 Add the Category and Quarter attributes to the rows of the report.

4 Add your Units Received metric (saved in the My Reports folder) to the
columns.

5 Filter the report for 2016:

a In the My Shortcuts pane, click Data Explorer.

b Double-click the Time hierarchy, and then Year.

c Drag 2016 from the Object Browser to the Report Filter pane.

Display the Last Quarter subtotal

6 From the Data menu, select Subtotals.

7 In the Subtotals dialog box, on the Definition tab, select the check box for Last
Quarter.

8 Click OK.

2017 MicroStrategy, Inc. Customizing subtotals: Advanced subtotals 45


2 Base Formulas and Advanced Subtotals Advanced Analytics Reporting

Run the report

9 Click the Run Report icon .

The report should resemble the Last Quarter Units Received Report, page 42.

Save the report

10 In the toolbar, click Save and Close.

11 In the drop-down list at the top of the Save Report As dialog box, select My
Reports.

12 In the Object Name box, type Last Quarter Units Received.

13 Click Save.

Lesson summary
Feature Purpose Notes

Base formula Provides a template for other metrics Level, condition, and
to ensure consistency and re-use transformation cannot be changed
in the base formula

Advanced Changes how subtotals and other Underlying data is not changed,
subtotal aggregations are displayed and only the totals
computed

46 Lesson summary 2017 MicroStrategy, Inc.


3
ADVANCED METRICS
Adding conditions and transformations to
define how metrics are calculated

Calculating business data: Metrics


Metrics are MicroStrategy objects that represent business measures and key
performance indicators. From a practical perspective, metrics are the calculations
performed on data stored in your data source, the results of which are displayed
on a report. Metrics are similar to formulas in spreadsheet software. The metrics in
the following report are Revenue, Cost, and Profit. Each metric sums a fact from
your data source.
Regional Report

2017 MicroStrategy, Inc. Calculating business data: Metrics 47


3 Advanced Metrics Advanced Analytics Reporting

A metric contains the following components:

Formula: Determines the data to be used and the calculations to be


performed on the data.

In the Revenue metric definition below, the formula is Sum of Revenue fact.

Level: Determines the attribute level that the metric calculates at. For
example, you can choose to calculate profit at the month level or the region
level. By default, a metric is calculated at the report level, which is at the level
of the attributes in each report that the metric is placed on. Adding another
level is optional, and is not used in the Revenue metric example.

The Revenue metric example uses the report level, which provides flexibility
because you can reuse your metrics on many different reports. When this
metric is placed on the regional report shown above, it calculates the revenue
for each region.

Condition: Filters the metric. For example, a conditional metric can calculate
revenue only for the Northeast region or for specific dates. A condition is an
optional component and is not used in the Revenue metric example.

Transformation: Applies offset values, such as one month ago or last year,
to the selected attributes. Transformation metrics allow you to perform
time-series analysis, such as a comparison of revenue between this year and
last year. A transformation is an optional component and is not used in the
Revenue metric example.
Revenue Metric Definition in MicroStrategy Developer and Web

Advanced metrics let you define exactly how the metric will be calculated.
Advanced metrics include:

Level metrics, including non-aggregatable metrics like inventory metrics

Conditional metrics

48 Calculating business data: Metrics 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Metrics 3

Transformation metrics

Metrics using advanced functions, such as rank and running sum

Dynamic aggregation effects on metrics

Nested metrics, which have multiple layers of formulas affected by multiple


levels

These metrics empower you to answer questions like:

What percentage of total company revenue did my business unit generate?


(level metric)

Are inventory levels being consistently replenished at the beginning of each


week? (non-aggregatable metric)

What was the profit margin last year at this time? (transformation metric)

Which region was ranked highest in terms of revenue? (rank metric, using an
advanced function)

What is the cumulative revenue total for a list of objects? (running sum metric,
using an advanced function)

What is the maximum employee profit for each region? (nested metric)

Basic metric definition is covered in Introduction to Analytics Reporting 10.112. Topics


include creating simple metrics, compound metrics, smart totals, and derived metrics,
as well as selecting totals and subtotals for metrics.

Applying filters to metrics: Conditional


metrics
A conditional metric contains its own filter, allowing you to apply a filter to a
specific metric on a report while not affecting any other metrics on the report. To
create a conditional metric, you add either:

A filter

A prompt that returns a list of filters

Only one filter or prompt can be associated with each metric, but each filter can
contain multiple qualifications or prompts.

A filter is composed of at least one qualification. A qualification defines the condition


that the data must meet to be included in a report, for example, Region = Northeast

2017 MicroStrategy, Inc. Applying filters to metrics: Conditional metrics 49


3 Advanced Metrics Advanced Analytics Reporting

or Revenue > $1 million. A filter can contain multiple qualifications, combined using
the logical operators AND, AND NOT, OR, and OR NOT.

For example, you can create conditional metrics that filter on different regions, to
calculate revenue for the Northwest and Northeast regions. When the metrics are
placed on a report with the Category attribute and the Revenue metric, you can
compare the regional revenue for each category.

The Northwest Revenue metric uses the same formula (Sum of the Revenue fact)
as the Revenue metric, but contains a filter (or condition) for Northwest:

The Northeast Revenue metric was created in the same way, employing a
different filter.

50 Applying filters to metrics: Conditional metrics 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Metrics 3

Exercise 3.1: Create a Northwest Revenue conditional


metric
In this exercise, you will create a simple conditional metric that calculates the
revenue for the Northwest region only. You will first create the filter that you will
apply to the metric.

Create the Northwest Revenue conditional metric

Create the filter to use on the metric

1 From the File menu, point to New, and select Filter.

2 On the New Filter dialog box, select Empty Filter.

3 Select the Dont Show This Dialog in the Future check box.

4 Click OK.

5 In the Object Browser pane of the Filter Editor, double-click the Geography
hierarchy, and then double-click Region.

6 Drag Northwest from the Object Browser to the Filter Definition pane.

2017 MicroStrategy, Inc. Applying filters to metrics: Conditional metrics 51


3 Advanced Metrics Advanced Analytics Reporting

The filter is complete:

Save the filter

7 Click Save and Close on the toolbar.

8 From the drop-down list at the top of the Save Filter As dialog box, select My
Reports.

9 In the Object Name box, type Northwest Region.

10 Click Save.

Create the conditional metric

11 From the File menu, point to New, and select Metric.

12 In the Object Browser, which displays facts, double-click Revenue to add it to


the metric definition.

The fact is added with the Sum function:

In the Definition pane, the function (Sum) and fact (Revenue) are listed. The
symbols between the curly braces { } after the formula indicate the metric level,
which in this case is the default report level. The metric calculates at the level of
the attributes in the report. You can use these symbols as a shortcut to different
metric settings. For a full list of the symbols, see Appendix A, Metric Symbols.

52 Applying filters to metrics: Conditional metrics 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Metrics 3

Add the Northwest filter as a condition

13 Click Condition in the top pane, as indicated by the arrow in the image above.

14 In the My Shortcuts pane, click My Personal Objects.

15 In the Object Browser, double-click My Reports.

16 Drag Northwest Region from the Object Browser to the Condition pane.

The filter is now added as the metrics condition:

17 Click Sum(Revenue) in the top pane, as shown above.

Note how the metric definition has changed. The level of the report did not
change, so the metric symbols in the curly braces { } did not change. The
information about the metric condition is provided between the angle brackets <
>. Northwest Region is the filter name, the @2 indicates the embedding method,
and the - is the related report filter elements setting. The latter two options will be
explained later in the lesson.

Format the metric

18 Click the Show Metric Values Formatting Properties icon in the toolbar.

19 On the Number tab of the Format Cells dialog box, click Currency in the
Category list.

2017 MicroStrategy, Inc. Applying filters to metrics: Conditional metrics 53


3 Advanced Metrics Advanced Analytics Reporting

20 Change Decimal Places to 0.

21 From the Currency Symbol drop-down list, select $.

22 Click OK.

Save the metric

23 In the toolbar, click Save and Close.

24 From the drop-down list at the top of the Save As dialog box, select My
Reports.

25 In the Object Name box, type Northwest Revenue.

26 Click Save.

Create a report to display the conditional metric

1 From the File menu, point to New, and then select Report.

2 In the New Grid dialog box, select Blank Report and click OK.

3 In the Object Browser, double-click Geography.

4 Drag the Region attribute from the Object Browser to the rows of the report.

5 In the My Shortcuts pane, click Public Objects.

6 In the Object Browser, double-click Metrics and then Sales Metrics.

7 Drag the Revenue metric from the Object Browser to the columns of the
report.

Run the report

8 Click the Run Report icon .

54 Applying filters to metrics: Conditional metrics 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Metrics 3

The report should resemble the following. Note the revenue amount for
Northwest, which is $1,761,187.

Add the Northwest Revenue metric

9 Click the Design View icon in the toolbar.

10 In the My Shortcuts pane, click My Personal Objects.

11 In the Object Browser, double-click My Reports.

12 Double-click the Northwest Revenue metric to add it to the report.

Run the report

13 Click the Run Report icon .

The report should resemble the following:

Why does the report now display only one row, for Northwest?

The answer lies in how the metrics are joined in the report. Joins allow you to
place conditions on the data selected for display. By default, the metrics in a
report use inner joins, which includes only the data common to all the
elements in the join. In contrast, an outer join includes all of the data in all of
the elements.

Because the Northwest Revenue metric contains data only for the Northwest
region, only that data is displayed. The inner join means that only the single
Northwest region row is displayed in the report.

If an outer join, which includes all the data available in the report, is used
instead, all the regions are displayed on the report.

2017 MicroStrategy, Inc. Applying filters to metrics: Conditional metrics 55


3 Advanced Metrics Advanced Analytics Reporting

Change the metric joins to outer

14 From the Data menu, select Report Data Options.

15 In the Report Data Options dialog box, select Metric Join Type in the
Categories list.

16 In the Revenue row, select Outer from the Join Type drop-down list. This
allows all the revenue data from all the regions to be displayed.

17 Click OK.

18 At the message to re-execute the report, click Yes.

The report should resemble the following. Instead of a single row, for
Northwest, the report displays all regions, with the corresponding revenue
amounts for each. The Northwest Revenue metric has a value only in the
Northwest row, since the metric filter includes only revenue from the
Northwest region. There is no Northwest revenue in the Central region, for
instance, so no revenue value can be calculated.

Save the report

19 In the toolbar, click Save and Close.

20 In the drop-down list at the top of the Save Report As dialog box, select My
Reports.

56 Applying filters to metrics: Conditional metrics 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Metrics 3

21 In the Object Name box, type Northwest Revenue.

22 Click Save.

How conditional metrics and report filters interact:


Advanced options for conditional metrics
When a report contains both a filter and a conditional metric, the report filter and
the filter contained in the metric (the metric filter) interact to produce the data for
the conditional metric. The advanced options for the conditional metric establish
this interaction. These options are:

The merging method, which determines which filter is evaluated first. By


default, the report filter is applied first.

Also referred to as the embedding method.

The ignore related report filter elements option is used when the report
filter contains an attribute related to an attribute in the metric filter. By default,
the related attributes in the report filter are ignored.

Although each option affects the filter interaction differently, they also work
together. After we see how each option works independently, we will learn how
they come together to affect the conditional metric results.

Ignoring related report filter elements


A report can have filters in addition to conditional metrics. The interactions
between filters and metrics can be complex. For example, the following report
contains the Northwest Revenue metric that we created previously. This report
contains the Category attribute instead of the Region attribute.

2017 MicroStrategy, Inc. Applying filters to metrics: Conditional metrics 57


3 Advanced Metrics Advanced Analytics Reporting

Add a filter on Call Center to the report. Northwest Revenue calculates revenue for
the Northwest region, which includes the San Francisco and Seattle call centers.
Only one of those call centers is included in the report filter.

The Revenue metric is not a conditional metric (does not have a filter on it). It
calculates values only for the call centers included in the report filter. This is
why the values are less than those calculated in the previous report.

In contrast, the Northwest Revenue metric calculates the same values as in the
previous report. Why?

By default, a conditional metric ignores any related attributes in the report


filter. Attributes are related if they belong to the same hierarchy. In this
example, Call Center in the report filter and Region in the metrics filter both
belong to the Geography hierarchy. The metric filter overwrites the report
filter, so both San Francisco and Seattle are included in the metrics
calculation.

Ignoring related attributes in the report filter ensures that the conditional metric
always calculates according to the metrics filter, regardless of the report filter.

You can change the Ignore Related Report Filter Elements setting so that the
conditional metric uses both the report filter and the metric filter to calculate
values. The results are the intersection of the filters.

58 Applying filters to metrics: Conditional metrics 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Metrics 3

Copy the Northwest Revenue metric, edit it to clear the Ignore Related Report
Filter Elements check box, and add the new metric to the report.

The NW Revenue (Report Filter) metric uses both its metric filter and the report
filter. The metric filter contains San Francisco and Seattle; the report filter contains
San Francisco; the intersection of the two filters is San Francisco. The metric
therefore provides revenue values for San Francisco only.

Note: The report filter itself is not changed, as shown by the unchanged Revenue
values. This setting determines the filter interaction only for the conditional
metric.

In the report SQL, if related report filter elements are ignored, they are not included in
the SQL passes that calculate the metric.

Exercise 3.2: Access MicroStrategy Web


We will use MicroStrategy Web for some exercises, so that you can explore
creating metrics in both the Developer and Web interfaces. In this exercise we
open MicroStrategy Web in the MicroStrategy Cloud environment.

Access MicroStrategy Web

1 Close Developer.

2 Click the landing page bookmark that you created earlier on the browsers
bookmarks bar.

3 If you are prompted to log in, type (or copy and paste) the login credentials
provided in the Welcome to MicroStrategy on AWS email.

2017 MicroStrategy, Inc. Applying filters to metrics: Conditional metrics 59


3 Advanced Metrics Advanced Analytics Reporting

4 On the MicroStrategy Cloud landing page, click MicroStrategy Web.

5 On the MicroStrategy Tutorial Home page, click Go to MicroStrategy Web, in


the upper right corner, to open the Shared Reports folder of the MicroStrategy
Tutorial project.

Exercise 3.3: Create a conditional metric to use the


report filter and the metric filter
This exercise recreates the example described above. We will create a Northwest
conditional metric in Web, so that you can see the differences between Developer
and Web. We will allow the metric to use both the report filter and the metric filter
in its calculations.

60 Applying filters to metrics: Conditional metrics 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Metrics 3

To see the difference between the two settings, we will create a report that uses
the new metric and the Northwest conditional metric that we created in
Developer.

Create a conditional metric to use the report filter and the metric filter

1 Click Create, and select New Metric.

The Metric Editor opens, in the Function Editor mode.

To quickly create a metric that uses a function, use the Function Editor. The
Function Editor provides an easier-to-use interface.

To type the metric formula directly, or to create a metric that combines


multiple metrics or contains custom expressions, you can use the Formula
Editor instead, by clicking Switch to Formula Editor. We will discuss the
Formula Editor later in this class.

2 In the Functions list on the left, click Sum to add it to the metric definition
window.

When you select a function, its description is displayed at the bottom of the
Metric Editor. You can click Details to view the syntax and examples for the
function.

3 Select the Revenue fact:

a Click the Browse icon next to the Search for a fact, metric or attribute
box.

2017 MicroStrategy, Inc. Applying filters to metrics: Conditional metrics 61


3 Advanced Metrics Advanced Analytics Reporting

b Click the Facts folder.

c Click Revenue.

4 Click Show All to display the level, condition, and transformation properties.

5 Click the Browse icon next to the Condition box.

6 Add the Northwest Region filter as the condition:

a In the Select an Object window, select My Reports from the drop-down


list.

b Click Northwest Region.

The Northwest Region filter is now applied as the metrics condition.

Allow the metric to use both the metric filter and the report filter

7 Click Condition Advanced Functions.

62 Applying filters to metrics: Conditional metrics 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Metrics 3

8 In the Conditional Advanced Options window, clear the Ignore Related


Report Filter Elements check box.

9 Click OK.

Save the metric

10 Type NW Revenue (Report Filter) in the Display Name box.

11 Click Save.

12 In the Save As window, select My Reports from the Save In drop-down list.

13 Click Save, and then click OK on the successful save message.

Create a report to display the conditional metrics

1 Click Create, point to New Report, and select Blank Report.

2 In the All Objects pane, click Attributes, and then Products.

3 Drag the Category attribute from the All Objects pane to the rows drop zone
on the report grid.

4 In the drop-down list on the All Objects pane, select Metrics.

5 In the All Objects pane, click the Sales Metrics folder.

6 Drag the Revenue metric from the All Objects pane to the metrics drop zone
on the report grid.

2017 MicroStrategy, Inc. Applying filters to metrics: Conditional metrics 63


3 Advanced Metrics Advanced Analytics Reporting

7 In the drop-down list on the All Objects pane, select My Personal Objects.

8 In the All Objects pane, click the My Reports folder.

9 Double-click the Northwest Revenue metric and then the NW Revenue


(Report Filter) metric to add them to the report.

The report should resemble the following:

Create the report filter

10 In the drop-down list on the All Objects pane, select Attributes.

11 In the All Objects pane, click the Geography folder.

12 Drag Call Center from the All Objects pane to the Report Filter pane.

13 Click Select.

14 In the list of Available objects, double-click San Francisco, San Diego, and
Salt Lake City to add them to the Selected list.

15 Click Apply.

Run the report

16 Click the Run Report icon.

Format the metrics values

17 Click Format in the toolbar.

64 Applying filters to metrics: Conditional metrics 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Metrics 3

18 From the first drop-down list in the formatting toolbar, select NW Revenue
(Report Filter).

19 From the next drop-down list, select Values.

20 Click the Currency Style icon in the toolbar.

21 Click the Decrease Decimal icon two times, so that the Northwest
Revenue (Report Filter) value no longer displays decimals.

The report should resemble the following:

Recall that Northwest Revenue uses the default setting to ignore related
attributes in the report filter. The conditional metric always calculates
according to the metrics filter, regardless of the report filter. In this case, San
Francisco and Seattle are included in the metric calculation, even though
Seattle is not included on the report.

When related attributes in the report filter are not ignored, both the report
filter and the metric filter are used to calculate the metrics values. In this case,
only San Francisco is included in the metric calculation.

2017 MicroStrategy, Inc. Applying filters to metrics: Conditional metrics 65


3 Advanced Metrics Advanced Analytics Reporting

Save the report

22 Click the Save icon .

23 From the Save In drop-down list, select My Reports.

24 Name the report Conditional Metric Filter Report, and click OK.

25 Click Run Newly Saved Report.

If you select Return to Original Report instead, you are returned to the Blank
Report, with your changes. You do not want to save your changes to that report
name.

Merging metric and report filters


You can affect the interaction of the metric filter and report filter by:

Merging the report filter into the metric filter (the default)

The report filter is applied to the data first. Then the metric filter is applied to
the results of the first evaluation.

Merging the metric filter into the report filter

The metric filter is applied to the data first. Then the report filter is applied to
those results.

Merging both filters into a new filter

The metric filter and the report filter are intersected. Only those results that
meet both the metric filter and the report filter are returned.

The embedding method is relevant only if at least one filter contains one of the
following:

Metric qualification

Relationship qualification

Shortcut-to-a-report qualification

The results from these types of qualifications can vary. For example, filtering on
Country=US always yields the same results. This is an example of an attribute
qualification. However, filtering on Country where revenue is greater than $1000
can return different results if the filter is used on a report with a specific year or a
specific category. This is a metric qualification.

66 Applying filters to metrics: Conditional metrics 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Metrics 3

An example can help to illustrate the differences between the merge methods.
The report filter finds the top 10 items in terms of profit. The metric filter finds the
top 5 customers in terms of revenue. How should the metric be calculated? How
should the report filter and the metric filter work together?

Several possibilities exist, and the embedding method allows you to specify
which possibility fits your business requirements. Since both the metric filter and
the report filter contain a metric qualification, the embedding method is relevant
to this example.

Merging the report filter into the metric filter


The default option is to merge the report filter into the metric. Using this option,
the report filter is applied first, and the metric filter is applied on that result.

1 The report filter selects the top 10 most profitable items, using all customers
in the calculation.

2 The metric calculates the revenue of those 10 items to the top 5


revenue-producing customers (selected by the metric filter).

The result is the top 5 customers who bought the top 10 Items.
Merge Report Filter into Metric Filter

2017 MicroStrategy, Inc. Applying filters to metrics: Conditional metrics 67


3 Advanced Metrics Advanced Analytics Reporting

Merging the metric filter into the report filter


When the metric filter is merged into the report filter, the metric filter is applied
first, then the report filter is applied on that result.

1 The metric filter selects the top 5 revenue-producing customers.

2 The report filter selects the top 10 most profitable items, using only the top 5
customers selected in the metric filter.

3 The metric calculates the revenue of those 10 items to the 5 customers.

The result is the top 10 items bought by the top 5 customers.


Merge Metric Filter into Report Filter

Merging both filters into a new filter


The last option is to merge the filters into a new filter. The report filter and the
metric filter are calculated independently, then the results are intersected,
causing a union between the two filters.

68 Applying filters to metrics: Conditional metrics 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Metrics 3

The result is all the top 5 Customers and the top 10 Items.
Merge into New Filter

Exercise 3.4: Merge metric filters and report filters in


conditional metrics
In this exercise, we will identify the bottom 10 items in terms of revenue and only
those items with revenue greater than $15,000. Different report results can be
obtained depending on the merge filters setting. This exercise will help you select
the correct setting for your report goal.

Create a filter for revenue greater than $15K

1 Click Create, and select New Filter.

2 In the Object Browser, click the Metrics folder and then the Sales Metrics
folder.

3 Double-click Revenue to add it to the filter.

4 From the first drop-down list in the filter definition pane, select Greater Than.

5 Type 15000 in the next box.

2017 MicroStrategy, Inc. Applying filters to metrics: Conditional metrics 69


3 Advanced Metrics Advanced Analytics Reporting

6 Click Apply.

7 Click Save on the toolbar.

8 In the To the Folder drop-down list, select My Reports.

9 In the Name box, type Revenue Greater Than 15K.

10 Click OK.

11 Click Close on the toolbar.

Create a conditional metric for revenue greater than $15K

1 Click Create, and select New Metric.

2 In the Functions list on the left, click Sum to add it to the metric definition
window.

3 Select the Revenue fact:

a Click the Browse icon next to the Search for a fact, metric or attribute
box.

b Click the Facts folder.

c Click Revenue.

Add the filter to the metric

4 Click Show All to display the level, condition, and transformation properties.

5 Click the Browse icon next to the Condition box.

6 In the Select an Object window, select My Reports from the drop-down list.

7 Click Revenue Greater Than $15K.

Check the metric merge setting

8 Click Condition Advanced Functions.

70 Applying filters to metrics: Conditional metrics 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Metrics 3

In the Conditional Advanced Options window, note that the default


interaction is to merge the report filter into the metric filter.

9 Click OK.

Save the metric

10 Type Revenue > $15K (RF 1st) in the Display Name box.

11 Click Save.

12 In the Save As window, select My Reports from the Save In drop-down list.

13 Click Save, and then click OK on the successful save message.

Create a conditional metric to evaluate the metric filter first

Copy the conditional metric

1 In the My Reports folder, right-click the Revenue > $15K (RF 1st) metric and
select Copy.

2 In the To the Folder drop-down list, select My Reports.

3 In the Name box, type Revenue > $15K (MF 1st).

4 Click OK.

2017 MicroStrategy, Inc. Applying filters to metrics: Conditional metrics 71


3 Advanced Metrics Advanced Analytics Reporting

Edit the metric to change the filter interaction

5 Double-click the Revenue > $15K (MF 1st) metric to edit it.

6 Click Condition Advanced Functions.

7 From the Interaction between Metric Filter and Report Filter drop-down
list, select Merge Metric Condition into Report.

8 Click OK.

9 Click Save, and then click OK on the successful save message.

Create a conditional metric to merge the filters into one

Copy the conditional metric

1 In the My Reports folder, right-click the Revenue > $15K (RF 1st) metric and
select Copy.

2 In the To the Folder drop-down list, select My Reports.

3 In the Name box, type Revenue > $15K (new).

4 Click OK.

Edit the metric to change the filter interaction

5 Double-click the Revenue > $15K (new) metric to edit it.

6 Click Condition Advanced Functions.

7 From the Interaction between Metric Filter and Report Filter drop-down
list, select Merge into New.

8 Click OK.

9 Click Save, and then click OK on the successful save message.

Create the reports to display the conditional metrics

1 Click Create, point to New Report, and select Blank Report.

72 Applying filters to metrics: Conditional metrics 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Metrics 3

2 In the All Objects pane, click Attributes, and then Products.

3 Double-click Item to add it to the reports rows.

4 In the drop-down list on the All Objects pane, select My Personal Objects.

5 In the Object Browser, click My Reports.

6 Double-click the Revenue > $15K (RF 1st) metric to add it to the report.

Create the report filter

7 In the drop-down list on the All Objects pane, select Metrics.

8 In the Object Browser, click the Sales Metrics folder.

9 Drag Revenue from the All Objects pane to the Report Filter pane.

10 From the first drop-down list in the report filter pane, select Lowest.

11 Type 10 in the next box.

12 Click Apply.

Run the report

13 Click the Run Report icon .

The report should resemble the following:

2017 MicroStrategy, Inc. Applying filters to metrics: Conditional metrics 73


3 Advanced Metrics Advanced Analytics Reporting

Only 6 rows are returned, instead of the 10 you expected based on your
Bottom 10 filter. Why?

The report filter is applied first and then the metric filter is applied to those
results. This means that the bottom 10 sales are determined first, and then, of
those bottom 10 sales, only those items with revenue greater than $15,000 are
returned on the report. The number of rows on the report is only 6, since some
of the 10 items returned by the report filter have sales less than $15,000.

Save the report

14 Click the Save icon .

15 From the Save In drop-down list, select My Reports.

16 Name the report Merge Report Filter and click OK.

17 Click Run Newly Saved Report.

Replace the conditional metric

18 In the grid, right-click the Revenue > $15K (RF 1st) metric and select Remove
from Report.

19 In the drop-down list on the All Objects pane, select My Personal Objects.

20 In the Object Browser, click My Reports.

21 Double-click the Revenue > $15K (MF 1st) metric to add it to the report.

74 Applying filters to metrics: Conditional metrics 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Metrics 3

The report should resemble the following:

The report contains 10 rows, as expected, and all items have a revenue higher
than $15,000. Since the metric filter is applied first, all items with revenue
greater than $15,000 are selected first. Then the report filter is applied to
those results. The bottom 10 revenue items are selected, so the report returns
10 rows. Notice that the revenue values calculated for the 6 items that
appeared on the first are the same between the 2 reports. The merge setting
does not affect the metric calculation, only what is displayed on the report.

Save the report

22 Click the Save icon .

23 From the Save In drop-down list, select My Reports.

24 Name the report Merge Metric Filter and click OK.

25 Click Run Newly Saved Report.

Replace the conditional metric

26 In the grid, right-click the Revenue > $15K (MF 1st) metric and select
Remove from Report.

27 In the drop-down list on the All Objects pane, select My Personal Objects.

2017 MicroStrategy, Inc. Applying filters to metrics: Conditional metrics 75


3 Advanced Metrics Advanced Analytics Reporting

28 In the Object Browser, click My Reports.

29 Double-click the Revenue > $15K (new) metric to add it to the report.

The report should resemble the following:

356 rows are returned, instead of the expected 10. Why?

The metric filter and the report filter are merged into a new filter, and the
intersection of the two filters are used. Only those items that are in the bottom
10 in terms of revenue and have revenue greater than $15,000 should be
included. The results should be the same as the first report, with 6 rows of
data.

It seems as though the report filter is being ignored, so that 10 items are not
selected for display. Why?

This is an example of how the metric merge and ignore related report filter
elements work together to affect how the report filter and the metric filter
interact. By default, related report filter elements are ignored. In this example,
the filters use the same element (Item), so the report filter is ignored. Only the
metric filter, for revenue greater than $15,000, is applied.

Save the report

30 Click the Save icon .

76 Applying filters to metrics: Conditional metrics 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Metrics 3

31 From the Save In drop-down list, select My Reports.

32 Name the report New Filter and click OK.

33 Click Run Newly Saved Report.

34 Close the report.

Create a conditional metric to use the report filters related elements

Copy the conditional metric

1 In the My Reports folder, right-click the Revenue > $15K (new) metric and
select Copy.

2 In the To the Folder drop-down list, select My Reports.

3 In the Name box, type Revenue > $15K (new + related).

4 Click OK.

Edit the metric to change the report filter setting

5 Double-click the Revenue > $15K (new + related) metric to edit it.

6 Click Condition Advanced Functions.

7 Clear the Ignore Related Report Filter Elements check box.

8 Click OK.

9 Click Save, and then click OK on the successful save message.

Add the new metric to the report

1 In the My Reports folder, click the New Filter report.

2 In the grid, right-click the Revenue > $15K (new) metric and select Remove
from Report.

3 In the All Objects pane, click the My Personal Objects folder, and then My
Reports.

2017 MicroStrategy, Inc. Applying filters to metrics: Conditional metrics 77


3 Advanced Metrics Advanced Analytics Reporting

4 Double-click the Revenue > $15K (new + related) metric to add it to the
report.

The report should resemble the following:

The results should be the same as the first report, with 6 rows of data, because
the report filter is now being applied.

Save the report

5 Click the Save icon .

6 From the Save In drop-down list, select My Reports.

7 Name the report New Filter and click OK.

8 Click Run Newly Saved Report.

78 Applying filters to metrics: Conditional metrics 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Metrics 3

Time-based comparisons: Transformation


metrics
Transformation metrics are used to compare values for different times, such as last
years revenue compared to this years revenue. The following report provides
yearly revenue:

A transformation metric which calculates last years revenue is added to the


report. The 2015 row displays 2015 revenue in the Revenue column, 2014 revenue
in the LY Revenue column, and then the difference between the two values in the
TY/LY Variance column. (LY stands for Last Year, and TY stands for This Year.) You
can compare the 2014 revenue between these two reports to confirm. The 2016
row displays 2016 revenue, 2015 revenue, and the difference. (The 2014 row is not
displayed because 2013 revenue is not included in our data source.)

To calculate last years revenue, you apply a transformation to the Revenue metric.
A transformation maps a specified time period to another time period. In other
words, it applies an offset value, such as current year minus one year.

Transformations are useful for time-series analyses, which are relevant to many
industries, including retail, banking, and telecommunications. The This Year
versus Last Year comparison (referred to as TY/LY) is a typical time-series analysis.

Using a transformation to calculate a TY/LY variance or growth percentage is


convenient and flexible, but alternatives exist. For example, you can use filters to
create the TY/LY comparison. Create a filter for the first year (such as 2017) and
add it to the Revenue metric to create a new conditional metric. Then create a
filter for the previous year (2016) and add it to the Revenue metric for a second
conditional metric.

A more flexible and easier alternative is to add an existing transformation to the


Revenue metric to create a transformation metric. You can then place the original
Revenue metric and the transformation metric on a report and filter it for 2017.

2017 MicroStrategy, Inc. Time-based comparisons: Transformation metrics 79


3 Advanced Metrics Advanced Analytics Reporting

Instead of creating two filters and two metrics, you created one filter and one
metric. The transformation metric does not have to be updated when the years
change, because the transformation is dynamic. In addition, the same
transformation metric can be used on reports with different filters to achieve
different results. No additional metrics or filters have to be created.

Transformations are usually the most generic approach and can be re-used and
applied to other time-series analyses. Since a transformation represents a rule, it
can describe the effect of that rule for different attribute levels. For instance, the
Last Year transformation maps a specific year to the previous year. But it can also
express how each month of a year corresponds to a month of the prior year, or
each day of a year to a day of the previous year. The report shown below is the
same report used in the previous example, except that Year has been replaced by
Quarter. The metrics are the same, but calculate at the quarter level now.

This information defines the transformation and abstracts all cases into a generic
concept. This allows you to use a single metric with a last year transformation
regardless of the time attribute contained on a report.

Note: While a transformation does not have to be time-based, most


transformations are. For example, a non-time-based transformation can map
defunct product codes to new ones.

MicroStrategy provides numerous prebuilt transformations, although you can


create your own as needed. This task is typically performed by the project
architect or the person in charge of schema object creation. The Project
Architecting 10.411 class teaches you how to create transformations. One of the
MicroStrategy-provided transformations answers our needs for the following
exercise.

80 Time-based comparisons: Transformation metrics 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Metrics 3

Exercise 3.5: Create a transformation metric to calculate


the quarterly profit to date
You need to know how much profit has been earned so far in this quarter. Create a
transformation metric using the Quarter to Date transformation to calculate this
value.

Create the transformation metric

1 On any MicroStrategy Web folder page, click Create, and select New Metric.

The Metric Editor opens, in the Function Editor mode.

2 In the Functions list on the left, click Sum to add it to the metric definition
window.

3 Select the Profit fact:

a Click the Browse icon next to the Search for a fact, metric or attribute
box.

b Click the Facts folder.

c Click Profit.

4 Click Show All to display the level, condition, and transformation properties.

5 Click the Browse icon next to the Transformation box.

6 Click Quarter to Date.

The Quarter to Date transformation is now applied as the metrics


transformation.

7 Type QTD Profit in the Display Name box.

8 Click Save.

9 In the Save As window, select My Reports from the Save In drop-down list.

2017 MicroStrategy, Inc. Time-based comparisons: Transformation metrics 81


3 Advanced Metrics Advanced Analytics Reporting

10 Click Save, and then click OK on the successful save message.

Create a report to display the transformation metric

1 Click Create, point to New Report, and select Blank Report.

2 In the All Objects pane, click Attributes, and then Geography.

3 Drag the Region attribute from the All Objects pane to the rows drop zone on
the report grid.

4 In the drop-down list on the All Objects pane, select Metrics.

5 In the All Objects pane, click the Sales Metrics folder.

6 Drag the Profit metric from the All Objects pane to the metrics drop zone on
the report grid.

7 In the All Objects pane, click My Personal Objects, and then My Reports.

8 Double-click the QTD Profit metric to add it to the report.

Run the report

9 Click the Run Report icon .

The report should resemble the following. The Profit and QTD Profit metrics
both calculate the same value. The transformation metric is not producing a
quarter-to-date value. Why?

The transformation has not been given a date to transform, so both metrics
calculate the profit earned for each region for all time. We can provide the
specific date that we want information on by creating a report filter.

82 Time-based comparisons: Transformation metrics 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Metrics 3

Create a report filter on date

10 Click the Design View icon to edit the report.

11 At the bottom of the Object Browser pane, click All Objects.

12 In the All Objects pane, select Attributes from the drop-down list.

13 Click Time.

14 Drag Day to the Report Filter pane.

15 Type 2/23/2016 in the value comparison box, as shown below:

16 Click Apply.

Run the report

17 Click the Run Report icon .

Format the metrics values

18 Click Format in the toolbar.

19 From the first drop-down list in the formatting toolbar, select QTD Profit.

2017 MicroStrategy, Inc. Time-based comparisons: Transformation metrics 83


3 Advanced Metrics Advanced Analytics Reporting

20 From the next drop-down list, select Values.

21 Click the Currency Style icon in the toolbar.

22 Click the Decrease Decimal icon two times, so that the Northwest
Revenue value no longer displays decimals.

The report should resemble the following:

Now that the transformation has a date to transform, the report provides
information on profit values for the specific date and for the quarter up to the
date, that is, 1/1/2016 until 2/23/2016.

If the report cannot return any data, the dates in MicroStrategy Tutorial may have
changed. Return to Design Mode and change the date in the report filter. When
you re-run the report, data should display, although the values may not match the
report sample.

Save the report

23 Click the Save icon .

24 From the Save In drop-down list, select My Reports.

25 Name the report QTD Profit Report, and click OK.

26 Click Run Newly Saved Report.

84 Time-based comparisons: Transformation metrics 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Metrics 3

Exercise 3.6: Create transformation metrics as derived


metrics to calculate last years revenue
You can create transformation metrics within a report, by using derived metrics. A
derived metric is created using the metrics already on the report. A derived metric
is saved within the report and therefore can only be used on that report, unlike
metrics created in the Metric Editor.

In this exercise, we will create derived metrics that transform the Revenue metric
to calculate last years revenue. We will create all three different kinds of
transformation derived metrics:

Normal calculates the values for the offset. In this case, it is Last Years
Revenue.

Variance calculates the difference between the current values and the
transformed values. In this exercise, it is Revenue - Last Years Revenue.
Variance Percentage calculates the difference, expressed as a percentage,
between the current values and the transformed values. In this exercise, it is
(Revenue - Last Years Revenue)/Last Years Revenue.

Create the report

1 Click Create, point to New Report, and select Blank Report.

2 In the All Objects pane, click Attributes, and then Geography.

3 Drag the Region attribute from the All Objects pane to the rows drop zone on
the report grid.

4 In the drop-down list on the All Objects pane, select Metrics.

5 In the All Objects pane, click the Sales Metrics folder.

6 Drag the Revenue metric from the All Objects pane to the metrics drop zone
on the report grid.

Create a report filter on year

7 In the drop-down list on the All Objects pane, select Attributes.

8 In the All Objects pane, click Time.

2017 MicroStrategy, Inc. Time-based comparisons: Transformation metrics 85


3 Advanced Metrics Advanced Analytics Reporting

9 Drag Year to the Report Filter pane.

10 Type 2016 in the value comparison box, as shown below:

11 Click Apply.

Run the report

12 Click the Run Report icon .

If the report cannot return any data, the dates in MicroStrategy Tutorial may have
changed. Return to Design Mode and use 2017 in the report filter. When you
re-run the report, data should display, although the values may not match the
report sample.

Create the derived metrics

13 Right-click the Revenue metric in the grid, point to Insert Metric, point to
Transformation, point to Last Years, and select Normal.

A new metric, named Last Years (Revenue) is added to the report.

14 Right-click the Revenue metric in the grid, point to Insert Metric, point to
Transformation, point to Last Years, and select Variance.

86 Time-based comparisons: Transformation metrics 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Metrics 3

A new metric, named (Revenue) - (Last Years (Revenue)), is added to the


report.

15 Right-click the Revenue metric in the grid, point to Insert Metric, point to
Transformation, point to Last Years, and select Variance Percentage.

A new metric, named ((Revenue) - (Last Years (Revenue)))/(Last Years


(Revenue)), is added to the report.

16 Rename each metric:

a Right-click the metric and select Rename.

b Type the new name in the Name box, as indicated below:



Last Years (Revenue) to LY Revenue

(Revenue) - (Last Years (Revenue)) to Variance

((Revenue) - (Last Years (Revenue)))/(Last Years (Revenue)) to Variance
%

c Click OK.

17 Rearrange the order of the metrics on the report, by dragging and dropping
them. The metrics display as Revenue, LY Revenue, Variance, and Variance %
from left to right.

The report should resemble the following:

Counting objects: Count metrics


A count metric is a metric that uses the Count function in its definition. Count
metrics are unique because they can use attributes as well as facts in their
definition. You can use count metrics in a retail business environment to count
the number of items:

Available in a specific store

Available in a certain catalog

2017 MicroStrategy, Inc. Counting objects: Count metrics 87


3 Advanced Metrics Advanced Analytics Reporting

Sold in a particular year

For example, you need to find out how many customers belong to each
geographical region. You can use the Count of Customers metric, which has the
formula Count(Customer). This formula counts the number of elements
(customers) in the Customer lookup table.

By default, the Count function counts the total number of elements available
from lookup tables in the data source. However, this may not always be useful for
analysis, because the function returns the same value regardless of the objects
that you place on a report.

For example, the Count of Customers metric counts the number of elements in
the Customer lookup table. The metric always returns the value 10,000, because
the Customer lookup table contains 10,000 elements.

In this case, a count of the lookup table is not as desirable as a count on a fact
table. The following diagram shows the difference between using a fact vs. a

88 Counting objects: Count metrics 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Metrics 3

lookup table, and shows the difference in the count if one count is used over the
other.
Count Metric Lookup Table vs Fact Table

To use the Count function for this kind of analysis, you can change the function
parameters to count the elements based on a fact table rather than the lookup
table. To do this, you change the FactID parameter to be Customer ID. This forces
the metric to use a fact table containing the Customer ID. Now the Customer
Count metric calculates the number of the customers in each region.

To access parameters for any function, click Function Parameters in the Metric
Editor. Different functions use different parameters. For a description of the

2017 MicroStrategy, Inc. Counting objects: Count metrics 89


3 Advanced Metrics Advanced Analytics Reporting

parameters used for a specific function, click Details at the bottom of the Metric
Editor.

For the Count function, the parameters are:


Count Parameters

Include Distinct Elements: Determines how the elements are counted. For
example, consider a metric that counts customers using an order table. A
single customer may have ordered several times, so he will appear in the table
multiple times.
True: Only unique elements are included. In the example, each customer is
counted only once, no matter how many times he has ordered.

False: All elements are counted. In the example, each customer is counted
for each order that he made.

Include Null: Determines whether or not nulls are counted.

Use Lookup For Attributes: Is used when aggregating an attribute.



True: The unique set of attribute elements, excluding any duplicates
caused by additional attributes on the report, is aggregated.

False: All elements of an attribute, including duplicate elements that can
be included by displaying additional attributes on a report, are
aggregated.

90 Counting objects: Count metrics 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Metrics 3

FactID: Forces the calculation to take place on a specific fact table containing
the specified fact ID. The facts source table should contain data for the
attribute that is being counted.

Exercise 3.7: Create Count Item metrics


We will create two metrics that count the number of items:
Count Item counts the number of items in the data source.

Count Item (Fact) counts the number of items in the fact table that contains
the Item-Level Units Sold fact.

Create the Count Item metric

1 Click Create, and select New Metric.

2 In the Functions list on the left, double-click Count to add it to the metric
definition window.

3 Select the Item attribute:

a Click the Browse icon next to the Search for a fact, metric or attribute
box.

b Click the Attributes folder, and then the Products folder.

c Click Item.

4 Click Function Parameters.

5 In the Count Parameters window, change Include Distinct Elements to False.

If only unique (distinct) items are counted, both count metrics will return the
same number, because there is only one correct answer for the number of
items in the data source. Because each unique item is included more than
once in the fact table, the metric based on the fact table will calculate a higher
value.

6 Click OK.

7 Type Count Item in the Metric Name box.

2017 MicroStrategy, Inc. Counting objects: Count metrics 91


3 Advanced Metrics Advanced Analytics Reporting

Save the metric

8 Click Save.

9 From the Save in drop-down list, select My Reports.

10 Click Save, and then click OK on the successful save message.

Create a count metric that uses a fact table

1 Click the Count Item metric to edit it.

2 Click Function Parameters.

3 In the Count Parameters window, select Item-Level Units Sold from the
FactID drop-down list. This forces the metric calculation to use the fact table
that contains the Item-Level Units Sold fact.

4 Click OK.

Save the metric with a different name

5 Click Save As.

6 From the Save in drop-down list, select My Reports.

7 Type Count Item (Fact) in the Name box and click Save.

Create a report to display the count metrics

1 Click Create, point to New Report, and select Blank Report.

2 In the All Objects pane, click My Personal Objects, and then My Reports.

3 Double-click the Count Item metric and then the Count Item (Fact) metric to
add them to the report.

For this report, there are no attributes to place in the rows.

4 Click the Run Report icon in the toolbar.

92 Counting objects: Count metrics 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Metrics 3

The metric values are different, although they both calculate the item count.
Count Item uses a lookup table while Count Item (Fact) uses a fact table.

5 Save the report as Count Item Comparison.

As mentioned earlier, count metrics are unique in that they can use attributes as
well as facts or other metrics in their formulas. As an alternative, count metrics can
be created using facts like other metrics.

Using advanced functions in metrics


MicroStrategy offers over 200 functions including OLAP, statistical, and financial
functions. These functions also allow the use of advanced mathematics like the
statistical analytics of R. Additionally, these functions enable extended
capabilities through the relational database and/or the Analytical Engine.

Many relational database servers natively support advanced functions such as


rank, moving sum, and standard deviation. When a report includes one of these
advanced functions, Intelligence Server first determines if the database supports
that particular function. If the database supports the function, the MicroStrategy
Engine generates SQL to have the database server perform the calculation. If the
database does not support the function, the Analytical Engine performs the
calculation.

The exercises will help you learn about select examples of some commonly used
advanced functions.

Note: For a complete list of functions and their definitions, see the MicroStrategy
Functions Reference Guide.

Exercise 3.8: Create a Revenue Rank metric


In the exercise below, you will rank the revenue metric and use it on a report to
view revenue rankings for regions and categories. The exercise is also intended to
explore how different rank parameters can help you customize your rank results.

2017 MicroStrategy, Inc. Using advanced functions in metrics 93


3 Advanced Metrics Advanced Analytics Reporting

Create the rank metric

1 Click Create, and select New Metric.

2 From the drop-down list in the Functions area, select Rank and NTile
Functions.

3 In the Functions list on the left, double-click Rank to add it to the metric
definition window.
Notice that the Rank function displays parameters, rather than the level,
condition, and transformation options that we saw with the Sum and Count
functions.

Select the Revenue metric

The Rank function works on metrics, not facts.

4 Click the Browse icon next to the Rank box.

5 Click the Sales Metrics folder.

6 Click Revenue.

94 Using advanced functions in metrics 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Metrics 3

The metric should look like the following:

7 Type Revenue Rank in the Metric Name box.

Save the metric

8 Click Save.

9 From the Save in drop-down list, select My Reports.

10 Click Save, and then click OK on the successful save message.

Create a report to display the rank metric

1 Click Create, point to Report, and select Blank Report.

2 Add the Region attribute to the rows of the report.

3 Add your Revenue Rank metric to the report. (Recall that it is saved in the My
Reports folder.)

Run the report

4 Click the Run Report icon in the toolbar.

2017 MicroStrategy, Inc. Using advanced functions in metrics 95


3 Advanced Metrics Advanced Analytics Reporting

Note that the rank values range from one to eight, because the MicroStrategy
Tutorial project contains eight regions.

Save the report

5 Click the Save icon .

6 From the Save In drop-down list, select My Reports.

7 Name the report Revenue Rank Report, and click OK.

8 Click Run Newly Saved Report.

Page the report by category

Paging a report turns a report into a set of individual pages. In this case, a
page is created for each category on the report.

9 From the Tools menu, select Page-by Axis to display the Page-by area.

10 Drag the Category attribute to the Page-by area.

Category is found in the Products hierarchy.

The first page is the Books category. Notice that the range of values for
Revenue Rank is no longer 1-8. The rank is now calculated for each region and
category combination, so the rank values range from 1-32 (8 regions times 4

96 Using advanced functions in metrics 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Metrics 3

categories). Each year will display 8 of these rank values. For example, the
tenth-ranked revenue value is Books in the Central region.

11 Select a different category in the Page-by drop-down list and notice how the
Revenue Rank values change.

Save the paged report

12 From the Report Home menu, select Save As.

13 From the Save In drop-down list, select My Reports.

14 Name the report Revenue Rank Report -- Paged, and click OK.

15 Click Run Newly Saved Report.

Create a rank percentage metric

1 Click My Reports in the navigation bar at the top of the page.

2 Click the Revenue Rank metric to edit it.

2017 MicroStrategy, Inc. Using advanced functions in metrics 97


3 Advanced Metrics Advanced Analytics Reporting

3 From the Rank Order drop-down list, select Descending.

This parameter determines whether one is the lowest or highest value.


Descending means that one is the highest value. The original Revenue Rank
metric used ascending rank order, where one is the lowest.

4 For Display As, select Percentage.

This parameter determines whether the rank values are displayed as a number
(like the original Revenue Rank metric) or a percentage.

For explanations of the other rank parameters, click Details at the bottom of the
Metric Editor, where the functions description is displayed.

Save the metric with a different name

5 Click Save As.

6 From the Save in drop-down list, select My Reports.

7 Type Revenue Rank % in the Name box and click Save.

Add the rank percentage metric to the report

1 In the My Reports folder, click the Revenue Rank Report to run it.

2 In the All Objects pane, click My Personal Objects and then My Reports.

3 Double-click Revenue Rank % to add it to the report.

4 Format the new metric:

a In the menu bar, click Format.

b From the drop-down list below Format, select Revenue Rank %.

c From the next drop-down list, select Values.

d Click the Percent Style icon on the Format toolbar.

Notice that Northwest, which has the lowest Revenue Rank value (1) has the
highest Revenue Rank % value (100%). This is because of the rank order
parameter that we changed. Revenue Rank has an ascending rank order

98 Using advanced functions in metrics 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Metrics 3

(where 1 is the lowest rank) and Revenue Rank % has a descending rank order
(where 1, or 100% since this is a rank percentage, is the highest rank).

Save the report **

5 Click the Save icon .

6 From the Save In drop-down list, select My Reports.

7 Name the report Revenue Rank Report, and click OK.

8 Click Run Newly Saved Report.

Exercise 3.9: Create a RunningSum Revenue metric


A running sum metric provides a cumulative total of values based on a sort order
specified in the metric, not on the report. For example, if you needed a report that
shows dates, revenue, and month-to-date sales, you could create a month-to-date
revenue metric. The metric would use the running sum function on the Revenue
metric and sort ascending by date. MicroStrategy provides many similar OLAP
functions, such as running average, moving sum, and moving average.

In this exercise, we will create a running sum metric that adds up revenue sorted
by subcategory.

Using running sum metrics can be an alternative to level metrics. The main
difference is that the running sum function is dynamic whereas level metrics are
fixed at a specific attribute level.

2017 MicroStrategy, Inc. Using advanced functions in metrics 99


3 Advanced Metrics Advanced Analytics Reporting

Create the running sum metric

1 On any folder page, click Create and select New Metric.

2 From the drop-down list in the Functions area, select OLAP Functions.

3 In the Functions list on the left, double-click RunningSum to add it to the


metric definition window.

Select the Revenue metric

The Running Sum function works on metrics, not facts.

4 Click the Browse icon next to the ValueList box.

5 Click the Sales Metrics folder.

6 Click Revenue.

Sort by subcategory

7 In the Sort By box, begin typing Subcategory. Select the Subcategory


attribute from the list of objects that is displayed.

The metric definition should look like the following. Note that you can select
whether to sort the attribute by ID or description. For this metric, do not
change the default.

8 Type Subcategory Running Revenue in the Metric Name box.

Save the metric

9 Click Save.

100 Using advanced functions in metrics 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Metrics 3

10 From the Save in drop-down list, select My Reports.

11 Click Save, and then click OK on the successful save message.

Create a report to display the metric

1 Click Create, point to Report, and select Blank Report.

2 Add the Category and Subcategory attributes to the rows of the report.

3 Add the Revenue metric to the report.

4 Add your Subcategory Running Revenue metric to the report. (Recall that it
is saved in the My Reports folder.)

Run the report

5 Click the Run Report icon in the toolbar.

6 Format the new metric:

a In the menu bar, click Format.

b From the drop-down list below Format, select Subcategory Running


Revenue.

c From the next drop-down list, select Values.

d Click the Currency Style icon in the toolbar.


e Click the Decrease Decimal icon two times, so that the Subcategory
Running Revenue value no longer displays decimals.

The report should resemble the following. Notice that the first Subcategory
Running Revenue value, for Art & Architecture, matches the Revenue value, at
$480,173. The next Subcategory Running Revenue value adds the Art &

2017 MicroStrategy, Inc. Using advanced functions in metrics 101


3 Advanced Metrics Advanced Analytics Reporting

Architecture Revenue value to the Business Revenue value, and so on, to


create the running sum.

Save the report

7 Click the Save icon .

8 From the Save In drop-down list, select My Reports.

9 Name the report Running Revenue Report, and click OK.

10 Click Run Newly Saved Report.

Create a derived metric to restart the running sum for each category

While the running sum metric fulfills one need, we want to calculate a running
sum for each category. We can create a derived metric right in the report to
meet this requirement. While you could create a stand-alone metric to do that,
creating a derived metric means that we do not have to exit the report, create

102 Using advanced functions in metrics 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Metrics 3

the metric, and then edit the report, but can do all of that at once. However,
we cannot use the derived metric in other reports like we could with a
stand-alone metric.

11 Right-click the Revenue metric, point to Insert Metric, and select New.

12 Click Switch to Function Editor.

13 In the Search box, type RunningSum and select it from the list of functions
that is displayed.

The metric that you selected in the report (Revenue) is automatically added as
the metric to be summed, although you could change it in the ValueList box.

14 In the Break By drop-down list, select Category.

15 In the Sort By drop-down list, select Subcategory.

16 In the Metric Name box, type Break by Category.

17 Click Save.

18 Format the new metric as currency, as described previously.

The report should resemble the following. For the Books category, the two
running revenue metrics have the same values. Beginning with Electronics,
they diverge, because the Break By Category metric restarts its calculations.

2017 MicroStrategy, Inc. Using advanced functions in metrics 103


3 Advanced Metrics Advanced Analytics Reporting

For the Audio Equipment subcategory, the Revenue value and the Break By
Category value are the same.

19 Save the report.

Calculating metrics at different levels on a


report: Dynamic aggregation
Dynamic aggregation allows you to change the level of report aggregation while
you are reviewing the report results. Metric values can be aggregated at different
levels based on the reports attributes, without causing the report to re-execute
against the data source. The ability to aggregate data at a higher level in memory
is useful for quick report interaction and analysis.

Dynamic aggregation is triggered when you change which attributes are


displayed on the report. This happens when you move an attribute or attribute

104 Calculating metrics at different levels on a report: Dynamic aggregation 2017 MicroStrategy, Inc.
Advanced Analytics Reporting Advanced Metrics 3

form from the report layout (the grid display) to the Report Objects pane, or from
the Report Objects pane to the report layout. As the objects displayed on the
report change, the metric values dynamically aggregate to the new level of the
report.

For example, the following report contains the Region and Call Center attributes,
and the Revenue and Average Revenue metrics. All the objects in the Report
Objects pane (that is, included on the report) are displayed on the report grid.

2017 MicroStrategy, Inc. Calculating metrics at different levels on a report: Dynamic aggregation 105
3 Advanced Metrics Advanced Analytics Reporting

Remove Call Center from the grid, but not from the report.

The metric values are rolled up to the Region level, based on the data in the report
without generating new SQL. This is dynamic aggregation. In the report, only
Revenue values are calculated.

When reports are dynamically aggregated, values for most metrics are simply
summed.

The Revenue values can be added together correctly and are therefore
calculated at the new level. The Sum function can be calculated at a higher
level than the initial calculation.

The Average Revenue values are displayed as null values (--) because simply
summing a metric that calculates averages would produce incorrect results.
Recalculating the data at the higher level would yield erroneous or null values
when only the data in the report is used. For instance, if you added the

106 Calculating metrics at different levels on a report: Dynamic aggregation 2017 MicroStrategy, Inc.
Advanced Analytics Reporting Advanced Metrics 3

Average Revenue values for the two call centers in the Central region, the
result would be $129,076a sum, not an average.

In the Report Objects pane, Call Center is still displayed but in a darker font than
the other objects. This indicates that Call Center is available to be added to the
grid, while the other objects are already displayed on the grid.

Remove Call Center from the report.

The metric values are rolled up to the Region level, as before, but new SQL must
be generated. The report results are retrieved from the data source, so both
Revenue and Average Revenue values can be calculated. This is aggregation, as
opposed to the dynamic aggregation that occurred only with in the report in the
previous example.

This example uses a metric defined with the Average (Avg) function. Null values
are calculated during dynamic aggregation for the following functions:

Average (Avg)

CountDistinct

Geometric Mean (GeoMean)

Median

2017 MicroStrategy, Inc. Calculating metrics at different levels on a report: Dynamic aggregation 107
3 Advanced Metrics Advanced Analytics Reporting

Mode

Standard Deviation (Stdev)

Variance (Var)

In addition, null values are calculated for compound metrics, which contain
metrics combined with arithmetic operators (such as +) or non-group functions
(such as an OLAP function like Running Sum). Two facts, each with their own
aggregate operator, can aggregate to different levels that do not match the
report level or each other. When the facts are calculated at different levels,
erroneous results might be calculated for the metric when an attribute is removed
from the grid. Instead, null values are displayed.

Creating compound metrics is covered in Introduction to Analytics Reporting 10.112.

Dynamic aggregation and attributes


Another benefit of using dynamic aggregation is that attributes removed from
the grid can be easily dragged back onto the grid or the page-by area.

You can also move attribute forms between the Report Objects pane and the
report grid. If you only move an attribute form and not the attribute itself,
dynamic aggregation is not triggered. For example, the attribute forms Last Name
and First Name for the Customer attribute are displayed on a report.

You can remove First Name from the grid without triggering dynamic
aggregation. Dynamic aggregation is also not triggered if you add the ID attribute
form to the grid or move First Name back to the grid.

Note: An attribute must have at least one attribute form displayed to be on the
grid.

108 Calculating metrics at different levels on a report: Dynamic aggregation 2017 MicroStrategy, Inc.
Advanced Analytics Reporting Advanced Metrics 3

Changing the dynamic aggregation function


You can select which function is used to dynamically aggregate a metric. This
dynamic aggregation function is used in any report that the metric is placed on. A
metrics definition must use one of the following functions to allow dynamic
aggregation, because these functions can be calculated at a higher level than the
initial calculation:

Count

Maximum

Minimum

Product

Sum

For example, you can change the dynamic aggregation function for the Average
Revenue metric used in the example to Average, and override the null values.

Exercise 3.10: Change the dynamic aggregation function


In this exercise, you will create two metrics that use the average function. One will
use the automatic dynamic aggregation function and the other will use the
average function as the dynamic aggregation function.

We will use these metrics to explore how dynamic aggregation works and how
selecting a dynamic aggregation function affects the report results.

Create an revenue average metric

1 On any folder page, click Create and select New Metric.

2 In the Functions list on the left, double-click Avg to add it to the metric
definition window.

3 Click the Browse icon next to the Search for a fact, metric or attribute
box.

4 Click the Facts folder.

5 Click Revenue.

2017 MicroStrategy, Inc. Calculating metrics at different levels on a report: Dynamic aggregation 109
3 Advanced Metrics Advanced Analytics Reporting

6 Type Average Revenue in the Metric Name box.

Save the metric

7 Click Save.

8 From the Save in drop-down list, select My Reports.

9 Click Save, and then click OK on the successful save message.

Change the dynamic aggregation function

1 In the My Reports folder, click the Average Revenue metric.

2 Click Metric Options, at the top of the Metric Editor.

3 The Dynamic Aggregation Function is set to Automatic by default. From the


Dynamic Aggregation Function drop-down list, select Average.

4 Click OK.

Save the metric

5 Click Save As.

6 From the Save in drop-down list, select My Reports.

110 Calculating metrics at different levels on a report: Dynamic aggregation 2017 MicroStrategy, Inc.
Advanced Analytics Reporting Advanced Metrics 3

7 In the Name box, type Average Revenue (Avg).

8 Click Save, and then click OK on the successful save message.

Create a report to display the metrics

1 Click Create, point to Report, and select Blank Report.

2 Add the Region and Call Center attributes to the rows of the report.

3 Add the Revenue metric to the report.

4 Add your Average Revenue and Average Revenue (Avg) metrics to the
report. (Recall that they are saved in the My Reports folder.)

Run the report

5 Click the Run Report icon in the toolbar.

6 Format the new metrics:

a In the menu bar, click Format.

b From the drop-down list below Format, select All Metrics.

c From the next drop-down list, select Values.

d Click the Currency Style icon in the toolbar.

e Click the Decrease Decimal icon two times, so that the Average
Revenue (Avg) value no longer displays decimals.

2017 MicroStrategy, Inc. Calculating metrics at different levels on a report: Dynamic aggregation 111
3 Advanced Metrics Advanced Analytics Reporting

The report should resemble the following. The Average Revenue and Average
Revenue (Avg) metrics calculate the same values.

Save the report

7 Click the Save icon .

8 From the Save In drop-down list, select My Reports.

9 Name the report Dynamic Aggregation, and click OK.

10 Click Run Newly Saved Report.

Trigger dynamic aggregation by removing Call Center from the grid

11 In the grid, right-click Call Center and select Remove from Grid.

Null values are displayed for the Average Revenue metric values. Since we
forced Average Revenue (Avg) to use the Avg function for dynamic

112 Calculating metrics at different levels on a report: Dynamic aggregation 2017 MicroStrategy, Inc.
Advanced Analytics Reporting Advanced Metrics 3

aggregation, actual values are calculated for it. The Revenue metric correctly
sums the revenue at the new level.

Trigger aggregation by removing Call Center from the report

12 In the Report Objects pane, right-click Call Center and select Remove from
Report.
Both the Average Revenue and Average Revenue (Avg) metrics again calculate
the same values.

13 Exit the report but do not save it, since you removed Call Center from the
report.

2017 MicroStrategy, Inc. Calculating metrics at different levels on a report: Dynamic aggregation 113
3 Advanced Metrics Advanced Analytics Reporting

Metric summary
Feature Purpose Notes

Conditional metric Narrows the data that is returned by By default, conditional metrics
the metric ignore the filters on a report,
although this can be changed

Transformation Compares data of one time period to One-to-one comparison (like this
metric another year vs last year) or cumulative (like
month-to-date)

Advanced Extends functionality by allowing Over 200 functions including R


function OLAP, statistical, and financial language to perform calculations
functions beyond simple aggregation

Dynamic Dynamically calculating metrics at Provide flexibility to report analysis


aggregation different levels on a report

114 Metric summary 2017 MicroStrategy, Inc.


4
LEVEL AND INVENTORY METRICS
Changing the attribute level for
calculations and non-aggregatable data

Introduction
One of the most common advanced metric types is the level metric. The purpose
of a level metric is to calculate the metric at a higher level than the attributes on
the report. By default, a metric calculates at the report level, which is the lowest
attribute on the report.

2017 MicroStrategy, Inc. Introduction 115


4 Level and Inventory Metrics Advanced Analytics Reporting

For example, a regional level metric aggregates the calculation for each region,
regardless of the attributes on the report.
Level Metric Example

In the report sample above:

The Revenue metric calculates the sum of revenue at the report level, which is
employee (the report level is the lowest attribute on the report).

The Regional Revenue metric is a level metric, with a level of region.


Although its formula is the same as the Revenue metric (Sum of Revenue fact),
the attribute level causes it to calculate for each region on the report. Notice
that Regional Revenue calculates the same result for each employee in the
Central region but a different number for the Mid-Atlantic employees. The
revenue subtotal for each region is the same as the Regional Revenue for that
region.

By default, a metrics level is the report level. The report level provides flexibility
because you can reuse the same metric on many different reports, to provide
calculations at many different levels. When you place the Revenue metric on a
report containing the Employee attribute, as shown above, the metric calculates
revenue for each employee. If you remove Employee from the report, the metric
calculates regional revenue. If you place the Revenue metric on a report
containing the Category attribute, the revenue is calculated for each category.

Defining the level of a metric allows you to specify the attribute to use in the
metric calculation, regardless of the attributes on any report that you place the
metric on.

116 Introduction 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Level and Inventory Metrics 4

Level metric example: Contribution metric


Level metrics are useful for determining the contribution of one object to the
whole. For example, you need to determine the contribution to revenue and
profit of each product. The following report answers your questions, by using
level metrics to create contribution metrics. Contribution metrics are helpful for
marketing and customer service.
Contribution Metrics

Q: Which item has a higher contribution percentage to revenue than to profit?

Most of the items contribute more, proportionally, to revenue than to profit.


However, The Painted Word contributes .06% of all revenue, but only .05% to all
profit. Perhaps this book needs a larger markup.

The Revenue and Profit metrics should be familiar, since they are simply the sum
of the Revenue fact and of the Profit fact. On the surface, the contribution
percentage metrics should be just as easyitem revenue divided by all revenue,
or item profit divided by all profit. But how can you calculate at two different
levels in the same metric? The answer is a level metric, which allows you to specify
how the metric is calculated.

The % of All Revenue metric used in the example above divides the Revenue
metric by a metric called Revenue (All Products). The Revenue metric is calculated
at the report level; the report level in this report is item. A different number is
calculated for each row of the report. In contrast, the level of the Revenue (All
Products) metric has been set to item, with no aggregation. No aggregation does
not group the metric calculation by the level, so it calculates a single value, a
revenue total for all items. For the 100 Places to Go item, the % of All Revenue
metric is calculated as shown below:

Revenue / Revenue (All Products)

67,993 / 35,023,708 = 0.0019, which is .19%

For Art as Experience, the calculation is:

23,733 / 35,023,708 = 0.0007, or .07%

2017 MicroStrategy, Inc. Introduction 117


4 Level and Inventory Metrics Advanced Analytics Reporting

Defining a level
A level contains the following parts:

Level is the attribute level at which the metric calculates. Any attribute, set of
attributes, or hierarchy can be a level. This is also referred to as the target
attribute of the level.

Metric aggregations controls how the metric calculation is grouped. The


metric can either group by the target attribute (the default) or exclude it. This
determines whether the metric is going to calculate a different value for each
attribute element or one total for all of the data.

Relationship with report filter controls how the metric calculation interacts
with objects in the report filter. By default, the metric calculates for the objects
in the report filter. This setting determines whether the metric calculates for
only the specific elements in the report filter, all the targets attribute elements
in the project, or something in between those two extremes.
Level Metric in the Metric Editor

Defining whether the level metric aggregates (groups)


by the target attribute
The Metric aggregations setting controls how the metric aggregates, or groups,
the target attribute. The aggregation options are:

Standard groups by the target attribute. This option calculates a total for each
element of the target attribute.

118 Defining a level 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Level and Inventory Metrics 4

None excludes the target attribute and its child attributes from the grouping.
This option calculates one total for the target attribute and any of its child
attributes that are included on the report.

Note: In Developer, this setting is named grouping rather than aggregation.

If you are familiar with SQL, it may help to know that this setting affects the GROUP BY
clause of the SQL pass that calculates the metric.

The remaining grouping options are only used for non-aggregatable metrics,
such as inventory metrics. A non-aggregatable metric is one that should not be
aggregated across an attribute.

Beginning lookup uses the first value of the lookup table.

Ending lookup uses the last value of the lookup table.

Beginning fact accesses the first value of the fact table.

Ending fact accesses the last value contained in the fact table.

Non-aggregatable grouping options are discussed with non-aggregatable


metrics later in the lesson.

Defining the level metrics relationship with the report


filter
The Relationship with report filter setting controls how the report filter
interacts with the metric calculation. It applies only to filtering criteria that are
related to the target attribute. A report filter is related to the target attribute if
both of the following are true:
The filter qualifies on an attribute that belongs to the same hierarchy as the
target attribute.

A direct relationship exists between the target attribute and the report filter.

The filtering options are:

Standard, the default option, includes the report filter in the metric
calculation. The metric calculation includes only the attribute elements
contained in the report filter.

Absolute raises the level of the report filter to the target attribute. The metric
calculation includes all the target attribute elements that have related objects
in the report filter.

2017 MicroStrategy, Inc. Defining a level 119


4 Level and Inventory Metrics Advanced Analytics Reporting

Ignore excludes any report filtering related to the target attribute. The metric
calculation includes all the target attribute elements in the project, not just
those on the report.

None uses a particular fact table to calculate the metric. This option is
typically used with the no aggregation option.

Combining aggregation and filtering options to create a


level metric
A level metric can have one of eight different combinations of aggregation and
filtering. To explore how the different aggregation and filtering options affect a
metric calculation, we will create level metrics to help us assess how various call
centers contribute to revenue. The different options can help you answer different
reporting questions, such as what is the revenue contribution of each call center
to the total revenue, where total revenue is a level metric. The total revenue can
be calculated as a:

Regional revenue total, including only the selected call centers (Regional
Revenue (std filter std agg) metric in the report below)

Regional revenue total, including only the regions containing the selected call
centers (abs filter std agg or ignore filter std agg)

Regional revenue total for the whole company (no filter std agg)

Total revenue for the selected call centers (std filter no agg or no filter no agg)

Total revenue for the regions that contain the selected call centers (abs filter
no agg)
Total revenue for the whole company (ignore filter no agg)

120 Defining a level 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Level and Inventory Metrics 4

All eight aggregation and filtering combinations are presented in the report
below:

We will break down the different combinations, to more easily understand how
the options work together to define a level metric and provide you the results
that you need.

Exercise 4.1: Create level metrics with standard


aggregation and different filtering options
Your company has recently kicked off a new advertising campaign targeted at
certain high-growth opportunity areas. In your regions, the high-growth areas are
the following call centers:

Washington, DC

New Orleans

Seattle

Boston

Fargo

Memphis

Charleston

Therefore, you need to focus your analysis on these areas. One of your
requirements is to see how the revenue for each of these areas compares to the
other areas in its region.

2017 MicroStrategy, Inc. Defining a level 121


4 Level and Inventory Metrics Advanced Analytics Reporting

First, create a revenue metric to use as a comparison for the level metrics. The
level metrics will have a target attribute of region. The level metrics all use the
default standard aggregation, but with different filtering options. Create a report
with these metrics so that we can compare the results.

Create a Revenue metric

We will use this revenue as a comparison for our level metrics.

1 On any folder page in MicroStrategy Web, click Create and select New Metric.

2 In the Metric Editor, select Sum from the list of functions.

3 Click the Browse icon next to the Search for a fact, metric or attribute box.

4 Click the Facts folder.

5 Click Revenue.

6 In the Metric Name field, type Revenue.

Save the metric

7 Click Save.

8 In the Save As window, select My Reports from the Save In drop-down list.

9 Click Save, and then OK.

Create a level metric with standard filtering and aggregation

1 Right-click the Revenue metric, and select Copy.

122 Defining a level 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Level and Inventory Metrics 4

2 In the Name field, type Regional Revenue (std filter std agg).

3 Click OK.

4 Click the Regional Revenue (std filter std agg) metric to edit it.

Select the target attribute

5 Click the Browse icon next to the Search for attribute box.

6 Click Geography.

7 Click Region.

A new level has been added to the metric. Notice that we have not removed
the default report level. Keeping the report level allows the metric calculation
to adapt to the report. If you remove the report level, only the level explicitly
set on the metric affects the metric calculation, regardless of what the report
contains. The effects of removing the report level will be discussed later in this
lesson.

By default, a level metric has standard filtering and standard aggregation, so


we do not need to change any level options.

Save the metric

8 Click Save, and then OK.

Create a level metric with absolute filtering and standard aggregation

1 Right-click the Regional Revenue (std filter std agg) metric, and select Copy.

2 In the Name field, type Regional Revenue (abs filter std agg).

2017 MicroStrategy, Inc. Defining a level 123


4 Level and Inventory Metrics Advanced Analytics Reporting

3 Click OK.

4 Click the Regional Revenue (abs filter std agg) metric to edit it.

Set the filtering to absolute

5 Click the Level Options icon next to Region.

In the Region Level Options window, notice that the default level options are
standard filtering and standard aggregation.

6 From the Relationship with report filter drop-down list, select Absolute.

7 Click OK.

Save the metric

8 Click Save, and then OK.

Create a level metric with ignore filtering and standard aggregation

1 Right-click the Regional Revenue (std filter std agg) metric, and select Copy.

2 In the Name field, type Regional Revenue (ignore filter std agg).

124 Defining a level 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Level and Inventory Metrics 4

3 Click OK.

4 Click the Regional Revenue (ignore filter std agg) metric to edit it.

Set the filtering to ignore

5 Click the Level Options icon next to Region.

6 From the Relationship with report filter drop-down list, select Ignore.

7 Click OK.

Save the metric

8 Click Save, and then OK.

Create a level metric with no filtering and standard aggregation

1 Right-click the Regional Revenue (std filter std agg) metric, and select Copy.

2 In the Name field, type Regional Revenue (no filter std agg).

3 Click OK.

4 Click the Regional Revenue (no filter std agg) metric to edit it.

Set the filtering to none

5 Click the Level Options icon next to Region.

6 From the Relationship with report filter drop-down list, select None.

7 Click OK.

Save the metric

8 Click Save, and then OK.

Create a report to display the level metrics

1 Click Create, point to New Report, and select Blank Report.

2 In the All Objects pane, click Attributes.

2017 MicroStrategy, Inc. Defining a level 125


4 Level and Inventory Metrics Advanced Analytics Reporting

3 Click the Geography folder.

4 Double-click Region and then Call Center to add them to the rows of the
report.

5 Filter the report to display your high-growth areas, by creating a list of the call
centers to include on the report:

a Drag Call Center to the Report Filter definition pane.

b Click Select.

c Double-click the following call centers in the Available list:


Washington, DC
New Orleans
Seattle
Boston
Fargo
Memphis
Charleston

d Click Apply.

6 From the drop-down list in the All Objects pane, select My Personal Objects.

126 Defining a level 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Level and Inventory Metrics 4

7 Click the My Reports folder.

8 Double-click the metrics that you created, in the following order. This adds
them to the columns of the report:

Revenue

Regional Revenue (std filter std agg)

Regional Revenue (abs filter std agg)

Regional Revenue (ignore filter std agg)

Regional Revenue (no filter std agg)

The report should look like the following:

9 Click the Run Report icon .

10 From the Data menu, select Show Totals.

11 Save the report as Regional Revenue - standard aggregation.

2017 MicroStrategy, Inc. Defining a level 127


4 Level and Inventory Metrics Advanced Analytics Reporting

The report results should resemble the following:


Level Metrics: Standard Aggregation

Use the report filter on the level metric: Standard


filtering
Standard filtering allows the report filter to interact as usual with the metric
calculation. The metric calculation includes all the attribute elements in the report
filter.

In this example, the Regional Revenue (std filter std agg) metric calculates
regional revenue for the call centers in the report filter, since the target attribute is
region, and the filter applies to the target attribute. The value for the Regional
Revenue (std filter std agg) metric for the Central region includes revenue only for
the Fargo call center (the call center in the report filter). The other Central call
center is Milwaukee, and it is not included in the report filter, displayed on the
report, or (because of standard filtering) included in this metric calculation. The
Mid-Atlantic metric value includes the revenue for both Washington, DC and
Charleston, since both call centers are included in the report filter.

Standard aggregation calculates a regional total, and matches the regional total
displayed on the report. This is because the level metric is aggregated (or
grouped) by the target attribute of Region.

If you are familiar with SQL, the report filter is included and evaluated in the WHERE
clause of the SQL pass that calculates the metric.

128 Defining a level 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Level and Inventory Metrics 4

Use a level metric with standard filtering and standard aggregation to calculate
revenue at the level of the target attribute, filtered by the attributes in the report
filter. This type of metric can be useful when you need contribution metrics to
compare each call centers revenue to the total regional revenue, including only
the call centers displayed on the report.

Raise the report filter to the target attribute: Absolute


filtering
Absolute filtering raises the level of the report filter to that of the target attribute.
The metric calculation includes all the target attribute elements that have related
objects in the report filter.

In this example, the report filter contains elements of the Call Center attribute,
which is a child attribute of Region, the target attribute. Since the report filter is
on a level lower than the target, the filter is raised to the target attribute. In other
words, it is as though the report filter includes Region = Central (from Call Center
= Fargo), Mid-Atlantic (from Call Center = Washington, DC and Charleston),
Northeast (Call Center = Boston), and so on.

Standard aggregation groups by the target attribute of Region, so a regional total


is again calculated, like the standard filtering metric. The same value is displayed
for each call center in a specific region because the level metric is grouped.
Because of the absolute filtering, that value calculates the total revenue of all
centers in each region that has a call center in the report filter. We know that each
US region in the MicroStrategy Tutorial project has two call centers. Notice that
regions with only one call center on the report have higher Regional Revenue (abs
filter std agg) metric values than the regional totals displayed on the report. That
is because both call centers in the region are included in the metric calculation.
Regions with two call centers on the report have matching Regional Revenue (abs
filter std agg) and regional total values.

2017 MicroStrategy, Inc. Defining a level 129


4 Level and Inventory Metrics Advanced Analytics Reporting

If you remove all the other metrics from the report, you can see how the Regional
Revenue (abs filter std agg) metric is pulling in the data. All the call centers for
each region are displayed, even if they are not in the report filter.

If you are familiar with SQL, the report filter is included in the subquery of the WHERE
clause of the SQL pass that calculates the metric, if the report filter is at a lower
attribute level than the target attribute. If the report filter is at a higher level, the
subquery is not needed. This level metric is resolved in multiple passes of SQL. The
WHERE clause returns only the target attribute elements of Region where the report
filter elements of Call Center exist in the target attribute of Region.

Use a level metric with absolute filtering and standard aggregation to calculate
revenue at the level of the target attribute, filtered by the attributes in the report
filter. Unlike standard filtering, the metric calculation includes all the elements of
the targets child attributes. This type of metric can be useful when you need
contribution metrics to compare each call centers revenue to the total regional
revenue, including all call centers whether or not they are displayed on the report.

130 Defining a level 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Level and Inventory Metrics 4

Ignore report filter attributes related to the target


attribute: Ignore filtering
Ignore filtering completely disregards any report filtering criteria related to the
target attribute. The metric calculation includes all the target attribute elements
in the project, not just those on the report.

In this example, the report filter is ignored because the object in the report filter
(Call Center) is directly related to the target attribute of Region. Because standard
aggregation groups by the target attribute of Region, a regional total is
calculated, which includes the total revenue of all call centers in each region that
is displayed on the report. In this scenario, the results are the same as a level
metric with absolute filtering and standard aggregation.

Ignore filtering is usually used when the report has multiple filter qualifications,
and you do not want to include the filtering related to the target attribute in the
metric calculation. For example, this same level metric is used on a report that
contains an additional filter qualification on the Category attribute. The level
metric ignores the Call Center qualification of the report filter, but applies the

2017 MicroStrategy, Inc. Defining a level 131


4 Level and Inventory Metrics Advanced Analytics Reporting

Category qualification. The metric calculation calculates the books and movie
revenue for all the call centers in the project.

If you are familiar with SQL, the report filter elements that are directly related to the
target attribute are not included in the WHERE clause of the SQL pass that calculates
the metric.

Use a level metric with ignore filtering and standard aggregation to calculate
revenue at the level of the target attribute, ignoring any qualifications in the
report filter that are related to the target attribute. Any qualifications not related
to the target attribute are applied to the metric calculation.

132 Defining a level 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Level and Inventory Metrics 4

Exercise 4.2: Create level metrics with no aggregation


and different filtering options
You now want to perform an analysis that is similar to the previous example but
with a slightly different perspective. You want to answer the following questions:

How did the revenue for each of the high-growth call centers compare to the
revenue of the entire company?

How did the revenue of each of these call centers compare to the total of only
the selected call centers?

The answers to these questions give you an insight into how the new advertising
campaign is being received in the targeted areas. They also give you a broader
perspective on its effects on the company.

The level metrics all have a target attribute of region. The level metrics all use the
no aggregation setting, but with different filtering options. Create a report with
these metrics so that we can compare the results.

Create a level metric with standard filtering and no aggregation

1 Close the report from the last exercise and return to the My Reports folder.

2 Right-click the Regional Revenue (std filter std agg) metric, and select Copy.

3 In the Name field, type Regional Revenue (std filter no agg).

4 Click OK.

5 Click the Regional Revenue (std filter no agg) metric to edit it.

Set the aggregation to none

6 Click the Level Options icon next to Region.

7 From the Metric Aggregations drop-down list, select None.

8 Click OK.

Save the metric

9 Click Save, and then OK.

2017 MicroStrategy, Inc. Defining a level 133


4 Level and Inventory Metrics Advanced Analytics Reporting

Create a level metric with absolute filtering and no aggregation

1 Right-click the Regional Revenue (abs filter std agg) metric, and select
Copy.

2 In the Name field, type Regional Revenue (abs filter no agg).

3 Click OK.

4 Click the Regional Revenue (abs filter no agg) metric to edit it.

Set the aggregation to none

5 Click the Level Options icon next to Region.

6 From the Metric Aggregations drop-down list, select None.

7 Click OK.

Save the metric

8 Click Save, and then OK.

Create a level metric with ignore filtering and no aggregation

1 Right-click the Regional Revenue (ignore filter std agg) metric, and select
Copy.

2 In the Name field, type Regional Revenue (ignore filter no agg).

3 Click OK.

4 Click the Regional Revenue (ignore filter no agg) metric to edit it.

Set the aggregation to none

5 Click the Level Options icon next to Region.

6 From the Metric Aggregations drop-down list, select None.

7 Click OK.

134 Defining a level 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Level and Inventory Metrics 4

Save the metric

8 Click Save, and then OK.

Create a level metric with no filtering and no aggregation

1 Right-click the Regional Revenue (ignore filter no agg) metric, and select
Copy.

2 In the Name field, type Regional Revenue (no filter no agg).

3 Click OK.

4 Click the Regional Revenue (no filter no agg) metric to edit it.

Set the filtering to none

5 Click the Level Options icon next to Region.

6 From the Relationship with report filter drop-down list, select None.

7 Click OK.

Save the metric

8 Click Save, and then OK.

Add the new metrics to a report

1 Open the Regional Revenue - standard aggregation report.

2 Remove all the metrics from the grid display except the Revenue metric.
Right-click each metric in turn and select Remove from Grid.

Removing the metric from the grid keeps it in the Report Objects pane. You
can then more easily add it back to the display. If you remove it from the
report, you have to locate it the All Objects pane before you can add it.

3 In the All Objects pane, click My Personal Objects.

4 Click the My Reports folder.

2017 MicroStrategy, Inc. Defining a level 135


4 Level and Inventory Metrics Advanced Analytics Reporting

5 Double-click the new metrics, in the following order. This adds them to the
columns of the report:

Regional Revenue (std filter no agg)

Regional Revenue (abs filter no agg)

Regional Revenue (ignore filter no agg)

Regional Revenue (no filter no agg)

Save the report

6 From the Report Home menu, select Save As.

7 Save the report as Regional Revenue - no aggregation.

8 Click Run newly saved report.

If you select Return to Original Report instead, you are returned to the Regional
Revenue - standard aggregation report, with your changes. You do not want to
save your changes to that report name.

The report results should resemble the following:


Level Metrics: No Aggregation

What is the main difference between these metric values and the standard
aggregation level metrics (see Level Metrics: Standard Aggregation, page 128)?

136 Defining a level 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Level and Inventory Metrics 4

No aggregation level metrics are not grouped (aggregated), so they calculate the
same value for each row of a report. In other words, they provide totals, at specific
levels. Standard aggregation level metrics are grouped, so a different value is
calculated for each element of the target attribute (in this example, for each
region).

Use the report filter on the level metric: Standard


filtering
Standard filtering allows the report filter to interact as usual with the metric
calculation. The metric calculation includes only the attribute elements included
in the report filter.

The Regional Revenue (std filter no agg) metric calculates regional revenue for the
call centers in the report filter, since the target attribute is region, and the filter
applies to the target attribute.

The no aggregation setting calculates a single value for all the rows in the report,
which matches the revenue grand total displayed on the report. This is because
the level metric is not aggregated by Region. The value is all the revenue for all
the call centers in the report.

Use a level metric with standard filtering and no aggregation to calculate total
revenue at the level of the target attribute, filtered by the attributes in the report
filter. This type of metric can be useful when you need contribution metrics to
compare each call centers revenue to the total revenue, including only the call
centers displayed on the report. This type of metric can help answer the question
of how the revenue of each call centers compare to the total of the selected call
centers.

Raise the report filter to the target attribute: Absolute


filtering
Absolute filtering raises the level of the report filter to the target attribute. The
metric calculation includes all the target attribute elements that have related
objects in the report filter.

In this example, the report filter contains elements of the Call Center attribute,
which is a child attribute of Region, the target attribute. Since the report filter is
on a lower level than the target, the filter is raised to the target attribute. In other
words, it is as though the report filter includes Region = Central (from Call Center
= Fargo), Mid-Atlantic (from Call Center = Washington, DC and Charleston),
Northeast (Call Center = Boston), and so on.

2017 MicroStrategy, Inc. Defining a level 137


4 Level and Inventory Metrics Advanced Analytics Reporting

The no aggregation setting calculates a single value for all the rows in the report.
This is because the level metric is not aggregated by Region. The value is all the
revenue of all centers in all regions that have a call center in the report filter.

Use a level metric with absolute filtering and no aggregation to calculate total
revenue at the level of the target attribute, filtered by the attributes in the report
filter. Unlike standard filtering, the metric calculation includes all the elements of
the targets child attributes. This type of metric can be useful when you need
contribution metrics to compare each call centers revenue to the total revenue of
the regions included on the report.

Ignore report filter attributes related to the target


attribute: Ignore filtering
Ignore filtering completely disregards any report filtering criteria related to the
target attribute. The metric calculation includes all the target attribute elements
in the project, not just those on the report.

In this example, the report filter is ignored because the object in the report filter
(Call Center) is directly related to the target attribute of Region. As with the other
no aggregation metrics, a single value is shown for all the rows in the report, since
the metric is not aggregated. The value is a total revenue, for all call centers in all
regions.

Ignore filtering is usually used when the report has multiple filter qualifications,
and you do not want to include the filtering related to the target attribute in the
metric calculation.

Use a level metric with ignore filtering and no aggregation to calculate total
revenue, ignoring any qualifications in the report filter that are related to the
target attribute. Any qualifications not related to the target attribute are applied
to the metric calculation. This type of level metric can help answer the question of
how the revenue for each of the selected call centers compare to the revenue of
the entire company.

Specify the fact table to use: No filtering


No filtering allows you to specify the fact table to use to calculate a metric. You
add as many target attributes as necessary to the metric to force it to calculate
against a specific fact table. Any target attribute set to the None filtering option
borrows its filtering criteria from the other target attributes specified in the
dimensionality of the metric, enabling you to choose the fact table without
altering the original intent of the report.

138 Defining a level 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Level and Inventory Metrics 4

In this example, the city_ctr_sls fact table, which is an aggregate fact table, is
used. You can check this in the report SQL. To view the SQL, from the Tools menu,
select Report Details Page.

from (select a11.CALL_CTR_ID CALL_CTR_ID,

sum(a11.TOT_DOLLAR_SALES) WJXBFS1

from `tutorial_wh`.`city_ctr_sls` a11

If you want to use the item_emp_sls fact table instead, include the Item attribute
as a target attribute of the level metric. (You can have multiple target attributes
on the same level metric.) Since the Item attribute is found in the item_emp_sls
table and not the city_ctr_sls table, including Item as a target forces the
MicroStrategy Engine to use the item_emp_sls fact table. If data is stored
differently in the item_emp_sls table, results could be different.

The Regional Revenue metric in the following report sample uses two target
attributes:

Target attribute = Region, Standard filtering and aggregation

Target attribute = Item, No filtering and aggregation

The report SQL for the report:

from (select a13.REGION_ID REGION_ID,

sum(a11.TOT_DOLLAR_SALES) WJXBFS1

from tutorial_wh`.`item_emp_sls` a11

In the SQL, the report filter is not included in the WHERE clause of the SQL pass that
calculates the metric.

2017 MicroStrategy, Inc. Defining a level 139


4 Level and Inventory Metrics Advanced Analytics Reporting

Standard aggregation compared to no aggregation


The following report helps summarize the difference between standard
aggregation and no aggregation.
Standard vs. No Aggregation

For the standard filter:

Standard aggregation calculates a regional total, and matches the regional


total displayed on the report. This is because the level metric is aggregated (or
grouped) by the target attribute of Region.

No aggregation calculates a single value for each row in the report, which
matches the revenue grand total displayed on the report. This is because the
level metric is not aggregated by Region. The value is all the revenue for all the
call centers in the report.

For the absolute filter:

Standard aggregation calculates the total revenue of all centers in each region
that has a call center in the report filter. Notice that regions with only one call
center on the report have higher Regional Revenue (abs filter std agg) metric
values than the regional totals displayed on the report. That is because both
call centers in the region are included in the metric calculation. Regions with
two call centers on the report have matching Regional Revenue (abs filter std
agg) and regional total values.

No aggregation calculates a single value for each row, which matches the
Regional Revenue (abs filter std agg) grand total. This is because the level

140 Defining a level 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Level and Inventory Metrics 4

metric is not aggregated by Region. The value is all the revenue of all centers
in all regions that have a call center in the report filter.

Interacting with the context of reports:


Report level
When you create a metric, the level is set by default as the report level. The metric
calculates at the level of the attributes on the report on which the metric is
placed. When you create a level metric, you add a target attribute to the metric;
you do not replace the report level.

Keeping the report level allows the metric calculation to adapt to the report. For
example, a metric calculates revenue at the report level and the item level. If this
revenue metric is placed on a report containing region, the region attribute
affects the metric calculation, along with the level explicitly set on the metric
(item). If you put the same metric on a report with customer, the customer
attribute, as well as the metric level, is used in the metric calculation.

Removing the report level


Earlier in this lesson, you learned how to use the ignore filtering and no
aggregation settings to create a metric that calculates the total revenue for the
entire company. If the report contains multiple hierarchies, this method requires
you to include multiple target attributes in the level metric. However, another
option is to remove the default report level from the level metric, and then add
any attribute as a target attribute with no aggregation. If the report level is
removed, only the level explicitly set on the metric affects the metric calculation,
regardless of what the report contains.

For a refresher about ignore filtering and no aggregation, see Ignore report filter
attributes related to the target attribute: Ignore filtering, page 138.

For example, you need to evaluate how much revenue each customer region-call
center-category combination contributes to overall revenue. The report to
provide this information must contain attributes from multiple hierarchies:

Customer Region, from the Customers hierarchy

Call Center, from the Geography hierarchy

Category, from the Products hierarchy

A level metric without the report level forces the revenue calculation to include all
revenue company-wide. You can easily remove aggregation and calculate the

2017 MicroStrategy, Inc. Interacting with the context of reports: Report level 141
4 Level and Inventory Metrics Advanced Analytics Reporting

metric across all hierarchies. Removing the report level is a quick and easy way to
do something that would otherwise involve multiple steps. Instead of adding
customer region, call center, and category as target attributes, you can simply
remove the report level and add category as a target attribute, with no
aggregation. A portion of the report is shown below:

The Revenue Contribution is a derived metric, created within the report from
Revenue/All Revenue.

142 Interacting with the context of reports: Report level 2017 MicroStrategy, Inc.
Advanced Analytics Reporting Level and Inventory Metrics 4

You can reuse the same All Revenue level metric on a report with different
attributes from different hierarchies, as shown in the report sample below:

The presence of the default report level on a metric tells the MicroStrategy Engine
to group by all the attribute IDs found on the report. By removing the report level
from the metric and selecting no aggregation for any other available target
attribute, the MicroStrategy Engine understands that there should not be a
GROUP BY clause in the SQL pass that calculates the metric. You can use any
attribute for this purpose. You do not need to add more than one attribute unless
specific filtering behavior is required for the metric.

If the metric needs to be filtered, add other target attributes, but each should use
no aggregation.

2017 MicroStrategy, Inc. Interacting with the context of reports: Report level 143
4 Level and Inventory Metrics Advanced Analytics Reporting

Exercise 4.3: Removing the report level to calculate all


revenue
You want to compare regional revenue to all revenue. While we create the metrics
and report to provide this analysis, we will also explore how the presence and
absence of the report level affects metric calculation.
Report Level Example

Create a revenue metric with report and item levels

1 In the My Reports folder, right-click the Revenue metric, and select Copy.

2 In the Name field, type Revenue: Report & Item.

3 Click OK.

4 Click the Revenue: Report & Item metric to edit it.

Add item as a target attribute

5 In the Search for attribute box in the Level area, type item.

Save the metric

6 Click Save, and then OK.

144 Interacting with the context of reports: Report level 2017 MicroStrategy, Inc.
Advanced Analytics Reporting Level and Inventory Metrics 4

Create a revenue metric with item level and no report level

1 In the My Reports folder, right-click the Revenue: Report & Item metric, and
select Copy.

2 In the Name field, type Revenue: Item.

3 Click OK.

4 Click the Revenue: Item metric to edit it.

Remove the report level

5 Click the Delete icon next to Report Level in the Level area.

Save the metric

6 Click Save, and then OK.

Create a report to display the level metrics

1 Click Create, point to New Report, and select Blank Report.

2 In the All Objects pane, click Attributes.

3 Click the Geography folder.

4 Double-click Region to add it to the rows of the report.

5 From the drop-down list in the All Objects pane, select My Personal Objects.

6 Click the My Reports folder.

7 Double-click the following metrics that you created, in the specified order.
This adds them to the columns of the report:

2017 MicroStrategy, Inc. Interacting with the context of reports: Report level 145
4 Level and Inventory Metrics Advanced Analytics Reporting

Revenue

Revenue: Report & Item

Revenue: Item

8 Click the Run Report icon .

9 From the Data menu, select Show Totals.

10 Save the report as Removing the Report Level.

The report results should resemble the following:

The Revenue metric (which is calculated at the report level) and the Revenue:
Report & Item metrics calculate the same result, providing the revenue for each
region. The Revenue: Item metric calculates the revenue for all items, for all
regions, in each row. The number is therefore the same for each row, since the
metric does not differentiate between regions. The number is the same as the
grand total of the report.

Create a contribution metric in the report (a derived metric)

1 Right-click any metric in the report, point to Insert Metric, and select New.

2 In the Metric Editor window, double-click Revenue in the Objects list.

146 Interacting with the context of reports: Report level 2017 MicroStrategy, Inc.
Advanced Analytics Reporting Level and Inventory Metrics 4

3 Click the division icon in the toolbar above the formula definition area.

4 Double-click Revenue: Item in the Objects list. The metric formula should
look like the following:

5 In the Metric Name box, type Revenue Contribution.

6 Click Save.

Format the derived metric

7 Click Revenue Contribution to select it.

8 Click Format in menu toolbar. In the Format toolbar, Revenue Contribution


should be selected.

9 In the next drop-down list, select Values.

10 Click % in the Format toolbar.

The report should resemble the Report Level Example, page 144.

11 Save the report.

Level metric summary


Use the following table to create level metrics that answer your most common
reporting questions. The examples use a level metric that calculates revenue, with

2017 MicroStrategy, Inc. Level metric summary 147


4 Level and Inventory Metrics Advanced Analytics Reporting

a target attribute of category. The level metric is placed on a report with category
and subcategory. The report is filtered by subcategory.

Result Filtering Aggregation

Revenue at the category level, including only the subcategories Standard Standard
displayed on the report

Revenue at the category level, for all subcategories in the categories Absolute Standard
displayed on the report

Total revenue for the subcategories displayed on the report Standard None

Total revenue for all subcategories in the categories displayed on Absolute None
the report

Total revenue for all subcategories in the project Ignore None

If the report contains multiple hierarchies, you can remove the


report level, as a shortcut.

Review level metrics


Identify the target, filtering, and aggregation for the level metrics in the following
reports.
Report 1

148 Review level metrics 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Level and Inventory Metrics 4

Level metric: Regional Revenue

Target: ____________________________________________________

Filtering: __________________________________________________

Aggregation: ______________________________________________

Report 2

Level metric: Entire Region Revenue

Target: ____________________________________________________

Filtering: __________________________________________________

Aggregation: ______________________________________________

2017 MicroStrategy, Inc. Review level metrics 149


4 Level and Inventory Metrics Advanced Analytics Reporting

Report 3

Level metric: All Selected Call Center Revenue

Target: ____________________________________________________

Filtering: __________________________________________________

Aggregation: ______________________________________________

150 Review level metrics 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Level and Inventory Metrics 4

Report 4 contains nearly every type of level metric that you learned about in this
lesson. The target of each level metric is Region. What is the filtering and
aggregation for each?
Report 4

Metric A: ____________________________________________________

Metric B: ____________________________________________________

Metric C: ____________________________________________________

Metric D: ____________________________________________________

Metric E: ____________________________________________________

Metric F: ____________________________________________________

2017 MicroStrategy, Inc. Review level metrics 151


4 Level and Inventory Metrics Advanced Analytics Reporting

Review solutions, part I


Report 1

Target: Region

Filtering: Standard

Aggregation: Standard

Report 2

Target: Region

Filtering: Absolute or Ignore

Aggregation: Standard

Report 3

Target: Region

Filtering: Standard

Aggregation: None

Report 4

Metric A:
Filtering: Absolute
Aggregation: None

Metric B:
Filtering: Absolute or Ignore
Aggregation: Standard

Metric C:
Filtering: Ignore
Aggregation: None

Metric D:

Filtering: Absolute or Ignore

Aggregation: Standard

152 Review level metrics 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Level and Inventory Metrics 4

Metric E:

Filtering: Standard

Aggregation: None

Metric F:
Filtering: Standard
Aggregation: Standard

Review, part II
Read the following level metric descriptions. For each level metric, identify the
target, filtering, and grouping.

1 A metric that calculates the sum of revenue across all regions, including only
the regions represented by the call centers in the report filter. The report
contains the Region and Call Center attributes and the level metric.

Target: ____________________________________________________

Filtering: __________________________________________________

Aggregation: ______________________________________________

2 A metric that calculates the sum of units sold for each region in Q4 2015,
considering only the call centers that are included in the report filter. The
report contains the Region and Call Center attributes and the level metric.

Target: ____________________________________________________

Filtering: __________________________________________________

Aggregation: ______________________________________________

2017 MicroStrategy, Inc. Review level metrics 153


4 Level and Inventory Metrics Advanced Analytics Reporting

Condition: ________________________________________________

3 A metric to calculate the sum of profit for 2015 across all customer states
regardless of the customer cities that are included in the report filter. The
report contains the Customer State and Customer City attributes and the level
metric.

Target: ____________________________________________________

Filtering: __________________________________________________

Aggregation: ______________________________________________

Review solutions, part II


Metric 1

Target: Region

Filtering: Absolute

Aggregation: None

Metric 2
Target: Region

Filtering: Standard

Aggregation: Standard

Condition: Quarter = Q4 2015

Metric 3

Target: Customer State

Filtering: Ignore

Aggregation: None

154 Review level metrics 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Level and Inventory Metrics 4

Non-aggregatable metrics
Metrics like Inventory, which should not be summed across an attribute or
hierarchy, are considered non-aggregatable metrics. These metrics are typically
used for snapshots in time, such as an end of year or beginning of quarter
inventory.

Your data source may keep an inventory value for each quarter, as an
end-on-hand count. But this inventory data is not aggregated (added together) to
calculate a yearly inventory figure. A metric that added the inventory values for all
four quarters in a year would be inflated because it would duplicate the same
items. It makes more sense to obtain an end-on-hand or beginning-on-hand
inventory number for each year to analyze how inventory changed over the
course of the year.

The following report contains two different End on Hand metrics, which return
very different values.
Yearly Inventory Report

The End on Hand metric is a non-aggregatable level metric, which shows the
inventory values for the last month in each year, rather than summing
inventory over time. The years last month value is used because the data
source records inventory values on a monthly basis.

The End on Hand (Aggregated) metric is a regular metric which aggregates


the End on Hand fact values for the entire year. It is incorrect because
inventory values were never that high at any point in the year, as shown in the
next report, which displays the correct monthly end on hand figures for the
first year. The yearly total is incorrectly calculated as a total of all the monthly
values, which matches the End on Hand (Aggregated) yearly value in the

2017 MicroStrategy, Inc. Non-aggregatable metrics 155


4 Level and Inventory Metrics Advanced Analytics Reporting

previous report. You can also see that the December value matches the End
on Hand for the year in the previous report.

In this example, the End on Hand inventory metric is defined as non-aggregatable


for the Month attribute, which indicates that the metric values should not be
summed at the level of month or any attribute higher than month.

You can use an entire hierarchy instead of a single attribute in an


non-aggregatable level metric. For example, specifying the Time hierarchy as the
target attribute in a metric indicates that the metric is non-aggregatable across all
attributes in the Time hierarchy.

Defining a non-aggregatable metric


A non-aggregatable metric is a specific type of level metric, which looks at the
beginning or end of a time period. The metric can retrieve the information from
either a fact table or a lookup table.

A lookup table is a physical representation of attributes, providing the ability


to aggregate data at different levels. Lookup tables store the information for
each attribute in ID and description columns.

A fact table stores fact data. Since attributes provide the context for fact
values, fact tables include both fact columns and attribute ID columns. Facts
help link attributes that are indirectly related. The attribute information in a
fact table represents the level that the facts are stored at in that table.

156 Non-aggregatable metrics 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Level and Inventory Metrics 4

To define a non-aggregatable metric, you specify a target attribute, which causes


the metric to ignore any other attributes and only look at data from that level. You
also select one of the following aggregation options:

Beginning fact: To use the first available value in the fact table

Ending fact: To use the last available value in the fact table

Beginning lookup: To use the first available value in the lookup table

Ending lookup: To use the last available value in the lookup table

For example, you need to view monthly inventory values. The image below shows
the lookup table and the fact table that store the inventory and time data.

The fact table does not store the stock amount for the first week of the month
(Week_ID = 1). The first stock value in the fact table is for the second week of the
month (Week_ID = 2). In this type of scenario, if you define the aggregation on
your inventory metric as beginning lookup, the lookup table is used to identify
the beginning week of the month. According to the lookup table, the beginning
week has a Week_ID of 1. Since the fact table does not include a stock value for
that week, the metric calculates a null value for the first month.

If you define the aggregation on your inventory metric as beginning fact, the fact
table is used to identify the beginning week of the month. According to the fact
table, the beginning week has a Week_ID of 2. The metric calculates a value of 10
for the first month.

The MicroStrategy Tutorial project captures inventory by quarter, so beginning on


hand and end on hand quantities are recorded for each month in each quarter.

2017 MicroStrategy, Inc. Non-aggregatable metrics 157


4 Level and Inventory Metrics Advanced Analytics Reporting

Exercise 4.4: Create a yearly beginning inventory metric


You need to know what the beginning on hand inventory is for each quarter.
Create a non-aggregatable metric to calculate the inventory.

Create the inventory metric

1 On any folder page in MicroStrategy Web, click Create and select New Metric.

2 In the Metric Editor, select Sum from the list of functions.

3 Click the Browse icon next to the Search for a fact, metric or attribute box.

4 Click the Facts folder.

5 Click Begin on Hand.

Select the target attribute

6 Click Show All to display the metrics components.

7 In the Search for attribute box, type Year. From the drop-down list of
matching attributes, select Year.

Set the metric aggregation

8 Click the Level Options icon next to Year. You do not have to change the
default standard filtering option.

9 From the Metric Aggregations drop-down list, select Beginning fact.

10 Click OK.

Save the metric

11 In the Metric Name field, type Begin On Hand (Year).

12 Click Save.

13 From the Save In drop-down list, select My Reports.

14 Click Save, and then OK.

158 Non-aggregatable metrics 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Level and Inventory Metrics 4

Create a report to display the inventory metric

1 Click Create, point to New Report, and then select Blank Report.

2 Add the Year and Quarter attributes to the report rows.

3 Add the Beginning on Hand (Year) metric (saved in My Reports) to the report
columns.

View the report results

4 Click the Run Report icon .

The report results should resemble the following:

Why does the metric calculate the same value for each quarter in a given year?

The metrics target attribute is year, so the metric calculates at the year level,
returning a single value for each year, not each quarter.

2017 MicroStrategy, Inc. Non-aggregatable metrics 159


4 Level and Inventory Metrics Advanced Analytics Reporting

The MicroStrategy Tutorial provides a standard beginning inventory metric


which calculates at the quarter level.

Add the quarterly beginning inventory metric

5 Click the Design icon on the toolbar to edit the report.

6 In the All Objects pane, click Metrics, then Inventory Metrics.

7 Add the Begin on Hand metric to the report columns.

View the report results

8 Click the Run Report icon .

160 Non-aggregatable metrics 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Level and Inventory Metrics 4

The report results should resemble the following:

Notice that the value calculated for the first quarter of each year is the same as
that calculated for the year. We can create a derived metric to calculate the
difference from the years beginning inventory for each quarter. This helps you
analyze how your inventory fluctuates through the year.

Create a derived metric

9 Right-click the Begin on Hand metric, point to Insert Metric, and select New.

10 In the Metric Editor window, double-click Begin On Hand (Year) in the


Objects list.

11 Click the subtraction icon in the toolbar above the formula definition area.

12 Double-click Begin on Hand in the Objects list. The metric formula should
look like the following:

13 In the Metric Name box, type Difference from Yearly BOH.

14 Click Save.

2017 MicroStrategy, Inc. Non-aggregatable metrics 161


4 Level and Inventory Metrics Advanced Analytics Reporting

The report results should resemble the following:

Save the report

15 Save the report as Quarterly Beginning Inventory in the My Reports folder.

Creating advanced metrics using the Formula


Editor
Up to this point we have used the Function Editor to quickly and easily create
metrics. The Function Editor allows you to select functions and add levels,
conditions, and transformations in an easy-to-use interface.

You can instead use the Formula Editor, which allows you to create a metric that:

Combines multiple metrics to create a single compound metric (for example,


Revenue Metric - Profit Metric)

Creates nested metrics, with multiple layers of functions

Contains custom expressions, such as percent-to-total metrics or expressions


that use custom functions created with the MicroStrategy Function Plug-In
Wizard

You type the metric formula directly into the Formula Editor, and can add levels,
conditions, and transformations using symbols that define the expression syntax.

162 Creating advanced metrics using the Formula Editor 2017 MicroStrategy, Inc.
Advanced Analytics Reporting Level and Inventory Metrics 4

For example, the Northwest Revenue metric created in the conditional metrics
exercise looks like the following in the Formula Editor:

You may recognize Sum(Revenue) in the formula, from working in Developer.

UseLookupForAttributes is a parameter for the Sum function.

{~+} indicates that the metric is calculated at the report level.

The condition is represented by <[Northwest Region];@2;->.


Northwest Region is the name of the filter; it is in brackets [ ] because it is
a two-word name.

@ indicates the interaction between the metric filter and the report filter;
the 2 denotes that merge report filter into metric is selected.

- indicates that the Ignore Related Report Filter Elements check box is
cleared. (A + is displayed when the check box is selected.)

The QTD Profit metric created in the transformation metrics exercise looks like the
following in the Formula Editor:

The name of the transformation, Quarter to Date, is included between pipe


symbols | |. The remainder of the formula is similar to the Northwest Revenue
metric.

2017 MicroStrategy, Inc. Creating advanced metrics using the Formula Editor 163
4 Level and Inventory Metrics Advanced Analytics Reporting

The level metric shown below calculates the revenue at the level of the Region
attribute:

Level information is provided between curly braces { }.

Region is the attribute level.

The symbol in front of the attribute is the aggregation setting. ! indicates no


aggregation (as indicated in the name of the metric).

The symbol behind the attribute is the filter setting. % indicates the ignore
filtering.

For a full list of the symbols used in the expression syntax, see Appendix A, Metric
Symbols.

You can switch between the Formula Editor and the Function Editor, as long as
the expression is valid. For example, you can type the syntax for a base formula
into the Formula Editor, and then switch to the Function Editor to easily add
levels, a condition, and a transformation. Using a base formula called Revenue
Base Formula, you can type the following expression in the Formula Editor:

164 Creating advanced metrics using the Formula Editor 2017 MicroStrategy, Inc.
Advanced Analytics Reporting Level and Inventory Metrics 4

Switch to the Function Editor, and you can use the drop-down lists to specify
metric components, instead of typing the symbols.

You will use the Function Editor to create a metric in the next section.

Nested metrics
Nested metrics are metrics that have multiple layers of formulas affected by
multiple levels. For example, you need a report a report that provides the average
employee revenue for each region. You can create a report that calculates the

2017 MicroStrategy, Inc. Nested metrics 165


4 Level and Inventory Metrics Advanced Analytics Reporting

revenue for each employee, and then averages those results for each region. The
report sample below displays the results for the first few regions:
Employee Revenue and Regional Average Report

But you do not want to see each employees revenue, just the average regional
revenue. You can create a nested metric that:

1 Calculates the revenue for each employee

2 Averages all the employee revenue for each region

The formula for this metric looks like the following:

AVG(Sum(Revenue){~,Employee}) {~,Region}

The metric has an inner formula, Sum(Revenue), calculated at the Employee


level. It has an outer formula that averages the results of the inner formula for
each region. This metric does exactly what the Revenue metric and the Average

166 Nested metrics 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Level and Inventory Metrics 4

subtotal did in the report, but in a single metric. This single metric is used on a
report with region, as shown below:
Nested Metric: Average Employee Revenue Per Region Report

The Average Employee Revenue value for each region matches the Average
subtotal for each region in the Employee Revenue and Regional Average Report,
page 166.

Even without levels, this Average Employee Revenue metric is a nested metric,
because it uses one function inside of another. Each function would use the
default level (the report level). The formula shown below still makes two
calculations:

AVG(Sum(Revenue))

Use nested aggregation to calculate an inner metric at one particular attribute


level, store this as an intermediate result set, and perform another calculation on
this result set at an entirely different attribute level. This functionality and
flexibility is very useful when fact tables in the data source do not store data at the
level desired for a specific type of analysis.

Note: Applying {~, Employee} to the Sum(Revenue) metric means that the metric
calculates at the Employee level regardless of what attributes display on the final
report.

Nested metrics:

Are based on either facts or attributes (not metrics)

Place one aggregation function inside another

Aggregation functions are Sum, Average, Maximum, and so on.

Can use levels, conditions, and transformations

2017 MicroStrategy, Inc. Nested metrics 167


4 Level and Inventory Metrics Advanced Analytics Reporting

In contrast, a compound metric combines metrics with an arithmetic operator.


You cannot apply a level, condition, or transformation to a compound metric,
while you can apply them to a nested metric since it is a simple metric.

A compound metric can also use a non-group function such as an OLAP function or a
scalar function. Compound metrics are covered in Introduction to Analytics Reporting
10.112.

Nested metrics are basically a special type of simple metric in which one simple
metric calculation is performed to enable the calculation of another simple
metric. You can use them when the level at which data is stored in the data source
precludes being able to calculate and analyze data at the desired level. Nested
metrics provide an alternative to modifying physical data source tables.

Exercise 4.5: Create a nested metric


You need to see the maximum employee profit value for each region. Create a
nested metric that first calculates the profit for each employee (the inner formula).
Next, for each region, the maximum employee profit is selected (the outer
formula). Placed on a report with region, the metric values are calculated as
shown below:
Max Regional Employee Profit Sample

Create a nested metric

1 On any folder page in MicroStrategy Web, click Create and select New Metric.

2 Click Switch to Formula Editor, at the bottom left of the screen.

168 Nested metrics 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Level and Inventory Metrics 4

Add the aggregation functions

While it is often more practical to type the full formula into the metric definition
area, selecting functions, facts, and attributes allows you to see how the formula is
constructed.

3 Double-click Max in the list of functions.

4 Double-click Sum in the list of functions.

The metric formula should look like the following:

Create the inner formula

5 From the drop-down list below All Objects, select Schema Objects.

6 In the All Objects area, click the Facts folder.

7 In the All Objects area, double-click Profit to add it to the formula.

The metric formula should look like the following:

8 In the formula definition area, move your cursor between the two ending
parentheses, as shown below:

9 To add the employee level for the inner formula, type the following in the
formula definition area. When the list of matching objects displays, select the
Employee attribute.

{~,Employee}

The formula should look like the following:

2017 MicroStrategy, Inc. Nested metrics 169


4 Level and Inventory Metrics Advanced Analytics Reporting

Add the level for the outer formula

10 Move the cursor to the end of the formula, outside of all the parentheses, as
shown below:

11 To add the region level, type the following in the formula definition area.
When the list of matching objects displays, select the Region attribute.

{~, Region}

The formula should look like the following:

Validate the formula

12 Click Validate.

The valid formula message displays at the bottom of the formula definition
area.

The metric looks like the following in the Function Editor. This interface plainly
shows that the outer formulas aggregation formula (Max) is applied to the
inner formula, (Sum(Profit){~,Employee}) The Level contains only the Region
attribute, since Region is applied to the Max function, not the Sum function.

170 Nested metrics 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Level and Inventory Metrics 4

Save the metric

13 In the Metric Name box, type Max Regional Employee Profit.

14 Click Save.

15 From the Save in drop-down list, select My Reports.

16 Click Save, and then click OK on the successful save message.

Create a report to display the nested metric

1 Click Create, point to New Report, and select Blank Report.

2 In the All Objects pane, click Attributes.

3 Click the Geography folder.

4 Double-click Region to add it to the rows of the report.

5 From the drop-down list in the All Objects pane, select My Personal Objects.

6 Click the My Reports folder.

7 Double-click the Max Regional Employee Profit metric to add it to the


report.

Run the report

8 Click the Run Report icon .

The report should resemble the Max Regional Employee Profit Sample,
page 168.

Save the report

9 From the Report Home menu, select Save As.

10 Save the report as Max Regional Employee Profit.

11 Click Run newly saved report.

2017 MicroStrategy, Inc. Nested metrics 171


4 Level and Inventory Metrics Advanced Analytics Reporting

Level metric summary


Feature Purpose Notes

Level metric Allows data to be calculated at a By default, metrics are calculated at


specific attribute level. Filtering and the report level, that is, the level of
grouping can be altered to achieve the attributes on the report.
the desired result.

Non-aggregatable Aggregation should not be performed A kind of level metric, frequently


metric on these values used for inventory

Nested metric Combines multiple metrics and Individual metrics can be at


formulas into one metric different levels

172 Level metric summary 2017 MicroStrategy, Inc.


5
ADVANCED FILTERS

Introduction
In addition to simple filters, MicroStrategy can employ advanced filters. In our
discussion of advanced metrics, we saw how a simple filter can be used in
Conditional Metrics (Region = Northwest). However, filters can be more complex.
Filters can combine metrics and attributes to further sort and analyze data.

Advanced attribute qualifications

Attribute-to-attribute filtering
Attribute-to-attribute comparison allows users to create reports that compare the
values of two attributes. For example, you can create a report that retrieves only
those orders that were shipped within 4 days of their order date by comparing

2017 MicroStrategy, Inc. Introduction 173


5 Advanced Filters Advanced Analytics Reporting

Ship Date with Order Date + 4. The two attributes being compared are Ship Date
and Order Date, as shown below:
Attribute-to-Attribute Filtering

Joint element list


Joint element lists are combination filters that specify more than one attribute in
addition to specific combinations (for example, Northeast Region and 2012,
Central and 2013). Joint element list filters allows for pairs, triplets, quadruplets,
etc., to be used.

Exercise 5.1: Access MicroStrategy Developer


In this exercise we return to MicroStrategy Developer, which you will use for the
filter exercises.

Access MicroStrategy Developer

1 Click the landing page bookmark that you created earlier on the browsers
bookmarks bar.

2 If you are prompted to log in, type (or copy and paste) the login credentials
provided in the Welcome to MicroStrategy on AWS email.

174 Advanced attribute qualifications 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Filters 5

3 On the MicroStrategy Cloud landing page, under Administration, click


Remote Desktop Gateway.

4 In the Remote Desktop Connection window, in the Username and Password


boxes, enter the user name and password listed in your Welcome to
MicroStrategy on AWS email.

5 Under All Connections, click Developer Instance RDP.

You are connected to the Windows machine in your cloud environment.

6 Click the Developer shortcut icon.

7 Log in with the user name and password listed in your Welcome to
MicroStrategy on AWS email.

MicroStrategy Developer opens.

Exercise 5.2: Create a Joint element list filter

Activate the advanced qualification option

1 In the Object Browser, right-click the MicroStrategy Tutorial project and


select My Preferences.

2 On the My Preferences dialog box, expand the Editors category on the left,
then click Filter.

3 On the right, select Show Advanced Qualification.

4 Click OK.

Create a filter

5 From the File menu, point to New, then select Filter.

6 In the Filter Editor, double-click in the Filter definition pane to add a


qualification.

7 In the Filtering Options pane, select Add an Advanced Qualification and


click OK.

8 In the Advanced Qualification pane, select Joint element list in the Option
drop-down list.

2017 MicroStrategy, Inc. Advanced attribute qualifications 175


5 Advanced Filters Advanced Analytics Reporting

9 Select Region and Year from the Available Attributes list and click > to add
them to the Selected Attributes list.

10 Add Northeast and 2012 as an element combination:

a Click the Add icon to add an element combination. The first value in
each attribute is added to the list.

b Click the Modify icon.

c In the Select Elements dialog box, select Region in the Available


Elements drop-down list.

d In the list of Available Elements, double-click Northeast to add it to the


Selected Elements list.

e Select Year in the Available Elements drop-down list.

f Double-click 2012 to add it to the Selected Elements list.

g Select OK. The Northeast-2012 combination is now displayed in the


Element List.

11 Complete the same steps for the second element combination, of Central and
2013.

12 Click OK.

176 Advanced attribute qualifications 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Filters 5

13 Click Save and Close. Save the filter as Joint Element List.

Create a report to use the joint element list

14 Right-click in the Object Browser, point to New, and select Report.

15 In the New Grid dialog box, select Blank Report and click OK.

16 Add the Region and Year attributes to the rows of the report.

17 Add the Revenue metric to the columns.

18 Drag the Joint Element List filter to the Report Filter pane.

19 Run the report.

Dynamic dates
Simple filters will allow for static dates to be used as filters. For example, a simple
static filter like Day = December 22, 2012 can be used. But dynamic dates can be
used for changes that are relative to the execution time of the report. For

2017 MicroStrategy, Inc. Advanced attribute qualifications 177


5 Advanced Filters Advanced Analytics Reporting

example, a dynamic filter can be created for This Month which will filter the report
based on whatever month the report runs in.

Dynamic dates are a fixed set of dates or a range of dates that change over time.
These dates are fixed offsets of the current date according to the system clock of
the Intelligence Server machine (or the client machine in the case of a Direct
connection (a two-tier environment)). Dynamic date qualifications can be as
specific as any of the following:

Monday of this week

Today minus an offset of 2 months and 1 day

The 4th of this month

The 3rd Wednesday of last month

May 5th of next year

The Date Editor offers the choice of a static date or various types of dynamic
dates:

Today

This Week

This Month

This Year

Each choice provides users with several options for the starting point. You can
add or subtract days, weeks, months, or years. At the bottom of the editor is a
preview section that shows the date a dynamic date resolves to, based on the
current system clock. The user is shown what dates are going to be applied when

178 Advanced attribute qualifications 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Filters 5

the report is run. In this filter (Last 7 Days), the report starts on July 8, 2015, if
today is July 15, 2015.
Date Editor Options

If working in a Server connection (a three-tier environment), the date in the


preview window is based on the client machine and not the Intelligence Server
machine. However, when executing the report containing the dynamic date, the
Intelligence Servers system clock is used.

Exercise 5.3: Create a dynamic date filter for Last 7 Days


1 From the File menu, point to New, then select Filter.

2 In the Filter Editor, double-click in the Filter definition pane to add a


qualification.

3 Choose Add an Attribute Qualification and click OK.

4 Type Day in the Choose an Attribute box.

5 Click OK.

6 In the Ambiguity dialog box, select Day Attribute and click OK.

7 In the Qualify On drop-down list, select ID.

2017 MicroStrategy, Inc. Advanced attribute qualifications 179


5 Advanced Filters Advanced Analytics Reporting

8 In the Operator drop-down list, select Greater Than.

9 Click the Date Editor icon .

10 In the Date and Time Editor, choose Dynamic Date.

180 Advanced attribute qualifications 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Filters 5

11 From the Today drop-down, select Minus. Change Days to 7.

12 From the drop-down list near Months, select Minus. To match the dates
available in the Tutorial warehouse, increase the number in the Months box
until the date resolves to 2013.

13 Click OK.

14 Click OK.

15 Click Save and Close. Save the filter as Last 7 Days.

Import filter elements


Elements of the filter add a level of flexibility to MicroStrategy. Users can select
from a shorter list of elements rather than having to sort through all of the
elements in an attribute. For example, on an attribute like Customer, which may
have hundreds of elements, it is easier to use import filter elements than go
through every single elements.

2017 MicroStrategy, Inc. Advanced attribute qualifications 181


5 Advanced Filters Advanced Analytics Reporting

To import elements into a filter, the elements need to be stored in a Microsoft


Excel or text file. The following rules apply when importing elements from source
files. There is a limit of 65,535 characters for the list:

1 Microsoft Excel: Data can be stored in rows, columns, or both.



If it has double quotes in the first and last position, it is imported as is (with
the quotes).

If it has single quotes in the first and last position, it is imported as is (with
the quotes).
If it does not fall under either of the first two bullets, it is checked to
determine if it is a number. If so, it is imported as is.

If it does not fall under either of the first two bullets, it is checked to
determine if it is a date. If so, it is imported by adding single quotes at the
beginning and end to comply with the date format.
If it does not fall in any of the previous cases, it is assumed to be a text
value and is imported by adding double quotes at the beginning and end
to comply with the text format.

2 Text

Tab-delimited

List-delimited as specified in the regional settings

Return-delimited

Exercise 5.4: Import filter elements of Region


1 Create a text file in Notepad and add the following text, separated by returns:

Northeast

Northwest

2 Save the file as text.

Create the filter

3 From the File menu, point to New, then select Filter.

4 Double-click in the Filter definition pane to add a qualification.

5 In Filtering Options, select Add an Attribute qualification and click OK.

182 Advanced attribute qualifications 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Filters 5

6 For Attribute, type Region and click OK.

7 For Qualify On, select DESC.

8 For Operator, select In List.

9 Click Import.

10 In the Import Elements from File window, browse to the file that you created,
select the file, and click Open.

11 The elements that exist in the file are imported into the List box. Click OK.

12 In the Filter Editor, click Save and Close, and save it as East, West Filter.

Pass-through functions
MicroStrategy can leverage functions of RDMS databases if they are the data
source by passing through them. This additional functionality can be used for
metrics and attributes.

A specialized Apply function represents each type of custom subexpression/


function call. There are five predefined Apply functions used to replace regular,
predefined functions of the same type:

2017 MicroStrategy, Inc. Advanced attribute qualifications 183


5 Advanced Filters Advanced Analytics Reporting

ApplySimple: Uses simple arithmetic operators. This pass-through function


is used for defining metrics, filters, and attribute form expressions.

ApplyAgg: Uses aggregate functions (Sum, Max, and so forth). This


pass-through function is used primarily for defining metrics.

ApplyOLAP: Uses OLAP functions (Rank, RunningSum, and so forth). This


pass-through function is used primarily for defining metrics.

ApplyComparison: Uses comparison operators (>=, <, Like, and so forth).


This function is used primarily for defining filters.

ApplyLogic: Uses logical operators (not, and, or, and so forth). This function
is used primarily for defining filters.

The purpose of all of the pass-through functions in Developer is to bypass the


MicroStrategy parser and send database-specific syntax to the database server.
They can be used in many different capacities, including the creation or
modification of schema and application objects. It is important to remember,
though, that MicroStrategy also provides many functions and operators that
serve the same purpose as pass-through functions. In a reporting scenario where
users can choose between a pass-through function or MicroStrategy function to
achieve the same result, testing must be done on both methods to see which one
returns the result set more efficiently.

Generally, the syntax for Apply functions is as follows:

ApplyFunctionName (Pattern, Arg, Arg,..Arg)

where:

ApplyFunctionName: Generic name used for one of the predefined


pass-through functions (described above)
Pattern: String describing the actual expression (syntax) used by the
MicroStrategy Engine when generating the SQL to be sent to the RDBMS

Arg: Argument that replaces the parameter markers in the pattern

For example, ApplyComparison can be used to create a complex filtering at the


database level. A filter can be created to limit results to Regions where the Profit
was less than Last Years Profit. This comparison will appear in the WHERE clause
of any report.

184 Advanced attribute qualifications 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Filters 5

Exercise 5.5: Profit Greater Less Than Last Years Profit


1 From the File menu, point to New, then select Filter. Double-click in the Filter
definition pane to add a qualification.

2 Select Add an Advanced Qualification and click OK.

3 In the Custom Expression box, type:

ApplyComparison("#0 < #1", [Profit], [Last Years


Profit])

Note: You can copy and paste the expression to save time, but you must type
[Last Years Profit]), not copy and paste it.

4 Click Validate.

5 Click OK.

6 Click Save and Close. Save the filter as Profit Less Than Last Years
Profit.

7 Create a new report.

8 Add the Region and Month attributes to the rows.

9 Add the Profit metric to the columns.

10 From the Sales Metrics\Transformation folder, add the Last Years Profit
metric.

11 Add the Profit Less Than Last Years Profit filter.

2017 MicroStrategy, Inc. Advanced attribute qualifications 185


5 Advanced Filters Advanced Analytics Reporting

12 Run the report.

Set qualifications
Set qualifications are filters that use metrics to define the filter.

Advanced metric qualifications


Set qualifications based on metrics specify that a certain criteria of metrics will
determine which results are filtered. For example, to find the current regions and
current profit that had a Profit over $2,000 last year, a filter will need to be created
that first applies limits based on metrics. Metric qualifications have three major
methods:

Metric value: The value on which to qualify the metric. For example, metric
value greater than or equal to 100 returns rows for that metric that are 100 or
higher.

Rank: The numeric rank of values. For example, rank top 40 returns the 40
highest values for the selected metric.

Percent: Percentage of the values being ranked. For example, percent top 10
returns all values in the top 10% for the selected metric.

186 Advanced attribute qualifications 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Filters 5

Output level
Metric qualifications can also set the output level. The output level of the metric
qualifier is the set of attributes by which the metric is to be evaluated.

When defining the output level, there are three calculation options:
None selected: This is the default setting. If this option is selected, the
results are calculated at the report level, as long as the metric is a compound
metric or its dimensionality is set to report level or nothing. Otherwise, the
metric's dimensionality is used.

Calculate the output at the metric level: Metric level means that the
output level is defined by the level, or dimensionality, of the metric itself,
regardless of the level of the report. The qualification follows the metrics level
of calculation.

Calculate the output at the report level: This setting looks to the lowest
level of the attributes that appear on the report template. Looking back to one
of the previous examples, if Year and Day are on a report, the filter restricts the
data to the set of days (because Day is at a lower level than Year) with profit
greater than $2,000. As another example, if Item and Day are on the report,

2017 MicroStrategy, Inc. Advanced attribute qualifications 187


5 Advanced Filters Advanced Analytics Reporting

the result set returns the items with profit greater than $2,000 on a given day
(the intersection of the two unrelated attributesItem and Day).

Calculate the output for the list of attributes: The attribute (or attributes)
at which the qualification are selected to be evaluated with this setting.
Output Level Options

The following is an example of a metric qualification with an output level of Year:

188 Advanced attribute qualifications 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Filters 5

Profit > 2000, Output Level: Year

In a case where you qualify on a simple metric, like Profit, which calculates at
None selected by default, the result behaves the same as the report output level.
In both cases, the metric evaluates to the lowest attribute on the report template.
But also you can see the difference when you selected the metric level option in
the output.

Break-by
Break-by lets you choose the attribute level at which to restart the rank or
percentage for a metric. This level must be greater than or equal to the level of
aggregation of the metric.

A metric qualification filter that ranks the top 2 items by Units Sold returns only
those two items, as shown below:
Top 2 Items by Units Sold

2017 MicroStrategy, Inc. Advanced attribute qualifications 189


5 Advanced Filters Advanced Analytics Reporting

Modifying the qualification to include break by Category generates different


results:
Top 2 Items by Units Sold Break By Category

Exercise 5.6: Create a Revenue over 1000 metric


1 From the File menu, point to New, then select Filter. Double-click in the Filter
definition pane to add a qualification.

2 Select Add a Set Qualification.

3 Click OK.

4 Browse to and select the Revenue metric.

5 Change Operator to Greater than.

6 Type the value as 1000.

7 Click OK.

190 Advanced attribute qualifications 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Filters 5

8 Click Save and Close. Save the filter as Revenue over 1000.

Relationship filters
The second type of metric qualification filter uses unrelated attributes and facts or
tables to define a relationship between them, to limit the results of a report. This
process is similar to using a report as a filter. A common usage is a market basket
analysis where a set of sold items is compared to another set of items.

There are several parts to defining a relationship filter:

Output level is a list of the attributes on which to apply the filter. It dictates the
contents of the relationship filters output set, similar to what a template does
in a report. In SQL terms, it is responsible for the GROUP BY clause.

The filter qualification defines filtering criteria to appear in the WHERE clause
of the nested subquery.

The relation (or Relate By) is defined through a fact, a table, or the system
default. When you select the Use System Default option, the MicroStrategy
Engine picks a table based on the project schema. However, most often, a

2017 MicroStrategy, Inc. Advanced attribute qualifications 191


5 Advanced Filters Advanced Analytics Reporting

specific fact or table should be selected; this establishes the relationship


between the output level(s) and the filter qualification. From a SQL
perspective, the fact or table that defines the relation impacts the FROM
clause of the SQL query that corresponds to the relationship filter.

The advanced option by default will Add the relationship filter independently
of the filter. If selected, the filter qualification created within the relationship
filter will be applied to both relationship filter and report. If not selected, the
filter qualification is only applied within the relationship filter. In other words,
the filter qualification is only included in the SQL statement that resolves the
relationship qualification (subquery) and not the outer query that resolves the
report as a whole.

Exercise 5.7: Create a Relationship filter


1 From the File menu, point to New, then select Filter. Double-click in the Filter
definition pane to add a qualification.

2 Double-click in the Filter definition pane.

3 In Filter Options, select Add a Set Qualification and click OK.

4 In Set Qualification Type, from the Type drop-down list, select Relationship.

5 Under Output Level, click the Browse button.

6 In the Level window, move the Customer attribute from the Available
Objects window to the Selected Objects window, and click OK.

7 Under Filter Qualification, click Create to create a filter. Create an attribute


qualification filter with the following definition:

Item=Old Man and the Sea

8 Click Save and Close.

9 The filter should use the Revenue fact to relate the output level and filter
qualification attributes:

In the Relate By drop-down list, select Browse.

From the drop-down list, select Fact.

From the Objects of Type drop-down list, select Fact.

Double-click Revenue.

192 Advanced attribute qualifications 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Filters 5

If you keep the system default option, the MicroStrategy Engine uses the project
schema to determine how to relate the filter qualification and the output level.

10 Click OK to save the qualification.

11 Click Save and Close to save the filter.

Filter summary
Feature Purpose Notes

Attribute-to-attribute qualification Compare values of two


attributes

Joint element list Allow a combination of different Northeast region and year 2012
attributes to filter the data

Dynamic date Filter by dates that are not static Last 7 days
and need to change constantly

Import filter element Use custom element lists instead Practical for attributes with
of listing all elements needed high cardinality like Customer
Name

Pass-through function Use RDMS functions instead of Functionality passes to the


having MicroStrategy perform RDMS in SQL for SQL-based
the function data sources

Set qualification Filter data based on sets of other Qualify on metrics or


data relationships

2017 MicroStrategy, Inc. Filter summary 193


5 Advanced Filters Advanced Analytics Reporting

194 Filter summary 2017 MicroStrategy, Inc.


6
ADVANCED ATTRIBUTES

Derived attributes
Users can create and edit attributes within Report Services documents that can be
created based on attribute forms, metrics, or a combination.

Exercise 6.1: Access MicroStrategy Web


Derived attributes are available in MicroStrategy Web. In this exercise we open
MicroStrategy Web to work with advanced attributes.

Access MicroStrategy Web

1 Close Developer.

2 Click the landing page bookmark that you created earlier on the browsers
bookmarks bar.

3 If you are prompted to log in, type (or copy and paste) the login credentials
provided in the Welcome to MicroStrategy on AWS email.

2017 MicroStrategy, Inc. Derived attributes 195


6 Advanced Attributes Advanced Analytics Reporting

4 On the MicroStrategy Cloud landing page, click MicroStrategy Web.

5 On the MicroStrategy Tutorial Home page, click Go to MicroStrategy Web, in


the upper right corner, to open the Shared Reports folder of the MicroStrategy
Tutorial project.

Create a derived attribute

1 In MicroStrategy Web, create a new document.

2 In the Dataset Objects window, right-click the attribute or metric, and select
Insert New Attribute.

3 In the Attribute Editor, drag and drop the attribute, metric, and/or functions as
needed.

4 Name the attribute in the Attribute box.

5 Click Save.

Derived elements
Derived elements are on-the-fly grouping of attributes defined by a list, filter, or
calculation. Derived elements can also be used to perform aggregations, other
analysis, and formatting.

For example, you can group data for the months of December, January, and
February into a single element that combines and displays the data for the entire
winter season. You can use derived elements to create these groups on the fly
while viewing a report. Derived elements are evaluated on the report dataset
without regenerating or re-executing SQL. Derived elements are defined by using
a list, filter, or calculation to combine attribute element data.

Filter derived elements


The first type of derived elements is filter derived elements. This type is created by
a filter qualification. The filter qualification can be created using lists of attribute
elements or attribute forms.

196 Derived elements 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Attributes 6

Group derived elements


The second type of derived elements is created from groups of attributes and
called Group Derived Elements. Derived elements can only be created from
attribute elements and not from other derived elements.
Group Derived Element

2017 MicroStrategy, Inc. Derived elements 197


6 Advanced Attributes Advanced Analytics Reporting

Calculation derived elements


The last type of derived element is created by operators and functions to combine
attribute elements and existing derived elements.
Calculation Derived Element

The All Other derived element


There is an automatically created derived element called All Other which captures
all elements not specifically defined by derived elements. All Other lists them
individually by default.

Creating derived elements


Derived elements do not regenerate or re-execute SQL. There are three ways to
create derived elements: create quick groups and calculations, use the Derived
Elements Editor, and create stand-alone derived element creation.

198 Derived elements 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Attributes 6

Create quick groups and calculations


There are three ways to quickly create derived elements: Groups, Calculations and
Sorts. This quick method does not present the user with all the functionality of
derived elements.

Quick groups

Right-clicking grids allows the user to aggregate elements into groups.

Exercise 6.2: Create a quick group


1 Browse to Public Objects, then Reports, then MicroStrategy Platform
Capabilities, then MicroStrategy OLAP Services, then Intelligent Cubes and
View Reports.

2 Run the report View Report - All Project Languages.

3 Press CTRL and select multiple attribute elements for the same attribute in the
grid display of the report.

4 Do not select derived elements for the attribute, as you cannot create quick
groups on derived elements. To group derived elements, you must use the
Derived Elements Editor.

5 Right-click your selection and select Create Group.

6 In the Defining Group window, type a name for the derived element, and click
OK.

2017 MicroStrategy, Inc. Exercise 6.2: Create a quick group 199


6 Advanced Attributes Advanced Analytics Reporting

The group is created as a derived element and displayed on the report. You can
modify the derived element using the Derived Elements Editor.

Quick calculations
You can also right-click the elements to group using calculations with basic
arithmetic operations. The operations that can be performed are:

Add

Subtract

Average

Greatest

Least

Divide

Every operation can be performed if there are two attribute elements. If there are
more than two elements, Subtract and Divide are not available using this quick
option. To use subtraction and division the Derived Elements Editor can be used.

Exercise 6.3: Create a quick calculation


1 Browse to Public Objects, then Reports, then MicroStrategy Platform
Capabilities, then MicroStrategy OLAP Services, then Intelligent Cubes and
View Reports.

2 Run the report View Report - All Project Languages.

3 Press CTRL and select multiple attribute elements for the same attribute in the
grid display of the report.

200 Exercise 6.2: Create a quick group 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Attributes 6

4 Right-click your selection, point to Create Calculation and select one of the
following calculations:

5 In the Create Calculation window, type a name for the derived element and
click OK.

Use the Derived Elements Editor


Derived Elements Editor

2017 MicroStrategy, Inc. Exercise 6.2: Create a quick group 201


6 Advanced Attributes Advanced Analytics Reporting

The Derived Elements Editor presents the user with all the functionality of derived
elements.

1 Browse to Public Objects, then Reports, then MicroStrategy Platform


Capabilities, then MicroStrategy OLAP Services, then Intelligent Cubes and
View Reports.

2 Run the report View Report - All Project Languages.

3 Right-click the Region attribute and select Derived Elements.

4 In the Derived Elements Editor, click the New drop-down list, and select List.

Two new derived elements are created, a blank group derived element and an
All Other derived element.

5 Select the New List derived element.

6 In the Definition tab, from the left pane, select attribute elements to include in
the group and click > to add your selections to the group derived element.
This moves the attribute elements to the Selected objects pane.

7 To rename the derived element, from the Change Element drop-down list,
select Rename Derived Element. Type a name for the derived element.

8 From the Change Element drop-down list, you can format derived element
headers and values.

9 You can change the order in which the derived elements are displayed on the
report using the up and down arrows.

10 You can continue to create more derived elements, or you can click OK to
close the Derived Elements Editor and return to the report.

11 To save the derived element as a stand-alone object, click Save. This object
can be shared by multiple reports and by Grid/Graphs on documents.

To create a new filter derived element

1 Click the New drop-down list and select Filter. Two new derived elements are
created, a blank filter derived element and an All Other derived element.

2 Select the new Filter derived element.

3 In the Definition tab, click Click here to start a new qualification.

202 Exercise 6.2: Create a quick group 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Attributes 6

4 Create the qualification by defining the Field, Operator, and Value fields.

5 You can continue to create more derived elements, or you can click OK to
close the Derived Elements Editor and return to the report.

6 To create a new Calculation derived element, click the New drop-down list
and select Calculation. Two new derived elements are created, a New
Calculation derived element and an All Other derived element.

7 Select the New Calculation derived element. This displays the available
attribute elements in the Definition tab.

8 In the Definition tab, select attribute elements to include in the calculation


expression, and add them to the expression area as shown below. You can also
use the toolbar above the expression to include operators and functions, as
well as validate or clear the expression.

9 You can continue to create more derived elements, or you can click OK to
close the Derived Elements Editor and return to the report.

2017 MicroStrategy, Inc. Exercise 6.2: Create a quick group 203


6 Advanced Attributes Advanced Analytics Reporting

Create stand-alone derived elements


Creating stand-alone derived elements allows them to be shared in multiple
reports unlike the previous two methods. They can be created in a report or
outside of a report using Developer.

1 To create the stand-alone derived element, in Developer, log in to the


MicroStrategy Tutorial project.

2 From the File menu, point to New and select Derived Element.

3 In the Select Attribute window, browse to and select the attribute to base your
derived element on. Click Open.

4 In the Derived Elements Editor, you can create list, calculation, or filter derived
elements to define your stand-alone derived elements by selecting an option
in the New drop-down list.

5 After you create the required derived element click Save and Close.

6 In the Save Derived Element As window, type a name and click Save.

To share the derived element

1 Right-click the attribute to apply a stand-alone derived element to, and select
Derived Elements. If an attribute already has a derived element defined for
it in the report, applying a stand-alone derived element overwrites the
existing definition.

2 In the Derived Elements Editor, click Link.

3 In the Select Derived Elements window, browse to and select the derived
element to apply to the attribute.

4 Click Open.

5 Click OK to save your changes and close the Derived Elements Editor.

A stand-alone derived element can be modified. This updates the derived


element in all the reports it is used in. Since these modifications are applied to
multiple reporting objects, the stand-alone derived element must be updated
itself. It cannot be updated from a report.

204 Exercise 6.2: Create a quick group 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Attributes 6

To modify a stand-alone derived element, right-click the stand-alone derived


element and select Edit.

Formatting derived elements


Formatting options are only available from the Derived Elements Editor. Headers
and values can be formatted.

1 In the Derived Elements Editor, select a derived element.

2 On the Change Element menu, point to Format and select from the available
options.

3 After you are finished formatting derived elements headers or values, click
OK.

4 Click OK to save your changes and close the Derived Elements Editor.

Interaction with other reporting features


Because of their nature, derived elements react with certain features in specific
ways.

View filters
View filters cannot use derived elements.

Derived metrics
Derived metrics can perform column math like derived elements and do not
require users to regenerate or re-execute SQL. They are sometimes better
represented by derived elements. If smart metrics are required, derived elements
may calculate incorrectly due to evaluation order.

To create a derived metric

1 Open a report in Grid view.

2 From the Insert menu, select New Metric.

2017 MicroStrategy, Inc. Exercise 6.2: Create a quick group 205


6 Advanced Attributes Advanced Analytics Reporting

3 In the Input Metric Formula window, in the Metric Name box, type a name
for the derived metric.

4 In the metric definition pane on the right, define the derived metric formula
using the available objects in the Report Objects folder combined with
functions and operators.

As in the Metric Editor, you can use the Insert Function Wizard to define a
derived metric formula.

5 Click OK to add the derived metric to the report.

6 To format the derived metric, right-click its header, and select Formatting.

After a derived metric is created, you can remove it from the report display like
you would any other object.

Because of MicroStrategy OLAP Services, you can also use built-in derived metrics.
Many common metrics that are typically defined in terms of other metrics are
available from the Insert menu. By right-clicking a metric header in your report,
and then pointing to the Insert menu, you can insert a derived Percent-to-Total,
Transformation, or Rank metric based on your selected metric.

206 Exercise 6.2: Create a quick group 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Attributes 6

Page-by
Derived elements may be used in a page-by. The attribute name is shown in the
page-by but the derived elements are shown in the selection.
Derived Element in Page-By

2017 MicroStrategy, Inc. Exercise 6.2: Create a quick group 207


6 Advanced Attributes Advanced Analytics Reporting

Thresholds
For derived elements, thresholds cannot be created using attributes in the
derived element.
Regional Profit

Threshold Editor

208 Exercise 6.2: Create a quick group 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Attributes 6

Derived Elements with Thresholds

To create a threshold

1 Open a report in either Grid view or Grid and Graph view.

2 Right-click the metric to add a threshold to, and choose Thresholds.

3 In the Thresholds dialog box, type a new name to replace the default New
Threshold.

Specify the qualification

A qualification can be "Region In list {Northeast, Mid-Atlantic, Southeast}" or


"Profit Greater than 10000", for example.

4 Click the text Click here to start a new qualification.

5 Click Field and select the attribute or metric to qualify on.

6 Click Operator and select an operator.

7 Click Value and define a value to compare to.

2017 MicroStrategy, Inc. Exercise 6.2: Create a quick group 209


6 Advanced Attributes Advanced Analytics Reporting

Specify the formatting

8 Next, specify the type of formatting to apply to the selected metric. Click
Format and select one of the following from the drop-down list:

To change the formatting only, select Format. You can apply colors,
patterns, or gradients to the threshold values or make them transparent.

To replace the selected metric with text, select Replace Text. Type the
new text in the (text) box to the right.

To replace the selected metric with a symbol, click Quick Symbol.


Choose the symbol from the selection in the box to the right.

To replace the selected metric with an image, click Image. Select how the
image is stored, and then specify the image path.

9 If you selected any option except Image, click the Edit the threshold
formatting icon on the toolbar to apply formatting.

10 Define the formatting, then click OK to return to the Thresholds dialog box. A
preview of the selected formatting is displayed.

Specify whether to apply threshold formatting to subtotals

11 Select one of the following:

To apply the threshold formatting to the metric only (the default), click the
Metric Only icon on the toolbar.

To apply the formatting to the metrics subtotals only, not the metric itself,
click Subtotals Only .

To apply the formatting to the metric and its corresponding subtotals, click
Metric And Subtotals .

Save the threshold

12 Click OK to save the threshold.

210 Exercise 6.2: Create a quick group 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Attributes 6

Drilling
When drilling on data in a derived element, the data is restricted to the attribute
elements in the derived element.
Regional Profit without Drilling

Drilling down on the East Coast to the Call Center.


Regional Profit after Drilling to Call Center

2017 MicroStrategy, Inc. Exercise 6.2: Create a quick group 211


6 Advanced Attributes Advanced Analytics Reporting

Prompts
Prompts dynamically modify reports before data display or SQL generation. The
selections made when answering prompts may change the data displayed in an
attribute that is changed in the derived element. Derived elements will only use
elements available after the SQL generation of the report, which may have an
effect on the results of the derived elements.
Feature Interaction with Derived Elements

Consolidations and custom groups


Both custom groups and consolidations group attribute elements together in a
template. Consolidations use attribute elements to make groupings, while
custom groups use filters to create groups. Custom groups have more flexibility
than consolidations but also require more SQL creation.
Differences between Custom Groups and Consolidations

Consolidations
Consolidations groups attribute elements together. Consolidations can act as
virtual attributes and perform row-level math. In acting like virtual attributes

212 Consolidations and custom groups 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Attributes 6

consolidations avoid the need to change the data model. Row-level math can
include constants and simple arithmetic operations.

Consolidations elements can consist of attribute elements of the 1) same


attribute, (2) different level attributes, (3) unrelated attributes, and (4) existing
consolidation elements.

For example, suppose you want to see each season of the year as a separate row
on a report, but Season does not exist as an attribute in your project. A
consolidation allows you to group together the elements of the Month of Year
attribute into various seasons and place them on the template. This consolidation
will contain four consolidation elements, one for each season.

Exercise 6.4: Create North Region Consolidation


1 From the File menu, point to New and select Consolidation.

2 Choose Empty Consolidation, and click OK.

3 In the Elements for this consolidation pane, click Click here to add new
consolidation element.

4 Type North to name the consolidation element.

5 In the Object Browser pane, double-click the Geography hierarchy, and then
double-click Region.

6 Drag Northeast and Northwest from the Object Browser into the Selected
Element pane.

7 Click Save and Close. Save the consolidation as North Consolidation.

Custom groups
An alternative to consolidations is custom groups. Using filters, custom groups
create virtual attributes that are similar to a collection of smaller reports. In this
regard, custom groups use numerous intermediate tables and multiple SQL
passes, depending on the complexity of the filters.

Exercise 6.5: Create Custom Regions Group


1 Open the Custom Group Editor.

2017 MicroStrategy, Inc. Consolidations and custom groups 213


6 Advanced Attributes Advanced Analytics Reporting

2 Double-click to create the group.

3 Name the group as US.

4 Click Add Qualifications.

5 Select Attribute Qualification.

6 Select Region as the attribute.

7 Click Add.

8 Add Central, Mid-Atlantic, Northeast, Northwest, South, Southeast, and


Southwest.

9 Click OK twice.

10 Double-click to create a new Group. Name it Web.

11 Click Add qualifications.

12 Select Attribute qualification.

13 Select Region as the attribute.

14 Click Add.

15 Add Web.

16 Click OK twice.

17 Save and Close as Custom Regions.

18 Create a new report.

19 Choose Blank Report.

20 Add the Region attribute.

21 Add the Revenue metric.

22 Add the Custom Regions custom group.

214 Consolidations and custom groups 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Attributes 6

23 Run the report.

Custom group banding


Custom groups can also use banding to create new groups of elements. Banding
options consist of band size, band count, banding points, and band for each
distinct metric value.

Because banding involves metrics, a level must be selected when defining a


custom group banding qualification. The Level setting indicates the level at which
to apply the banding qualification.

Band size slices a range of values into equal-sized bands. Using band size
manually defines the start and stop as well as the number of steps.
Custom Banding by Band Size

Band count splits the band into equal-sized bands by count. Banding points
allows users to control the exact placement of bands. This option provides the
greatest degree of flexibility when assigning bands.

2017 MicroStrategy, Inc. Consolidations and custom groups 215


6 Advanced Attributes Advanced Analytics Reporting

The band for each distinct metric value allows the creation of a separate band for
each value calculated by the metric. The bands appear as rows on a report. This
type of banding qualification uses the results of a metric as bands. It is very useful
when used with metrics that already contain the logic needed to calculate
sequential band numbers. These include metrics that use mathematical formulas,
NTile functions, Band functions, or Case functions.

For example, a metric uses the NTile function to group revenue values into three
groups, and the elements are also sliced into three bands as shown below:
Custom Banding by Metric Value

To create a custom group banding qualification

1 In the Custom Group Editor, under Custom Group definition, double-click to


add a custom group element.

2 Name your custom group element.

3 Double-click Add Qualification.

4 Under Custom Group Options, click Add a Custom Group Banding


qualification.

216 Consolidations and custom groups 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Attributes 6

5 Click OK.

6 For Metric, select a metric on which to base the custom group banding.

7 For Band on, use the drop-down menu to select how you want to band:
Metric Value, Rank, or Percent.

8 For Banding type, select how you want to create your bands: Band Size,
Band Count, Banding Points, and Band for each distinct metric value.

9 Based on the banding type you select, set the corresponding properties.

10 Click Level.

11 In the Level window, in the Output tab, add the appropriate attribute level at
which you want to band and click OK.

12 Click OK.

13 To customize the display of the band names, right-click the custom group
element and select Show Band Names Editor.

14 In the Band Name Editor, click Add to add new band names and Edit to
rename existing band names.

15 Click OK.

16 In the Custom Group Editor, click Save and Close.

2017 MicroStrategy, Inc. Consolidations and custom groups 217


6 Advanced Attributes Advanced Analytics Reporting

218 Consolidations and custom groups 2017 MicroStrategy, Inc.


7
IMPROVING PERFORMANCE:
INTELLIGENT CUBES

Introduction
Goals:

Understand the concept of Intelligent Cubes.

Create and publish Intelligent Cubes.

Intelligent Cubes
Intelligent Cubes are multi-dimensional cubes (sets of data) that can be shared as
a single in-memory copy among many different reports created by multiple users.
Rather than returning data from the data warehouse for a single report, you can
return sets of data from your data warehouse and save them directly to
Intelligence Server memory. You can then build multiple reports that gather data
from the Intelligent Cube instead of querying the data warehouse for faster

2017 MicroStrategy, Inc. Introduction 219


7 Improving Performance: Intelligent Cubes Advanced Analytics Reporting

response times. Intelligent Cubes act as a layer between your data source and
MicroStrategy reports that analyze and display data, as illustrated below:
Intelligent Cubes

Intelligent Cubes are fully scalable, limiting excessive data consumption and
redundant data by allowing you to build only the sets of data you require.

For example, you can create an Employee Compensation Intelligent Cube that
holds compensation data for all employees across all regions. You can then create
multiple Intelligent Cube reports, each with a different set of attributes and
metrics on the report, or different months or regions in the result set. You can
even perform analysis beyond the data stored by creating derived metrics and
elements.

Each time one of those reports is requested by an end user, it uses the Intelligent
Cube instead of running against the data warehouse, as shown below:
Intelligent Cube Example

In this example, 20 users need to see employee compensation-related data from


20 different reports each day. Each report on average runs five minutes in the data
warehouse. If each user queries the data warehouse for the result set, collectively,
their requests consume almost two hours of processing time. However, if you
create a cube to store data for these reports, the data warehouse is accessed only

220 Intelligent Cubes 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Improving Performance: Intelligent Cubes 7

when the cube is first published. All 20 users hit the Intelligent Cube. The
processing time is reduced to five minutes plus the time for the retrieval of the
slice of the cubes data, which in most cases takes only seconds.

Creating Intelligent Cubes


Creating Intelligent Cubes is as easy as creating reports. You can add data to your
Intelligent Cube by including objects such as attributes, metrics, filters, and so on
as report objects or report filters.
Example - Intelligent Cube

Since Intelligent Cubes are used simply to share a set of data, no data or report
results are displayed when you execute an Intelligent Cube. However, executing
an Intelligent Cube publishes the Intelligent Cube, which can then be accessed as
a set of data for multiple reports. When the data in the data source changes after
cube creation, you can refresh the Intelligent Cube with the updated data by
republishing the Intelligent Cube either manually or on schedule.
Published Intelligent Cube

2017 MicroStrategy, Inc. Intelligent Cubes 221


7 Improving Performance: Intelligent Cubes Advanced Analytics Reporting

Create and publish an Intelligent Cube

1 In Developer, on the File menu, click New and select Intelligent Cube.

2 In the New Intelligent Cube window, select Empty Intelligent Cube and
click OK.

3 In the Report Editor, add objects such as attributes, metrics, and so on to the
Intelligent Cube, as you would add report objects.

4 Create a filter for the Intelligent Cube as needed.

If you create a filter on an Intelligent Cube, any data that is restricted from the
Intelligent Cube is not available for any reports that connect to the Intelligent
Cube. This helps reduce the size of the Intelligent Cube.

5 Click Save and close to save the Intelligent Cube and close the Report Editor.

6 To publish the cube, in Developer, right-click on the Intelligent Cube and


click Run.

Converting reports into Intelligent Cubes


You can convert an existing report that contains a set of required objects, into an
Intelligent Cube. Creating an Intelligent Cube by converting a report enables you
to view the set of data you are including in your Intelligent Cube. With this
method you can verify that you have the set of data you want, rather than just the
required report objects, before you publish it as an Intelligent Cube.

When you convert a report to an Intelligent Cube, some parts of the report are not
included in the resulting Intelligent Cube. Intelligent Cubes are not used for the
same display and analysis purposes as a report. Intelligent Cubes simply act as a
sharable set of data. Therefore, when a report is converted into an Intelligent
Cube, some of the display and analysis features are no longer necessary.

To convert a report to an Intelligent Cube

1 In Developer, right-click the report and select Edit.

2 In the Report Editor, from the Data menu, point to Intelligent Cube Options
and select Convert to Intelligent Cube.

222 Intelligent Cubes 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Improving Performance: Intelligent Cubes 7

3 Save the Intelligent Cube.

Note: If you save the Intelligent Cube using the same name after converting a
report to an Intelligent Cube, the original report is lost. To keep the original
report, select Save As and save the Intelligent Cube using a different name
than the report.

4 You must publish an Intelligent Cube to make it available for multiple reports
to access and report on its set of data. To do so, right-click on the Intelligent
Cube and click Run.

Monitoring Intelligent Cubes


You can use the Intelligent Cubes monitor to monitor cubes that have been
created and published. In this monitor, you can view details about cubes, such as
last update time, hit count, memory size, and so on.

You can also perform actions on the cubes, such as delete, unload, and so on.
Intelligent Cubes Monitor

2017 MicroStrategy, Inc. Intelligent Cubes 223


7 Improving Performance: Intelligent Cubes Advanced Analytics Reporting

224 Intelligent Cubes 2017 MicroStrategy, Inc.


8
ADVANCED REPORTING OPTIONS

Introduction
There are a number of options for changing final report results without affecting
the underlying objects.

Report data options


Developer settings allow users to make changes on a number of options that
affect the final results. However, the initial or intermediary data is not changed.

There are several options that can be set at the report-level using Report Data
Options.

Calculations
Report Limit: Enables limits to be on any metrics to apply to a report

Metric Join Type: Enables the join type to be set for each metric that is
present on the report

2017 MicroStrategy, Inc. Introduction 225


8 Advanced Reporting Options Advanced Analytics Reporting

Attribute Join Type: Enables control on how lookup tables are joined with
intermediate tables during report execution

Evaluation Order: Enables modification of the evaluation order of metrics,


consolidations, report limits, and subtotals when present on a report

Subtotals: Enables adding a subtotal to custom groups and consolidations


present on a report

Report limit
A report limit specifies metric criteria used to restrict the final result set after the
report metrics are calculated. This calculation is local to the report, and can use
any metric available in the project.

For example, on a report containing Call Centers and Profit, a report limit of
Revenue Rank Bottom 10% might be set. This constrains the list of Call Centers in
the final report results to only those that had Revenue in the bottom 10% of all
Call Centers. Although the Revenue metric is used in the report limit, it does not
appear on the report template, nor is it in the Report Objects window. Below are
the functions for the report limits:
Report Limit Options

226 Report data options 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Reporting Options 8

To set a report limit

1 In the Report Editor, on the Data menu, select Report Data Options.

2 In the Report Data Options window, expand Calculations and select Report
Limit.

3 On the right, click Modify.

4 In the Report Limit Editor, double-click the Limit Definition area.

5 In the Report Limit Qualification window, you can add a metric to the Metric
box in one of the following ways:

Type the metrics name: In the Metric box, type the desired metric name
and click OK.

Browse for the metric: Click the Browse button. In the Open window,
locate and select the desired metric. Click OK.
Drag and drop a metric: In the Object Browser, locate the metric and drag
it into the Metric box.

6 For Function, select Metric Value, Rank, or Percent.

7 For Operator, select an operator.

8 For Value, select Value, Simple Prompt, Metric, or Custom. Complete the
expression or the simple prompt definition and click OK.

9 Click Save and Close.

10 In the Report Data Options window, click OK.

11 In the Report Editor, click Save and Close.

12 In almost all cases, a Report Limit will produce more efficient SQL than a
Metric Qualifier.

Metric join type


When data is pulled from two or more tables of metric data in your data source, a
metric join determines the way that data is combined into a single set of data. The

2017 MicroStrategy, Inc. Report data options 227


8 Advanced Reporting Options Advanced Analytics Reporting

order in which the data is joined from the different tables can affect the outcome
of the data calculation.

Different types of metric joins can be used to change the interactions of the
metrics. Inner joins display only data that exists for the metrics that are joined.
Outer joins shows all data for each metric, even if the data displayed doesnt exist
for every one of the joined metrics. By default, the join type is set at the Server or
Project level. Occasionally, users may want to display all of the records in the
report results, whether or not they have data for all of the metrics. An outer join
helps to achieve this.

Exercise 8.1: Metric join


1 Open Developer.

2 Run the Northwest Revenue Report created in the Advanced Metrics chapter.

3 Open the Report Data Options and change the Metric Join Types to
outer or inner.

4 Compare results.

Attribute join type


For business attribute data, the most common types of joins are inner joins and
outer joins. An inner join includes in the data calculation only the data common to
all the attribute elements in the join, while an outer join includes all of the data in
all of the attribute elements.

You can create an outer join on data coming from your data warehouse tables, for
certain attributes on a report. You can also choose how the data warehouse table
and final SQL pass result table are joined, and then determine the type of join,
inner or outer, between specific attributes.

The Attribute Join Type setting enables the user to force an outer join against
lookup tables of select attributes. This changes the data that is brought back. The
options are as follows:

Preserve common elements of lookup and final pass result table:


Keep only the attribute elements that exist in both the lookup and fact tables.

Preserve lookup table elements joined to final pass result table


based on fact table keys: Keep only the attribute elements that are joined
to the fact table based on fact table keys.

228 Report data options 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Reporting Options 8

Preserve lookup table elements joined to final pass result table


based on template attributes without filter: Keep all attribute elements
and ignore all related filtering conditions.

Preserve lookup table elements to final pass result table based on


template attributes with filter: Keep all attribute elements and apply all
related filtering conditions.

Evaluation order
Evaluation order determines the order in which the Analytical Engine performs
different kinds of calculations, which can affect the final result set. It changes
using the order in which consolidations, certain metrics, report limits, and
subtotals are calculated and resolved for a given report.

The following example illustrates how evaluation order can influence the result
set of a report.
Evaluation Order Example

In the above example, two calculations are resolved by the Analytical Engine: the
States Consolidation and the smart compound metric, Revenue/Cost. If the
Analytical Engine calculates the consolidation before the compound metric, the
empty cells value is based on the last row of the consolidation, 35/25=1.4. If,
however, the Analytical Engine calculates the smart compound metric first, the
empty cells value is based on the last column of the result set, 1.5+1.33=2.83.

In general, calculations on MicroStrategy reports are achieved in one of two


possible ways:

Executing SQL against the data warehouse

With the Analytical Engine

Many types of calculations can be handled by the Analytical Engine:

Metric qualification

Smart compound metrics

Consolidations

2017 MicroStrategy, Inc. Report data options 229


8 Advanced Reporting Options Advanced Analytics Reporting

Report limits

Subtotals

Custom groups

Intelligent Cube operations (such as derived metrics, view filters, and dynamic
aggregation)

Derived elements

Sorting

Thresholds

Page-by

Cross-tabbing

The MicroStrategy Engine makes a plan to decide the evaluation order of all
Analytical Engine calculations. Of the calculation types listed above, metric
qualification is always performed first. Page-by, sorting, and cross-tabbing are
always done during the last stage of the report execution process. For the other
types of calculations, the Analytical Engine enables the setting of the evaluation
order.

The MicroStrategy Engine supports user-defined evaluation order for four types
of calculations:

Smart compound metrics

Consolidations

Report limits
Subtotals

The above calculations can be defined in any sequence. However, the default
calculation order is as follows:

Smart compound metrics

Consolidations

Report limits

Subtotals

Custom groups are not one of the calculations that can be customized in
terms of evaluation order.

230 Report data options 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Advanced Reporting Options 8

To set the evaluation order

1 In the Report Editor, on the Data menu, select Report Data Options.

2 In the Report Data Options window, expand Calculations and select


Evaluation Order.

3 Clear the Use default evaluation order check box.

4 Under Data Set evaluation order, next to the appropriate object, select a
number indicating the order of evaluation. A 1 causes the relevant object to
be evaluated first, a 2 second, and so on.
Evaluation Order Options

5 Click OK.

6 In the Report Editor, click Save and Close.

2017 MicroStrategy, Inc. Report data options 231


8 Advanced Reporting Options Advanced Analytics Reporting

232 Report data options 2017 MicroStrategy, Inc.


9
WORKSHOPS

Before you begin


Most of the tasks in these workshops can be done in either MicroStrategy Web or
MicroStrategy Developer; Use the interface that you are most comfortable with.
The instructions and images are from Developer.

As a refresher, we created:

Metrics in both Web and Developer


Used Developer for base formulas, advanced subtotals, and conditional
metrics

Used Web for conditional metrics, transformation metrics, count metrics,
advanced functions in metrics, dynamic aggregation, level metrics,
non-aggregatable/inventory metrics, and nested metrics

Filters in Developer

Advanced attributes in Web

Advanced reporting options in Developer

2017 MicroStrategy, Inc. Before you begin 233


9 Workshops Advanced Analytics Reporting

Note: Level metrics have an option called Grouping in Developer and Metric
Aggregation in Web. They are the same setting.

These workshops use dates, and the dates available in MicroStrategy Tutorial may
have changed. You may have to select different dates, which may cause the values to
differ from the report samples.

Workshop 1: Employee Performance Analysis


This report teaches you how to:

Use the rank functions

Use the Ntile function, which is a way to create ranks split into tiles (segments)

Create level metrics using different filtering and group by options

Use the Running Sum function on an existing metric (Accumulated Percent


Contribution to All Profit)
Employee Performance Analysis Final Result

234 Workshop 1: Employee Performance Analysis 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Workshops 9

To create the report:

1 Create two attribute element list prompted filters.

You can build the filters locally within the reports definition or build them
as separate filters and then include them in the report filter.

One filter prompts you to select a Region element. Save it as Region


Prompt.

The second filter prompts you to select a Month of Year element. Save the
prompt as Month of Year Prompt.

2 Create the Profit metric.

This is a simple metric with a formula of Sum(Profit), where Profit is a fact.

Format the Profit metric as Currency with 0 decimals.

3 Create the Profit Rank by Region metric.

This metrics formula is Rank(Profit), where Profit is a simple metric (not the
Profit fact). Define the Rank parameters to perform the rank in descending
order by selecting False for the Asc field, as shown below.
.

Set the Break by to Region.

4 Create the Overall Profit Rank metric.

Define this metric the same as the metric above, but do not specify a Break
by attribute.

5 Create the Quartile Rank metric.

The Quartile Rank metrics formula is Ntile(Profit), where Profit is a simple


metric (not the Profit fact). Define the Ntile parameters to perform the
Ntile in descending order by selecting False for the Ascending field. Keep

2017 MicroStrategy, Inc. Workshop 1: Employee Performance Analysis 235


9 Workshops Advanced Analytics Reporting

the number of Tiles at the default of 4. Select Region as the Break by


attribute.

The Ntile function allows you to segment a metrics values into tiles. For
this metric, split the possible values into four segments. The top 25% are in
segment 1, the next 25% are in segment 2, and so on.

6 Create the Percent Contribution to Regional Profit for Time Frame metric.

Create a level metric and name it Regional Profit (T= Region, F= Std, G=
Std). The level metrics formula is Sum(Profit), where Profit is the fact. Its
level is defined as Region with Standard Filtering and Standard Grouping
(called Aggregation in Web):

After defining the level metric, use it as the denominator in the formula for
the Percent Contribution to Regional Profit for Time Frame metric, as
shown below:

Profit in the formula above is the Profit metric, not the Profit fact.

236 Workshop 1: Employee Performance Analysis 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Workshops 9


Format this metric as a percentage with two decimal places.

This metric is a classic example of using a level metric for a percent to
total calculation.

7 Create the Percent Contribution to Profit for Selected Regions for


Timeframe metric.

To create this compound metric, define another level metric named


Regional Profit (Abs None T = Region, F= ABS, G= None). The level
metrics formula is Sum(Profit), where Profit is the fact. Its level is defined
as Region with Absolute Filtering and None Grouping (Aggregation):

Use the level metric as the denominator in the formula for the Percent
Contribution to Profit for Selected Regions for Timeframe metric. The
compound metrics formula is Profit/Regional Profit Abs None.

Profit in the formula above is the Profit metric, not the Profit fact.

Format the compound metric as a percentage with two decimal
places.

8 Create the Percent Contribution to All Profit (All Time, All Regions) metric.

This compound metric needs a level metric that returns the profit across
the entire business. The level metrics formula is Sum(Profit), where Profit is
the fact and is named All Profit (T=Region, F=IGN, G=None). Its level is
defined as Region with Ignore Filtering and None Grouping (Aggregation),
and Month of Year with Ignore Filtering and None Grouping.

Notice the level metric uses two targets, Region and Month of Year. The
Region target filtering needs to be set to Ignore, and the Grouping needs
to be set to None. This is done so that the metric ignores the Region filter
of the report and does not group by it. The Month of Year target uses
Ignore filtering to ignore the month of year filter criteria. It could use

2017 MicroStrategy, Inc. Workshop 1: Employee Performance Analysis 237


9 Workshops Advanced Analytics Reporting

Standard or None grouping. The grouping selection does not impact the
metric because Month of Year is not on the report template.

You can keep or remove Report Level; either way the metric values are the
same.

You could also use other target options instead of using Region and Month of
Year as the targets. For example, selecting Employee and Day as targets yields
the same results for this type of level metric.

Use the level metric as the denominator in the formula for the Percent
Contribution to All Profit (All Time, All Regions) metric: Profit/All Profit.

Profit in the formula above is the Profit metric, not the Profit fact.

Format the compound metric as a percentage with two decimal places.

9 Create the Accumulated Percent Contribution to All Profit metric.

This metric shows the running total of each employees percent


contribution to all profit for all time. In a sense, it provides a subtotal to
show how much the employees contributed together by Region to profit
across the entire business. You define this metric using the RunningSum
OLAP function. The metrics formula is RunningSum([Percent Contribution
to All Profit (All Time, All Regions)]).

238 Workshop 1: Employee Performance Analysis 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Workshops 9

The RunningSums Break by parameter uses the Region attribute. The Sort
by parameter sorts the Percent Contribution to All Profit (All Time, All
Regions) metrics values in descending order, as shown below:

Format the metric as a percentage with three decimal places.

10 Create the final report.

Create the final report by including all of the metrics described above, as
well as the Region and Employee attributes, and the attribute qualification
prompted filters. Select Month of Year as December, and Regions as
Northeast, Mid-Atlantic, Southeast, and Central.

Sort the report by Region ID ascending, and then Profit Rank by Region
ascending. Apply custom banding by rows, using the Region row header.

2017 MicroStrategy, Inc. Workshop 1: Employee Performance Analysis 239


9 Workshops Advanced Analytics Reporting

Workshop 2: Sales Comparison Analysis


This report uses a consolidation in the columns (the month values in the report)
and shows you a useful way to hide the consolidation name. The report also uses
a transformation in the Last Year's Sales metric.
Sales Comparison Analysis Final Result

1 Create an attribute qualification prompted filter using Category and save it as


Prompt by Category.

2 Create the Sales metric.

Define this simple metric as Sum(Revenue), where Revenue is the fact and
not the metric.

Format the metric as Currency with 0 decimals.

3 Create the Last Years Sales metric.

240 Workshop 2: Sales Comparison Analysis 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Workshops 9

Define this metric as Sum(Revenue) and apply the Last Years


transformation to its Transformation setting:

Use the Revenue fact, not the Revenue metric.

Format the metric as Currency with 0 decimals.

4 Create the consolidation Time Periods.

The report uses a consolidation for the time periods. The consolidation
elements for each individual month are simple, as shown below:

Jan 2014 - Mar 2014


Apr 2014 - Jun 2014

2017 MicroStrategy, Inc. Workshop 2: Sales Comparison Analysis 241


9 Workshops Advanced Analytics Reporting

The consolidation element for the Q1 2014 columns uses a constant in its
definition to calculate the average, as shown below:

You must either create the Q1 2014 element after you create the Mar 2014
element, or move the Q1 2014 element up in the Consolidation Editor so
that it is displayed after Mar 2014 on the report, as expected.

The Jan-Jun 2014 consolidation element uses the following formula:

Make sure to place the parentheses in the right locations so that both the
Q1 2014 and the Jan-Jun 2014 consolidation elements calculate the
correct averages.

5 Create the final report.


Create a report with Call Center on the rows and the Sales, Last Years
Sales, and the consolidation Time Periods in the columns. Define your
local filter using the attribute qualification prompted filter described
earlier and choose Movies.
To hide the word Metrics and the name of the consolidation from the
final report display, select Options from the Grid menu. In the Columns
and Rows tab, under the Columns section, select Fixed. From the
drop-down list, select Metrics. Set the pixels to 0. Since the
consolidation and the metrics appear in the columns of the report,
when you fix the length of the Metrics column to 0, the name of the
consolidation also disappears from view.
To define the custom banding for this report, from the Grid menu,
select Options. In the General tab, select Custom banding. Click the
Settings button. Under Banding preference, select By columns. Under
Banding criteria, in the Apply first color every field, select 6. In the
Apply second color every field, select 2.

TBD: check above if dev or web

242 Workshop 2: Sales Comparison Analysis 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Workshops 9

Workshop 3: Market Basket Analysis


This report shows you how to:

Create a custom group with prompts

Create an advanced level metric

Use the RunningSum function, which calculates a running total


Market Basket Analysis Final Report

1 Create the prompted Time Frame custom group.

Qualify the custom group on the Day attribute. Add prompts to select two
dates, the start date and end date. The definition of the custom group
element is:

2017 MicroStrategy, Inc. Workshop 3: Market Basket Analysis 243


9 Workshops Advanced Analytics Reporting

Modify the Time Frame custom group to change the display option so that
only the individual dates within the custom group element display on the
report.

Keep in mind that the Time Frame custom group is in the report template
and contains two prompts. Therefore, when you save the report, you have
to use the option to save the Filter and Template as Prompted, otherwise
the prompts in the Time Frame custom group are no longer executed.

2 Create the Select an Item filter.

Use an attribute element list prompted filter on the Item attribute to


display the list of items at report run time. Define the filter so that you can
choose a maximum of one item only and make this a required prompt.

This filter must be created as its own object, independent of the report,
because the filter is used on the report and in the relationship filter. Using
two separate filters (one for the report and one for the relationship filter)
causes the metrics to calculate incorrectly.

3 Create the Overall Sales per Call Center for Time Frame metric.

This metric calculates the overall sales for each date on the report and for
each call center. Use the Revenue fact instead of the Revenue metric.

The metric uses a level to add up sales for all items, not just sales for the
selected item. The definition of this metric is Sum(Revenue) with the level
set to Report Level and Item with Ignore filtering and Standard grouping
(aggregation), as shown below:

4 Create the Number of Orders per Call Center for Time Frame metric.

This metric counts the orders for each date on the report and for those call
centers where the selected item was sold. Its formula is Count(Order),
where Order is an attribute. Since orders are stored directly in the
Order_Fact table, you do not need to add a special count parameter FactID

244 Workshop 3: Market Basket Analysis 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Workshops 9

definition. The Engine automatically looks to the appropriate table to


perform the count of orders.

5 Create a relationship filter.

The relationship filter helps identify the orders in which the selected item was
sold. Use this filter in the Total Sales for Orders that Include Selected Item metric
(described next) to ensure that the metric sums the sales for just those orders that
included the selected item. The relationship filter is defined as follows:

Use the Select an Item filter that you created in a previous step.

To ensure the correct behavior of the metric, you need to disable the Also
apply this qualification independently of the relationship filter advanced
option in the Set Qualification window of the Filter Editor.

For the Relate by field, you can also use the Revenue fact instead of the
Item-level Units Sold fact.

6 Create the Total Sales for Orders that Include Selected Item metric.

This metric uses a relationship filter for its condition (described above).
The metrics formula is Sum(Revenue), with level set to Report Level and
Item as a target with Ignore filtering and Standard grouping (aggregation).
You need the level defined this way so that the metric calculates the sales
amount for the total order (for all items sold in the order), not just for the

2017 MicroStrategy, Inc. Workshop 3: Market Basket Analysis 245


9 Workshops Advanced Analytics Reporting

single selected item in the order. You need the relationship filter to identify
which orders sold the selected item.

7 Create the Number of All Items in the Orders that Include Selected Item
metric.

Define this metric as Count(Item). To ensure that the count takes place
against the fact table versus the LU_Item lookup table, define the FactID
count parameter as Item-level Units Sold. By specifying this fact, the
Engine knows to count the items that actually sold.

This metric also contains the relationship filter described above in its
conditionality definition. The relationship filter ensures that the metric
counts only the items involved in the orders that sold the selected item.
For example, if the selected item is the Sharp DVD Player, this metric
counts the total number of items for the orders in which the Sharp DVD
Player was sold. The metrics level is set to Report Level and Item as a
target with Ignore filtering and Standard grouping (aggregation). This
level definition ensures that the metric counts all of the items in the
orders, not just the selected item.

The metric is defined as follows:

8 Create the Percent of Order Sales to Overall Sales per Call Center for Time
Frame metric.

This compound metrics formula is Total Sales for Orders that Include
Selected Item/Overall Sales per Call Center for Time Frame.

Format the metric as percentage with 2 decimal places.

9 Create the Selected Items Sales metric.

246 Workshop 3: Market Basket Analysis 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Workshops 9

Define this simple metric as Sum(Revenue), where Revenue is the fact, not
the metric.

10 Create the Percent of Selected Item Sale to Total Order Sale metric.

This compound metrics formula is Selected Items Sales/Total Sales for


Orders that Include Selected Item.

Format the metric as percentage with 2 decimal places.

11 Create the final report.

Add the Time Frame custom group, the Call Center attribute, the
prompted filter for Item, and the seven metrics described above to the
report.

12 When you execute the report:

Select the Date Range as between 12/18/2014 and 12/25/2014.

For the Item prompt, select Sharp DVD Player.

Workshop 4: Customer Attrition Analysis


This report teaches you how to compare two sets of users by using reports as
filters to create each set of users, using Venn diagram analysis.
The first set of customers is created in a report in step 1, and are those
customers who made a purchase during the start month. This set is
represented by the blue circle. In the report, it is the Count of Customers for
Start Month metric, which is created in step 5.

The second set of customers is created in a report in step 2, and are those
customers who made a purchase during the end month. This set is
represented by the red circle. In the report, it is the Count of Customers for
End Month metric, which is created in step 6.

The intersection of the two customer sets is created in the filter in step 4, and
are those customers who bought in both the start month and the end month.
This set is represented by the purple intersection of the two circles. In the

2017 MicroStrategy, Inc. Workshop 4: Customer Attrition Analysis 247


9 Workshops Advanced Analytics Reporting

report, it is the Count of Customers who Continue to Buy metric, which is


created in step 7.

The customers who bought in the start month but did not buy in the end
month are represented by the blue crescent in the image above. In the report,
it is the Count of Customers who Stopped Buying metric, which is created in
step 8.

The customers who bought in the end month but did not buy in the start
month are represented by the red crescent in the image above. In the report, it
is the Count of New Customers metric, which is created in step 9.
Customer Attrition Analysis Report

1 Create the Customers for Start Month report.

This report uses a prompted attribute qualification filter, which requires


you to select a month when you run the report. The selected month is the
start month for the time period. The report retrieves the list of customers
who made a purchase during the start month. If you select November

248 Workshop 4: Customer Attrition Analysis 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Workshops 9

2014 at run time, the report returns 4936 rows and the first few rows
appear as follows:

Format the Revenue metric as Currency with two decimal places.

2 Create the Customers for End Month report.

The report that qualifies on end month is similar to the report shown
above. If you select December 2014 at run time, it returns 4911 rows.

Do not copy and edit the Customers for Start Month report to define the
Customers for End Month report. If you do this, you will not get two
distinct prompts when you run the final report. Be sure to create both
reports from scratch.

3 Create two filters that use the reports you created above. The customers
returned in the report results are used as the filters (or conditions) for
conditional metrics that you will create later.

Use the Customers for Start Month report (created in step 1) as the
definition of the first filter. Save the filter as RasF_Count of Customers for
Start Month (RasF stands for Report as Filter).

2017 MicroStrategy, Inc. Workshop 4: Customer Attrition Analysis 249


9 Workshops Advanced Analytics Reporting

Use the Customers for End Month report (created in step 2) as the
definition of the second filter. Save the filter as RasF_Count of Customers
for End Month.

4 Create the Start and End Month Customers (intersection) filter. The purple
in this image represents the intersection between the starting customers and
the ending customers; the filter returns those customers in the intersection.

This filter combines the two filters that you created in step 3, which use
reports as filters. The definition of this filter is shown below:

You will use this filter as the condition in the Count of Customers who
Continue to Buy metric.

5 Create the Count of Customers for Start Month metric.

This metric counts the number of customers who made purchases in the
start month. It is a conditional metric which identifies customers for the
start month using a filter. The filter ensures that the count occurs against
the appropriate fact table, so you do not need to specify anything else for
the FactID parameter of the Count function.
The definition of this metric is shown below:

6 Create the Count of Customers for End Month metric.

This metric counts the number of customers who made purchases in the
end month. Define it the same way you define the Count of Customers for
Start Month metric, but use the RasF_Count of Customers for End

250 Workshop 4: Customer Attrition Analysis 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Workshops 9

Month filter, which identifies the customers for the end month, as the
condition.

7 Create the Count of Customers who Continue to Buy metric.

This metric counts the number of customers who made purchases in the
start month and the end month. In the Venn diagram, it is the intersection,
shown in purple, of the starting and ending customers. This is why the
metric uses the Start and End Month Customers (intersection) filter,
created in step 4, as the condition.

The metrics definition is shown below:

8 Create the Count of Customers who Stopped Buying metric.

This metric subtracts the number of continuing customers (the


intersection of the Venn diagram) from the number of starting customers.
Because these customers are in the starting customers set (the blue circle
in the Venn diagram) but are not in the ending customers set (the red
circle), they did not continue to buy. This set of customers is represented
as the blue crescent of starting customers, without the purple intersection
of continuing customers.
The metrics definition is shown below:

2017 MicroStrategy, Inc. Workshop 4: Customer Attrition Analysis 251


9 Workshops Advanced Analytics Reporting

Notice that this metric is created from two other metrics, which is why this
metric is classified as a compound metric. A compound metric can use
combinations of different metrics.

9 Create the Count of New Customers metric.

This metric subtracts the number of continuing customers (the


intersection of the Venn diagram) from the number of ending customers.
Because these customers are in the ending customers set (the red circle in
the Venn diagram) but are not in the starting customers set (the blue
circle), they are new customers. This set of customers is represented by the
red crescent of ending customers, without the purple intersection of
continuing customers.

The metric is another compound metric (its formula uses two other
metrics), as shown below:

10 Create the final report.

Create a report with the five metrics created above.

Place the metrics on the rows.


Run the report with the same prompt answers used in the original reports:

Start month = November 2014

End month = December 2014

252 Workshop 4: Customer Attrition Analysis 2017 MicroStrategy, Inc.


A
METRIC SYMBOLS
For MicroStrategy Developer and the
Formula Editor in MicroStrategy Web

Metric formulas
A metric formula is displayed in the Formula Editor mode of MicroStrategy Webs
Metric Editor.

2017 MicroStrategy, Inc. Metric formulas 253


A Metric Symbols Advanced Analytics Reporting

A metric formula is also displayed in the Metric Editor of MicroStrategy Developer.

Metric level symbols


All information about the metric level is placed between curly braces { }.

The following table describes the metric level symbols.

Symbol Definition

~ Report level

Attribute_Name Level

Symbols placed before the level Metric aggregations setting

No symbol Standard aggregation

! No aggregation

<| Beginning fact aggregation

>| Ending fact aggregation

< Beginning lookup aggregation

> Ending lookup aggregation

Symbols placed after the level Relationship with report filter setting

+ Standard filtering

* Absolute filtering

% Ignore filtering

No symbol No filtering

254 Metric level symbols 2017 MicroStrategy, Inc.


Advanced Analytics Reporting Metric Symbols A

Note: Attribute_Name indicates a variable; the name of the attribute is displayed.

Metric conditional symbols


All information about the metric condition is placed between angle brackets < >.

The following table describes the metric condition symbols.

Symbol Definition

Filter_Name Filter

@ Interaction between metric filter and report filter

1 Merge into new

2 Merge report filter into metric filter

3 Merge metric filter into report filter

Ignore related report filter elements check box

+ Selected

+ Cleared

% Ignore filtering

No symbol No filtering

Note: Filter_Name indicates a variable; the name of the filter is displayed.

Metric transformation symbols


The name of the transformation is placed between pipes | |. Since a
transformation does not have any other settings, no other symbols are needed.

2017 MicroStrategy, Inc. Metric conditional symbols 255


A Metric Symbols Advanced Analytics Reporting

256 Metric transformation symbols 2017 MicroStrategy, Inc.


Copyright Information

All Contents Copyright 2017 MicroStrategy Incorporated. All Rights Reserved.

Trademark Information

The following are either trademarks or registered trademarks of MicroStrategy Incorporated or


its affiliates in the United States and certain other countries:

MicroStrategy, MicroStrategy 10, MicroStrategy 10 Secure Enterprise, MicroStrategy 9,


MicroStrategy 9s, MicroStrategy Analytics, MicroStrategy Analytics Platform, MicroStrategy
Desktop, MicroStrategy Operations Manager, MicroStrategy Analytics Enterprise,
MicroStrategy Evaluation Edition, MicroStrategy Secure Enterprise, MicroStrategy Web,
MicroStrategy Mobile, MicroStrategy Server, MicroStrategy Parallel Relational In-Memory
Engine (MicroStrategy PRIME), MicroStrategy MultiSource, MicroStrategy OLAP Services,
MicroStrategy Intelligence Server, MicroStrategy Intelligence Server Universal, MicroStrategy
Distribution Services, MicroStrategy Report Services, MicroStrategy Transaction Services,
MicroStrategy Visual Insight, MicroStrategy Web Reporter, MicroStrategy Web Analyst,
MicroStrategy Office, MicroStrategy Data Mining Services, MicroStrategy Narrowcast Server,
MicroStrategy Health Center, MicroStrategy Analyst, MicroStrategy Developer, MicroStrategy
Web Professional, MicroStrategy Architect, MicroStrategy SDK, MicroStrategy Command
Manager, MicroStrategy Enterprise Manager, MicroStrategy Object Manager, MicroStrategy
Integrity Manager, MicroStrategy System Manager, MicroStrategy Analytics App,
MicroStrategy Mobile App, MicroStrategy Tech Support App, MicroStrategy Mobile App
Platform, MicroStrategy Cloud, MicroStrategy R Integration, Dossier, Usher, MicroStrategy
Usher, Usher Badge, Usher Security, Usher Security Server, Usher Mobile, Usher Analytics, Usher
Network Manager, Usher Professional, MicroStrategy Services, MicroStrategy Professional
Services, MicroStrategy Consulting, MicroStrategy Customer Services, MicroStrategy
Education, MicroStrategy University, MicroStrategy Managed Services, BI QuickStrike, Mobile
QuickStrike, Transaction Services QuickStrike Perennial Education Pass, MicroStrategy Web
Based Training (WBT), MicroStrategy World, Best in Business Intelligence, Pixel Perfect, Global
Delivery Center, Direct Connect, Enterprise Grade Security For Every Business, Build Your Own
Business Apps, Code-Free, Welcome to Ideal, The Worlds Most Comprehensive Analytics
Platform, The Worlds Most Comprehensive Analytics Platform. Period.

Other product and company names mentioned herein may be the trademarks of their
respective owners. Specifications subject to change without notice. MicroStrategy is not
responsible for errors or omissions. MicroStrategy makes no warranties or commitments
concerning the availability of future products or versions that may be planned or under
development.
Patent Information

This product is patented. One or more of the following patents may apply to the product sold
herein: U.S. Patent Nos. 6,154,766, 6,173,310, 6,260,050, 6,263,051, 6,269,393, 6,279,033,
6,567,796, 6,587,547, 6,606,596, 6,658,093, 6,658,432, 6,662,195, 6,671,715, 6,691,100,
6,694,316, 6,697,808, 6,704,723, 6,741,980, 6,765,997, 6,768,788, 6,772,137, 6,788,768,
6,798,867, 6,801,910, 6,820,073, 6,829,334, 6,836,537, 6,850,603, 6,859,798, 6,873,693,
6,885,734, 6,940,953, 6,964,012, 6,977,992, 6,996,568, 6,996,569, 7,003,512, 7,010,518,
7,016,480, 7,020,251, 7,039,165, 7,082,422, 7,113,993, 7,127,403, 7,174,349, 7,181,417,
7,194,457, 7,197,461, 7,228,303, 7,260,577, 7,266,181, 7,272,212, 7,302,639, 7,324,942,
7,330,847, 7,340,040, 7,356,758, 7,356,840, 7,415,438, 7,428,302, 7,430,562, 7,440,898,
7,486,780, 7,509,671, 7,516,181, 7,559,048, 7,574,376, 7,617,201, 7,725,811, 7,801,967,
7,836,178, 7,861,161, 7,861,253, 7,881,443, 7,925,616, 7,945,584, 7,970,782, 8,005,870,
8,051,168, 8,051,369, 8,094,788, 8,130,918, 8,296,287, 8,321,411, 8,452,755, 8,521,733,
8,522,192, 8,577,902, 8,606,813, 8,607,138, 8,645,313, 8,761,659, 8,775,807, 8,782,083,
8,812,490, 8,832,588, 8,943,044, 8,943,187. 8,958,537, 8,966,597, 8,983,440, 8,984,274,
8,984,288, 8,995,628, 9,027,099, 9,027,105, 9,037, 577, 9,038,152, 9,076,006, 9,086,837,
9,116,954, 9,124,630, 9,154,303, 9,154,486, 9,160,727, 9,166,986, 9,171,073, 9,172,699,
9,173,101, 9,183, 317, 9,195,814, 9,208,213, 9,208,444, 9,262,481, 9,264,415, 9,264,480,
9,269,358, 9,275,127, 9,292,571, 9,300,646, 9,311,683 9,313,206, 9,330,174, 9,338,157,
9,361,392, 9,378,386, 9,386,416, 9,391,782, 9,397,838, 9,397,980, 9,405,804, 9,413,710,
9,413,794, 9,430,629, 9,432,808, 9,438,597, 9,444,805, 9,450,942, 9,450,958, 9,454,594,
9,507,755, 9,513,770, 9,516,018, 9,529,850, 9,563,761, 9,565,175, 9,608,970, 9,640,001,
9,646,165, and 9,680,908. Other patent applications are pending.

This Course (course and course materials) and any Software are provided as is and without
express or limited warranty of any kind by either MicroStrategy Incorporated (MicroStrategy)
or anyone who has been involved in the creation, production, or distribution of the Course or
Software, including, but not limited to, the implied warranties of merchantability and fitness
for a particular purpose. The entire risk as to the quality and performance of the Course and
Software is with you. Should the Course or Software prove defective, you (and not
MicroStrategy or anyone else who has been involved with the creation, production, or
distribution of the Course or Software) assume the entire cost of all necessary servicing, repair,
or correction.

In no event will MicroStrategy or any other person involved with the creation, production, or
distribution of the Course or Software be liable to you on account of any claim for damage,
including any lost profits, lost savings, or other special, incidental, consequential, or exemplary
damages, including but not limited to any damages assessed against or paid by you to any
third party, arising from the use, inability to use, quality, or performance of such Course and
Software, even if MicroStrategy or any such other person or entity has been advised of the
possibility of such damages, or for the claim by any other party. In addition, MicroStrategy or
any other person involved in the creation, production, or distribution of the Course and
Software shall not be liable for any claim by you or any other party for damages arising from
the use, inability to use, quality, or performance of such Course and Software, based upon

2017 MicroStrategy, Inc. 258


principles of contract warranty, negligence, strict liability for the negligence of indemnity or
contribution, the failure of any remedy to achieve its essential purpose, or otherwise.

The Course and the Software are copyrighted and all rights are reserved by MicroStrategy.
MicroStrategy reserves the right to make periodic modifications to the Course or the Software
without obligation to notify any person or entity of such revision. Copying, duplicating, selling,
or otherwise distributing any part of the Course or Software without prior written consent of
an authorized representative of MicroStrategy are prohibited.

2017 MicroStrategy, Inc. 259

You might also like