Professional Documents
Culture Documents
Analytics Reporting
10.8
CONTENTS
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.
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:
Relational databases
Columnar databases
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
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
the metadata and warehouse. The following image shows the role of Intelligence
Server in the MicroStrategy architecture:
Role of MicroStrategy Intelligence Server
Intelligence Server also houses the Engine which consists of three primary
components, each with its own unique functions:
Query Engine: Submits SQL to the data warehouse and retrieves result sets
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
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.
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
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:
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.
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
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.
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.
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
Introduction
We start working with metrics by using the MicroStrategy Developer interface to
create base formulas and subtotals.
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:
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.
24 Reusing metric formulas for consistency and time-saving: Base formulas 2017 MicroStrategy, Inc.
Advanced Analytics Reporting Base Formulas and Advanced Subtotals 2
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.
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
2017 MicroStrategy, Inc. Reusing metric formulas for consistency and time-saving: Base formulas 27
2 Base Formulas and Advanced Subtotals Advanced Analytics Reporting
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.
10.250.151.130 i-server
18 On the Connection tab, in the Server name box, type i-server as the host
name of the Intelligence Server.
21 Log in with the user name and password listed in your Welcome to
MicroStrategy on AWS email.
28 Reusing metric formulas for consistency and time-saving: Base formulas 2017 MicroStrategy, Inc.
Advanced Analytics Reporting Base Formulas and Advanced Subtotals 2
2017 MicroStrategy, Inc. Reusing metric formulas for consistency and time-saving: Base formulas 29
2 Base Formulas and Advanced Subtotals Advanced Analytics Reporting
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.
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.
9 Click Save.
1 Right-click in the Object Browser area, point to New, and select Metric.
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
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.
9 Click OK.
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 .
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.
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
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
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
#P The name of the attribute to the left of or above the attribute that the subtotal
displays under
#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
2 In the New Grid dialog box, select Blank Report and click OK.
8 In the Object Browser, double-click the Metrics folder and then the Sales
Metrics folder.
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.)
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.
19 Click OK.
20 In the Subtotals dialog box, select the check box for #1 #P (your new subtotal)
and click OK.
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).
22 In the drop-down list at the top of the Save Report As dialog box, select My
Reports.
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.
Multiple functions
Nested functions
Dimensional subtotals
Other metrics
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
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
2 In the Subtotal Editor, the Object Browser lists the basic functions by default.
Drag Last to the Definition pane.
3 In the Definition pane, click Last to select it. Right-click the function and select
Last parameters.
c Click Add.
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.
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.
6 From the drop-down list at the top of the Save As dialog box, select My
Reports.
8 Click Save.
2 In the Object Browser pane, double-click the Metrics folder and then the
Inventory Metrics folder.
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.
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.
c Drag 2016 from the Object Browser to the Report Filter pane.
7 In the Subtotals dialog box, on the Definition tab, select the check box for Last
Quarter.
8 Click OK.
The report should resemble the Last Quarter Units Received Report, page 42.
11 In the drop-down list at the top of the Save Report As dialog box, select My
Reports.
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
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:
Conditional metrics
Transformation metrics
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)
A filter
Only one filter or prompt can be associated with each metric, but each filter can
contain multiple qualifications or prompts.
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.
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.
8 From the drop-down list at the top of the Save Filter As dialog box, select My
Reports.
10 Click Save.
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.
13 Click Condition in the top pane, as indicated by the arrow in the image above.
16 Drag Northwest Region from the Object Browser to the Condition pane.
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.
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.
22 Click OK.
24 From the drop-down list at the top of the Save As dialog box, select My
Reports.
26 Click Save.
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.
4 Drag the Region attribute from the Object Browser to the rows of the report.
7 Drag the Revenue metric from the Object Browser to the columns of the
report.
The report should resemble the following. Note the revenue amount for
Northwest, which is $1,761,187.
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.
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.
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.
20 In the drop-down list at the top of the Save Report As dialog box, select My
Reports.
22 Click Save.
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.
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?
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.
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.
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.
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
To quickly create a metric that uses a function, use the Function Editor. The
Function Editor provides an easier-to-use interface.
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.
a Click the Browse icon next to the Search for a fact, metric or attribute
box.
c Click Revenue.
4 Click Show All to display the level, condition, and transformation properties.
Allow the metric to use both the metric filter and the report filter
9 Click OK.
11 Click Save.
12 In the Save As window, select My Reports from the Save In drop-down list.
3 Drag the Category attribute from the All Objects pane to the rows drop zone
on the report grid.
6 Drag the Revenue metric from the All Objects pane to the metrics drop zone
on the report grid.
7 In the drop-down list on the All Objects pane, select My Personal Objects.
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.
18 From the first drop-down list in the formatting toolbar, select NW Revenue
(Report Filter).
21 Click the Decrease Decimal icon two times, so that the Northwest
Revenue (Report Filter) value no longer displays decimals.
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.
24 Name the report Conditional Metric Filter Report, and click OK.
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 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.
The metric filter is applied to the data first. Then the report filter is applied to
those results.
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.
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.
1 The report filter selects the top 10 most profitable items, using all customers
in the calculation.
The result is the top 5 customers who bought the top 10 Items.
Merge Report Filter into Metric Filter
2 The report filter selects the top 10 most profitable items, using only the top 5
customers selected in the metric filter.
The result is all the top 5 Customers and the top 10 Items.
Merge into New Filter
2 In the Object Browser, click the Metrics folder and then the Sales Metrics
folder.
4 From the first drop-down list in the filter definition pane, select Greater Than.
6 Click Apply.
10 Click OK.
2 In the Functions list on the left, click Sum to add it to the metric definition
window.
a Click the Browse icon next to the Search for a fact, metric or attribute
box.
c Click Revenue.
4 Click Show All to display the level, condition, and transformation properties.
6 In the Select an Object window, select My Reports from the drop-down list.
9 Click OK.
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.
1 In the My Reports folder, right-click the Revenue > $15K (RF 1st) metric and
select Copy.
4 Click OK.
5 Double-click the Revenue > $15K (MF 1st) metric to edit it.
7 From the Interaction between Metric Filter and Report Filter drop-down
list, select Merge Metric Condition into Report.
8 Click OK.
1 In the My Reports folder, right-click the Revenue > $15K (RF 1st) metric and
select Copy.
4 Click OK.
7 From the Interaction between Metric Filter and Report Filter drop-down
list, select Merge into New.
8 Click OK.
4 In the drop-down list on the All Objects pane, select My Personal Objects.
6 Double-click the Revenue > $15K (RF 1st) metric to add it to the report.
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.
12 Click Apply.
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.
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.
21 Double-click the Revenue > $15K (MF 1st) metric to add it to the report.
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.
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.
29 Double-click the Revenue > $15K (new) metric to add it to the report.
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.
1 In the My Reports folder, right-click the Revenue > $15K (new) metric and
select Copy.
4 Click OK.
5 Double-click the Revenue > $15K (new + related) metric to edit it.
8 Click OK.
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.
4 Double-click the Revenue > $15K (new + related) metric to add it to the
report.
The results should be the same as the first report, with 6 rows of data, because
the report filter is now being applied.
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.
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.
1 On any MicroStrategy Web folder page, click Create, and select New Metric.
2 In the Functions list on the left, click Sum to add it to the metric definition
window.
a Click the Browse icon next to the Search for a fact, metric or attribute
box.
c Click Profit.
4 Click Show All to display the level, condition, and transformation properties.
8 Click Save.
9 In the Save As window, select My Reports from the Save In drop-down list.
3 Drag the Region attribute from the All Objects pane to the rows drop zone on
the report grid.
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.
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.
12 In the All Objects pane, select Attributes from the drop-down list.
13 Click Time.
16 Click Apply.
19 From the first drop-down list in the formatting toolbar, select QTD Profit.
22 Click the Decrease Decimal icon two times, so that the Northwest
Revenue value no longer displays decimals.
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.
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.
3 Drag the Region attribute from the All Objects pane to the rows drop zone on
the report grid.
6 Drag the Revenue metric from the All Objects pane to the metrics drop zone
on the report grid.
11 Click Apply.
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.
13 Right-click the Revenue metric in the grid, point to Insert Metric, point to
Transformation, point to Last Years, and select Normal.
14 Right-click the Revenue metric in the grid, point to Insert Metric, point to
Transformation, point to Last Years, and select Variance.
15 Right-click the Revenue metric in the grid, point to Insert Metric, point to
Transformation, point to Last Years, and select Variance Percentage.
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.
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
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
parameters used for a specific function, click Details at the bottom of the Metric
Editor.
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.
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.
Count Item (Fact) counts the number of items in the fact table that contains
the Item-Level Units Sold fact.
2 In the Functions list on the left, double-click Count to add it to the metric
definition window.
a Click the Browse icon next to the Search for a fact, metric or attribute
box.
c Click Item.
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.
8 Click Save.
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.
7 Type Count Item (Fact) in the Name box and click Save.
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.
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.
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.
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.
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.
6 Click Revenue.
8 Click Save.
3 Add your Revenue Rank metric to the report. (Recall that it is saved in the My
Reports folder.)
Note that the rank values range from one to eight, because the MicroStrategy
Tutorial project contains eight regions.
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.
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
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.
14 Name the report Revenue Rank Report -- Paged, and click OK.
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.
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.
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
(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).
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.
2 From the drop-down list in the Functions area, select OLAP Functions.
6 Click Revenue.
Sort by subcategory
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.
9 Click Save.
2 Add the Category and Subcategory attributes to the rows of the report.
4 Add your Subcategory Running Revenue metric to the report. (Recall that it
is saved in the My Reports folder.)
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 &
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
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.
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.
17 Click Save.
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.
For the Audio Equipment subcategory, the Revenue value and the Break By
Category value are the same.
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.
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
Median
2017 MicroStrategy, Inc. Calculating metrics at different levels on a report: Dynamic aggregation 107
3 Advanced Metrics Advanced Analytics Reporting
Mode
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.
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
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.
We will use these metrics to explore how dynamic aggregation works and how
selecting a dynamic aggregation function affects the report results.
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.
5 Click Revenue.
2017 MicroStrategy, Inc. Calculating metrics at different levels on a report: Dynamic aggregation 109
3 Advanced Metrics Advanced Analytics Reporting
7 Click Save.
4 Click OK.
110 Calculating metrics at different levels on a report: Dynamic aggregation 2017 MicroStrategy, Inc.
Advanced Analytics Reporting Advanced Metrics 3
2 Add the Region and Call Center attributes to the rows of 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.)
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.
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.
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)
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.
For example, a regional level metric aggregates the calculation for each region,
regardless of the attributes on the report.
Level Metric Example
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).
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.
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:
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.
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
Standard groups by the target attribute. This option calculates a total for each
element of the target attribute.
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.
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.
Ending fact accesses the last value contained in the fact table.
A direct relationship exists between the target attribute and the report filter.
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.
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.
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)
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.
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.
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.
1 On any folder page in MicroStrategy Web, click Create and select New Metric.
3 Click the Browse icon next to the Search for a fact, metric or attribute box.
5 Click Revenue.
7 Click Save.
8 In the Save As window, select My Reports from the Save In drop-down list.
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.
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.
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).
3 Click OK.
4 Click the Regional Revenue (abs filter std agg) metric to edit it.
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.
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).
3 Click OK.
4 Click the Regional Revenue (ignore filter std agg) metric to edit it.
6 From the Relationship with report filter drop-down list, select Ignore.
7 Click OK.
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.
6 From the Relationship with report filter drop-down list, select None.
7 Click OK.
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:
b Click Select.
d Click Apply.
6 From the drop-down list in the All Objects pane, select My Personal Objects.
8 Double-click the metrics that you created, in the following order. This adds
them to the columns of the report:
Revenue
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.
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.
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.
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.
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
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.
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.
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.
4 Click OK.
5 Click the Regional Revenue (std filter no agg) metric to edit it.
8 Click OK.
1 Right-click the Regional Revenue (abs filter std agg) metric, and select
Copy.
3 Click OK.
4 Click the Regional Revenue (abs filter no agg) metric to edit it.
7 Click OK.
1 Right-click the Regional Revenue (ignore filter std agg) metric, and select
Copy.
3 Click OK.
4 Click the Regional Revenue (ignore filter no agg) metric to edit it.
7 Click OK.
1 Right-click the Regional Revenue (ignore filter no agg) metric, and select
Copy.
3 Click OK.
4 Click the Regional Revenue (no filter no agg) metric to edit it.
6 From the Relationship with report filter drop-down list, select None.
7 Click OK.
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.
5 Double-click the new metrics, in the following order. This adds them to the
columns of the 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.
What is the main difference between these metric values and the standard
aggregation level metrics (see Level Metrics: Standard Aggregation, page 128)?
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).
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.
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.
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.
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.
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.
sum(a11.TOT_DOLLAR_SALES) WJXBFS1
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:
sum(a11.TOT_DOLLAR_SALES) WJXBFS1
In the SQL, the report filter is not included in the WHERE clause of the SQL pass that
calculates the metric.
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.
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
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.
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.
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:
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
1 In the My Reports folder, right-click the Revenue metric, and select Copy.
3 Click OK.
5 In the Search for attribute box in the Level area, type item.
144 Interacting with the context of reports: Report level 2017 MicroStrategy, Inc.
Advanced Analytics Reporting Level and Inventory Metrics 4
1 In the My Reports folder, right-click the Revenue: Report & Item metric, and
select Copy.
3 Click OK.
5 Click the Delete icon next to Report Level in the Level area.
5 From the drop-down list in the All Objects pane, select My Personal Objects.
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: Item
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.
1 Right-click any metric in the report, point to Insert Metric, and select New.
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:
6 Click Save.
The report should resemble the Report Level Example, page 144.
a target attribute of category. The level metric is placed on a report with category
and subcategory. The report is filtered by subcategory.
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
Target: ____________________________________________________
Filtering: __________________________________________________
Aggregation: ______________________________________________
Report 2
Target: ____________________________________________________
Filtering: __________________________________________________
Aggregation: ______________________________________________
Report 3
Target: ____________________________________________________
Filtering: __________________________________________________
Aggregation: ______________________________________________
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: ____________________________________________________
Target: Region
Filtering: Standard
Aggregation: Standard
Report 2
Target: Region
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
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: ______________________________________________
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: ______________________________________________
Target: Region
Filtering: Absolute
Aggregation: None
Metric 2
Target: Region
Filtering: Standard
Aggregation: Standard
Metric 3
Filtering: Ignore
Aggregation: None
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.
previous report. You can also see that the December value matches the End
on Hand for the year in the previous report.
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.
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.
1 On any folder page in MicroStrategy Web, click Create and select New Metric.
3 Click the Browse icon next to the Search for a fact, metric or attribute box.
7 In the Search for attribute box, type Year. From the drop-down list of
matching attributes, select Year.
8 Click the Level Options icon next to Year. You do not have to change the
default standard filtering option.
10 Click OK.
12 Click Save.
1 Click Create, point to New Report, and then select Blank Report.
3 Add the Beginning on Hand (Year) metric (saved in My Reports) to the report
columns.
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.
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.
9 Right-click the Begin on Hand metric, point to Insert Metric, and select New.
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:
14 Click Save.
You can instead use the Formula Editor, which allows you to create a metric that:
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:
The QTD Profit metric created in the transformation metrics exercise looks like the
following in the Formula Editor:
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:
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
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:
AVG(Sum(Revenue){~,Employee}) {~,Region}
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))
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:
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.
1 On any folder page in MicroStrategy Web, click Create and select New Metric.
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.
5 From the drop-down list below All Objects, select Schema Objects.
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}
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}
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.
14 Click Save.
5 From the drop-down list in the All Objects pane, select My Personal Objects.
The report should resemble the Max Regional Employee Profit Sample,
page 168.
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.
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
Ship Date with Order Date + 4. The two attributes being compared are Ship Date
and Order Date, as shown below:
Attribute-to-Attribute Filtering
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.
7 Log in with the user name and password listed in your Welcome to
MicroStrategy on AWS email.
2 On the My Preferences dialog box, expand the Editors category on the left,
then click Filter.
4 Click OK.
Create a filter
8 In the Advanced Qualification pane, select Joint element list in the Option
drop-down list.
9 Select Region and Year from the Available Attributes list and click > to add
them to the Selected Attributes list.
a Click the Add icon to add an element combination. The first value in
each attribute is added to the list.
11 Complete the same steps for the second element combination, of Central and
2013.
12 Click OK.
13 Click Save and Close. Save the filter as Joint Element List.
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.
18 Drag the Joint Element List filter to the Report Filter pane.
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
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:
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
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
5 Click OK.
6 In the Ambiguity dialog box, select Day Attribute and click OK.
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.
2 Text
Tab-delimited
List-delimited as specified in the regional settings
Return-delimited
Northeast
Northwest
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.
ApplyLogic: Uses logical operators (not, and, or, and so forth). This function
is used primarily for defining filters.
where:
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.
10 From the Sales Metrics\Transformation folder, add the Last Years Profit
metric.
Set qualifications
Set qualifications are filters that use metrics to define the filter.
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.
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,
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
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
3 Click OK.
7 Click OK.
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.
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
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.
4 In Set Qualification Type, from the Type drop-down list, select Relationship.
6 In the Level window, move the Customer attribute from the Available
Objects window to the Selected Objects window, and click OK.
9 The filter should use the Revenue fact to relate the output level and filter
qualification attributes:
Double-click Revenue.
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.
Filter summary
Feature Purpose Notes
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
Derived attributes
Users can create and edit attributes within Report Services documents that can be
created based on attribute forms, metrics, or a combination.
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.
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.
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.
Quick groups
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.
6 In the Defining Group window, type a name for the derived element, and click
OK.
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.
3 Press CTRL and select multiple attribute elements for the same attribute in the
grid display of the report.
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.
The Derived Elements Editor presents the user with all the functionality of 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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
Thresholds
For derived elements, thresholds cannot be created using attributes in the
derived element.
Regional Profit
Threshold Editor
To create a threshold
3 In the Thresholds dialog box, type a new name to replace the default New
Threshold.
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 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.
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 .
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
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
Consolidations groups attribute elements together. Consolidations can act as
virtual attributes and perform row-level math. In acting like virtual attributes
consolidations avoid the need to change the data model. Row-level math can
include constants and simple arithmetic operations.
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.
3 In the Elements for this consolidation pane, click Click here to add new
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.
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.
7 Click Add.
9 Click OK twice.
14 Click Add.
15 Add Web.
16 Click OK twice.
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.
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
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.
Introduction
Goals:
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
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
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.
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
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.
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.
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.
2 In the Report Editor, from the Data menu, point to Intelligent Cube Options
and select Convert to 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.
You can also perform actions on the cubes, such as delete, unload, and so on.
Intelligent Cubes Monitor
Introduction
There are a number of options for changing final report results without affecting
the underlying objects.
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
Attribute Join Type: Enables control on how lookup tables are joined with
intermediate tables during report execution
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
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.
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.
8 For Value, select Value, Simple Prompt, Metric, or Custom. Complete the
expression or the simple prompt definition and click OK.
12 In almost all cases, a Report Limit will produce more efficient SQL than a
Metric Qualifier.
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.
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.
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:
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.
Metric qualification
Consolidations
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:
Consolidations
Report limits
Subtotals
The above calculations can be defined in any sequence. However, the default
calculation order is as follows:
Consolidations
Report limits
Subtotals
Custom groups are not one of the calculations that can be customized in
terms of evaluation order.
1 In the Report Editor, on the Data menu, select Report Data Options.
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.
As a refresher, we created:
Filters in Developer
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.
Use the Ntile function, which is a way to create ranks split into tiles (segments)
You can build the filters locally within the reports definition or build them
as separate filters and then include them in the report filter.
The second filter prompts you to select a Month of Year element. Save the
prompt as Month of Year Prompt.
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.
.
Define this metric the same as the metric above, but do not specify a 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.
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.
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
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.
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:
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.
Define this simple metric as Sum(Revenue), where Revenue is the fact and
not the metric.
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
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.
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.
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:
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.
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
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
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.
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.
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.
Add the Time Frame custom group, the Call Center attribute, the
prompted filter for Item, and the seven metrics described above to the
report.
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
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
2014 at run time, the report returns 4936 rows and the first few rows
appear as follows:
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).
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.
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:
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
Month filter, which identifies the customers for the end month, as the
condition.
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.
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.
The metric is another compound metric (its formula uses two other
metrics), as shown below:
Metric formulas
A metric formula is displayed in the Formula Editor mode of MicroStrategy Webs
Metric Editor.
Symbol Definition
~ Report level
Attribute_Name Level
! No aggregation
Symbols placed after the level Relationship with report filter setting
+ Standard filtering
* Absolute filtering
% Ignore filtering
No symbol No filtering
Symbol Definition
Filter_Name Filter
+ Selected
+ Cleared
% Ignore filtering
No symbol No filtering
Trademark Information
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
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.