Functions Reference
Functions Reference
Functions Reference
Version: 10.7
10.7, April 2017
Copyright 2017 by MicroStrategy Incorporated. All rights reserved.
If you have not executed a written or electronic agreement with MicroStrategy or any authorized MicroStrategy distributor (any such agreement, a
"Separate Agreement"), the following terms apply:
This software and documentation are the proprietary and confidential information of MicroStrategy Incorporated and may not be provided to any other person. Copyright
2001-2017 by MicroStrategy Incorporated. All rights reserved.
THIS SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS AND WITHOUT EXPRESS OR LIMITED WARRANTY OF ANY KIND BY EITHER MICROSTRATEGY
INCORPORATED OR ANYONE WHO HAS BEEN INVOLVED IN THE CREATION, PRODUCTION, OR DISTRIBUTION OF THE SOFTWARE OR DOCUMENTATION,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE AND
NONINFRINGMENT, QUALITY OR ACCURACY. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE AND DOCUMENTATION IS WITH
YOU. SHOULD THE SOFTWARE OR DOCUMENTATION PROVE DEFECTIVE, YOU (AND NOT MICROSTRATEGY, INC. OR ANYONE ELSE WHO HAS BEEN INVOLVED
WITH THE CREATION, PRODUCTION, OR DISTRIBUTION OF THE SOFTWARE OR DOCUMENTATION) ASSUME THE ENTIRE COST OF ALL NECESSARY SERVICING,
REPAIR, OR CORRECTION. SOME STATES DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO THE ABOVE EXCLUSION MAY NOT APPLY TO YOU.
In no event will MicroStrategy, Incorporated. or any other person involved with the creation, production, or distribution of the 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 Software and Documentation, even if MicroStrategy, Inc. 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, Inc. or any other person involved in
the creation, production, or distribution of the 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 Software and Documentation, based upon principles of contract warranty, negligence, strict liability for the negligence of indemnity or contribution, the
failure of any remedy to achieve its essential purpose, or otherwise. The entire liability of MicroStrategy, Inc. and your exclusive remedy, shall not exceed, at the option of
MicroStrategy, Inc., either a full refund of the price paid, or replacement of the Software. No oral or written information given out expands the liability of MicroStrategy, Inc.
beyond that specified in the above limitation of liability. Some states do not allow the limitation or exclusion of liability for incidental or consequential damages, so the above
limitation may not apply to you.
The information contained in this manual (the Documentation) and the Software are copyrighted and all rights are reserved by MicroStrategy, Inc. MicroStrategy, Inc. reserves
the right to make periodic modifications to the Software or the Documentation without obligation to notify any person or entity of such revision. Copying, duplicating, selling, or
otherwise distributing any part of the Software or Documentation without prior written consent of an authorized representative of MicroStrategy, Inc. are prohibited. U.S.
Government Restricted Rights. It is acknowledged that the Software and Documentation were developed at private expense, that no part is public domain, and that the
Software and Documentation are Commercial Computer Software provided with RESTRICTED RIGHTS under Federal Acquisition Regulations and agency supplements to
them. Use, duplication, or disclosure by the U.S. Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer
Software clause at DFAR 252.227-7013 et. seq. or subparagraphs (c)(1) and (2) of the Commercial Computer Software-Restricted Rights at FAR 52.227-19, as applicable.
Contractor is MicroStrategy, Incorporated., 1850 Towers Crescent Plaza, Tysons Corner, VA 22182. Rights are reserved under copyright laws of the United States with respect to
unpublished portions of the Software.
The following terms and notices apply regardless of whether you have executed a Separate Agreement:
Trademark Information
The following are either trademarks or registered trademarks of MicroStrategy Incorporated or its affiliates in the United States and certain other countries:
MicroStrategy, MicroStrategy 10, MicroStrategy 10 Secure Enterprise, MicroStrategy 9, MicroStrategy 9s, MicroStrategy Analytics, MicroStrategy Analytics Platform, MicroStrategy
Desktop, MicroStrategy Operations Manager, MicroStrategy Analytics Enterprise, MicroStrategy Evaluation Edition, MicroStrategy Secure Enterprise, MicroStrategy Web,
MicroStrategy Mobile, MicroStrategy Server, MicroStrategy Parallel Relational In-Memory Engine (MicroStrategy PRIME), MicroStrategy MultiSource, MicroStrategy OLAP
Services, MicroStrategy Intelligence Server, MicroStrategy Intelligence Server Universal, MicroStrategy Distribution Services, MicroStrategy Report Services, MicroStrategy
Transaction Services, MicroStrategy Visual Insight, MicroStrategy Web Reporter, MicroStrategy Web Analyst, MicroStrategy Office, MicroStrategy Data Mining Services,
MicroStrategy Narrowcast Server, MicroStrategy Health Center, MicroStrategy Analyst, MicroStrategy Developer, MicroStrategy Web Professional, MicroStrategy Architect,
MicroStrategy SDK, MicroStrategy Command Manager, MicroStrategy Enterprise Manager, MicroStrategy Object Manager, MicroStrategy Integrity Manager, MicroStrategy
System Manager, MicroStrategy Analytics App, MicroStrategy Mobile App, MicroStrategy Tech Support App, MicroStrategy Mobile App Platform, MicroStrategy Cloud,
MicroStrategy R Integration, Dossier, Usher, MicroStrategy Usher, Usher Badge, Usher Security, Usher Security Server, Usher Mobile, Usher Analytics, Usher Network Manager,
Usher Professional, MicroStrategy Services, MicroStrategy Professional Services, MicroStrategy Consulting, MicroStrategy Customer Services, MicroStrategy Education,
MicroStrategy University, MicroStrategy Managed Services, BI QuickStrike, Mobile QuickStrike, Transaction Services QuickStrike Perennial Education Pass, MicroStrategy Web
Based Training (WBT), MicroStrategy World, Best in Business Intelligence, Pixel Perfect, Global Delivery Center, Direct Connect, Enterprise Grade Security For Every Business,
Build Your Own Business Apps, Code-Free, Welcome to Ideal, The Worlds Most Comprehensive Analytics Platform, The Worlds Most Comprehensive Analytics Platform.
Period.
Other product and company names mentioned herein may be the trademarks of their respective owners.
Specifications subject to change without notice. MicroStrategy is not responsible for errors or omissions. MicroStrategy makes no warranties or commitments concerning the
availability of future products or versions that may be planned or under development.
Patent Information
This product is patented. One or more of the following patents may apply to the product sold herein: U.S. Patent Nos. 6,154,766, 6,173,310, 6,260,050, 6,263,051, 6,269,393,
6,279,033, 6,567,796, 6,587,547, 6,606,596, 6,658,093, 6,658,432, 6,662,195, 6,671,715, 6,691,100, 6,694,316, 6,697,808, 6,704,723, 6,741,980, 6,765,997, 6,768,788,
6,772,137, 6,788,768, 6,798,867, 6,801,910, 6,820,073, 6,829,334, 6,836,537, 6,850,603, 6,859,798, 6,873,693, 6,885,734, 6,940,953, 6,964,012, 6,977,992, 6,996,568,
6,996,569, 7,003,512, 7,010,518, 7,016,480, 7,020,251, 7,039,165, 7,082,422, 7,113,474, 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,035,382, 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, and 9,565,175. Other patent applications are
pending.
Third Party Software
Various MicroStrategy products contain the copyrighted technology or software of third parties ("Third Party Software"). Your use of MicroStrategy products is subject to all
applicable terms and conditions associated with any such Third Party Software
Datalogics, Inc.
Copyright 2000-2017 Datalogics, Inc.
Copyright 1984-2017 Adobe Systems Incorporated and its licensors. All rights reserved
Adobe, Adobe PDF Library, and The Adobe Logo are trademarks of Adobe Systems Incorporated.
CONTENTS
Overview and Additional Resources 5
Function categories 6
Function descriptions 6
How to find business scenarios and examples 7
Whats new in this guide 7
Prerequisites 9
Who should use this guide 9
Resources 9
Feedback 17
1. Understanding Functions in MicroStrategy 19
The basics of MicroStrategy objects, object definitions, and functions 19
Function syntax and formula components 21
Using functions in expressions 39
How MicroStrategy processes functions 57
Additional examples of functions in expressions 72
2. Standard Functions 93
Basic functions 94
Date and time functions 119
Internal functions 133
NULL/Zero functions 148
OLAP functions 150
Rank and NTile functions 205
String functions 223
3. Operators 241
Arithmetic operators 241
Comparison operators 243
Comparison for rank operators 251
Logical operators 255
4. Plug-In Package Functions 258
Data mining functions 259
Financial functions 261
Mathematical functions 317
Statistical functions 334
A. MicroStrategy and Database Support for Functions 375
Analytical Engine support for functions 375
Databases that a function can be evaluated on 379
Glossary 690
Index 728
This guide does not include information on Data Mining functions. This
information can be found in the Data Mining Services chapter of the Advanced
Reporting Guide.
Function categories
For the purposes of this guide, functions are organized into the following categories:
Chapter 2, Standard Functions
Basic functions, page 94
Date and time functions, page 119
Internal functions, page 133
NULL/Zero functions, page 148
OLAP functions, page 150
Rank and NTile functions, page 205
String functions, page 223
Chapter 3, Operators
Arithmetic operators, page 241
Comparison operators, page 243
Comparison for rank operators, page 251
Logical operators, page 255
Chapter 4, Plug-In Package Functions
Data mining functions, page 259
Financial functions, page 261
Mathematical functions, page 317
Statistical functions, page 334
Function descriptions
For every function identified, the description includes:
Information returned
Function syntax
Expression representative of the function (as applicable)
Notes regarding restrictions or conditions on execution and use (as applicable)
Examples of the function in reports or through simple descriptions
The following sections provide the location of additional examples, list prerequisites for
using this book, and describe the user roles the information in this book was designed
for.
The sample documents and images in this guide, as well as some example steps,
were created with dates that may no longer be available in the MicroStrategy
Tutorial project. If you are re-creating an example, replace the year(s) shown in
this guide with the most recent year(s) available in the software.
FiscalYear, page 126: Returns the fiscal year of the input date.
QuarterStartDate, page 130: Returns the date of the first day of the quarter in
which a date or timestamp occurs.
ToDateTime (convert string or number to a date or timestamp), page 131:
Converts a string of characters or a number into a date or timestamp.
WeekStartDate, page 132: Returns the date of the first day of the week in which
a date or timestamp occurs.
NullToEmpty, page 149: Converts a value of NULL to an empty string.
WeightedCorr (weighted correlation), page 197: Allows you to apply a weight, or
relative significance to each correlation.
WeightedCov (weighted covariance), page 199: Allows you to apply a weight, or
relative significance to each covariance.
WeightedMean, page 201: Allows you to apply a weight, or relative significance
to each value when determining an average.
WeightedStDev (weighted standard deviation of a sample), page 202: Allows
you to apply a weight, or relative significance to each value in a set of values.
PercentRank , page 217: Displays the ranking of values as a percentage.
PercentRankRelative, page 218: Displays the ranking of values as a percentage,
with the ranking based on a secondary data set.
BeginsWith, page 224: Determines if a text string begins with a specified text
pattern.
Char (convert ASCII code to a character), page 224: Converts a decimal ASCII
code into its associated character.
ConcatAgg (concatenate plus delimiter), page 225: Takes all of the content from
a single input and concatenates the content as a single string.
EndsWith, page 227: Determines if a text string ends with a specified text
pattern.
LastPosition (last position of substring), page 228: Returns the starting position
of the last occurrence of a series of characters in the input string.
Match, page 231: Uses regular expressions to search a string for a pattern of
characters and returns any matches that are found.
RepeatStr (repeat string), page 233: Returns a character or string of characters
the specified number of times.
Replace, page 234: Searches a string for a pattern of characters and replaces
each instance of those characters with the new characters you specify.
Split, page 236: Searches a string, separates the contents into groups of
characters based on a delimiter, and returns the string of characters requested.
MicroStrategy 9.4
Function support for databases has been updated in Databases that a function can
be evaluated on, page 379.
Prerequisites
Before reading this document, you should be familiar with:
Basic MicroStrategy terminology such as metrics, facts, attributes, and so on. This
information is found in the Basic Reporting Guide.
Standard mathematical function notation.
Resources
This section provides details on how to access books, online help, MicroStrategy
Education and Consulting resources, and how to contact MicroStrategy Technical
Support.
Documentation
MicroStrategy provides both manuals and online help; these two information sources
provide different types of information, as described below:
Manuals: MicroStrategy manuals provide:
Introductory information and concepts
Examples and images
Checklists and high-level procedures to get started
The steps to access the manuals are described in Accessing manuals and other
documentation sources, page 15.
Most of these manuals are also available printed in a bound, soft cover format. To
purchase printed manuals, contact your MicroStrategy Account Executive with a
purchase order number.
Help: MicroStrategy online help provides:
Detailed steps to perform procedures
Descriptions of each option on every software screen
Additional formats
MicroStrategy manuals are available as electronic publications, downloadable on the
Apple iBooks Store or Google Play, and can be read on your iOS or Android device
respectively. To download a book, search for the books title in the iBookstore or Google
Play. To view a list of manuals that are currently available, scan the following QR codes
using your devices camera:
For iOS devices, scan the following QR code:
For new MicroStrategy releases, it may take several days for the latest manuals to
be available on the iBookstore or Google Play.
Translations
For the most up-to-date translations of MicroStrategy documentation, refer to the
MicroStrategy Knowledge Base. Due to translation time, manuals in languages other than
English may contain information that is one or more releases behind. You can see the
version number on the title page of each manual.
Finding information
You can search all MicroStrategy books and Help for a word or phrase, with a simple
Google search at http://www.google.com. For example, type MicroStrategy derived
metric or MicroStrategy logical table into a Google search. As described above, books
typically describe general concepts and examples; Help typically provides detailed steps
and screen options. To limit your search to MicroStrategy books, on Googles main page
you can click More, then select Books.
Steps to use MicroStrategy Mobile to view and analyze data, and perform other
business tasks with MicroStrategy reports and documents on a mobile device.
MicroStrategy Mobile Design and Administration Guide: A Platform for
Mobile Intelligence
Information and instructions to install and configure MicroStrategy Mobile, as well
as steps for a designer working in MicroStrategy Developer or MicroStrategy Web to
create effective reports and documents for use with MicroStrategy Mobile.
MicroStrategy System Administration Guide: Tuning, Monitoring, and
Troubleshooting Your MicroStrategy Business Intelligence System
Steps to implement, deploy, maintain, tune, and troubleshoot a MicroStrategy
business intelligence system.
MicroStrategy Supplemental Reference for System Administration: VLDB
Properties, Internationalization, User Privileges, and other Supplemental
Information for Administrators
Steps for administrative tasks such as configuring VLDB properties and defining data
and metadata internationalization, and reference material for other administrative
tasks.
MicroStrategy Functions Reference
Function syntax and formula components; instructions to use functions in metrics,
filters, attribute forms; examples of functions in business scenarios.
MicroStrategy MDX Cube Reporting Guide
Information to integrate MicroStrategy with MDX cube sources. You can integrate
data from MDX cube sources into your MicroStrategy projects and applications.
MicroStrategy Operations Manager Guide
Instructions for managing, monitoring, and setting alerts for all of your
MicroStrategy systems from one console. This guide also includes instructions for
setting up and using Enterprise Manager to analyze your MicroStrategy system usage.
Help
Each MicroStrategy product includes an integrated help system to complement the
various interfaces of the product as well as the tasks that can be accomplished using the
product.
Some of the MicroStrategy help systems require a web browser to be viewed. For
supported web browsers, see the MicroStrategy Readme.
MicroStrategy provides several ways to access help:
Help button: Use the Help button or ? (question mark) icon on most software
windows to see help for that window.
Help menu: From the Help menu or link at the top of any screen, select
MicroStrategy Help to see the table of contents, the Search field, and the index for
the help system.
F1 key: Press F1 to see context-sensitive help that describes each option in the
software window you are currently viewing.
Adobe Reader is required to view these manuals. If you do not have Adobe Reader
installed on your computer, you can download it from
http://get.adobe.com/reader/.
The best place for all users to begin is with the MicroStrategy Basic Reporting Guide.
To access the installed manuals and other documentation sources, see the following
procedures:
To access documentation resources from any location, page 15
To access documentation resources on Windows, page 15
To access documentation resources on UNIX and Linux , page 15
1 Visit http://www.microstrategy.com/producthelp.
1 From the Windows Start menu, choose Programs (or All Programs),
MicroStrategy Documentation, then Product Manuals. A page opens in your
browser showing a list of available manuals in PDF format and other documentation
sources.
2 Click the link for the desired manual or other documentation source.
If bookmarks are not visible on the left side of a product manual, from the View
menu click Bookmarks and Page. This step varies slightly depending on your
version of Adobe Reader.
1 Within your UNIX or Linux machine, navigate to the directory where you installed
MicroStrategy. The default location is /opt/MicroStrategy, or
$HOME/MicroStrategy/install if you do not have write access to
/opt/MicroStrategy.
2 From the MicroStrategy installation directory, open the Help folder.
3 Open the Product_Manuals.htm file in a web browser. A page opens in your
browser showing a list of available manuals in PDF format and other documentation
sources.
4 Click the link for the desired manual or other documentation source.
If bookmarks are not visible on the left side of a product manual, from the View
menu click Bookmarks and Page. This step varies slightly depending on your
version of Adobe Reader.
Documentation standards
MicroStrategy online help and PDF manuals (available both online and in printed
format) use standards to help you identify certain types of content. The following table
lists these standards.
These standards may differ depending on the language of this manual; some
languages have rules that supersede the table below.
Type Indicates
bold Button names, check boxes, options, lists, and menus that are the focus of
actions or part of a list of such GUI elements and their definitions
Example: Click Select Warehouse .
italic Names of other product manuals and documentation resources
When part of a command syntax, indicates variable information to be replaced
by the user
Example: Type copy c:\filename d:\foldername\filename
Courier Calculations
font Code samples
Registry keys
Path and file names
URLs
Messages displayed in the screen
Text to be entered by the user
Example: Sum(revenue)/number of months.
+ A keyboard command that calls for the use of more than one key (for example,
SHIFT+F1).
A note icon indicates helpful information for specific situations.
A warning icon alerts you to important information such as potential security risks;
these should be read before continuing.
Education
MicroStrategy Education Services provides a comprehensive curriculum and highly
skilled education consultants. Many customers and partners from over 800 different
organizations have benefited from MicroStrategy instruction.
Courses that can help you prepare for using this manual or that address some of the
information in this manual include:
MicroStrategy Developer: Reporting Essentials
MicroStrategy Web: Report Analysis
MicroStrategy Web: Report Design
For a detailed description of education offerings and course curriculums, visit
http://www.microstrategy.com/Education.
Consulting
MicroStrategy Consulting Services provides proven methods for delivering leading-edge
technology solutions. Offerings include complex security architecture designs,
performance and tuning, project and testing strategies and recommendations, strategic
planning, and more. For a detailed description of consulting offerings, visit
http://www.microstrategy.com/services-support/consulting.
Technical Support
If you have questions about a specific MicroStrategy product, you should:
1 Consult the product guides, Help, and readme files. Locations to access each are
described above.
2 Consult the MicroStrategy Knowledge Base online at
https://resource.microstrategy.com/support.
Feedback
Please send any comments or suggestions about user documentation for MicroStrategy
products to: documentationfeedback@microstrategy.com.
Send suggestions for product enhancements to: support@microstrategy.com.
When you provide feedback to us, please include the name and version of the products
you are currently using. Your feedback is important to us as we prepare for future
releases.
Sum(Revenue)
New York AND Los Angeles
In the first example, each Month element in your data warehouse is assigned a numeric
ID between 1 and 12, where January is 1, February is 2, and so on. You want to generate
a report with a five-month forecast. One approach would begin with creating a new
attribute called 5 Months Ahead, using the expression Month + 5 in its attribute
definition.
Expressions can be used in many places. Metrics in particular often require complicated
expressions. In the second example above, the expression Sum(Revenue) is used to
define a relatively simple metric. Sum tells MicroStrategy to read individual Revenue
entries from the data warehouse and add them together to produce one single number
that will be displayed as Revenue on your report. This metric is a MicroStrategy object
that you can create.
The last example above shows a logical expression, which might be used in a filter. A
filter comprised of the expression New York AND Los Angeles would let a user
answer questions such as Which business travelers flew out of New York and out of Los
Angeles in 2006?
Expressions often form the basis of objects, which are the basic building blocks of all
MicroStrategy content and functionality. Objects that rely on these expressions are often
edited by changing the object expressions.
In this book, the terms object expression and object definition are
interchangeable unless otherwise noted.
To create an expression that accomplishes your goal, you will almost always utilize a
MicroStrategy function. Functions in MicroStrategy are powerful tools used to define
MicroStrategy objects (when they are integrated into object definitions) and initiate
complex user-selected calculations. The example Sum(Profit) in a metric definition
uses the Sum function to add various Profit entries in a data warehouse to arrive at one
final number to display on a report.
Wherever you use an expression, you can use a function. From creating basic objects to
building complex reports and analyzing data, you can create custom expressions using a
large library of functions that come with and are supported by MicroStrategy. Although
functions are most commonly used in metric expressions, they are also used to define
attribute forms, consolidation elements, custom groups, filters, facts, subtotals, and
transformations, all of which are MicroStrategy objects.
Function Type Function Examples MicroStrategy Objects That Can Use These Functions
Function Type Function Examples MicroStrategy Objects That Can Use These Functions
In this guide, MicroStrategy functions are grouped into function types. This section
provides information on function types, as well as their parameters and arguments.
This guide does not include information on Data Mining functions. This information can
be found in the Data Mining Services chapter of the MicroStrategy Advanced
Reporting Guide.
Function types
MicroStrategy functions are classified into the following types:
Single-value functions (also known as Non-grouping or Scalar functions): These
functions operate on each individual component of an input variable or argument,
resulting in an output element for each component. Examples of this category are
simple mathematical operators (+, -, *, /), Abs, Accrint, Ddb, Cos, Ln, Round,
Truncate, ApplySimple, and so on. For details, see Single-value functions, page 23.
Group-value functions (also known as Grouping or Aggregate functions): These
functions take one or more lists of values as input and generate a single output value
for each list. Examples of this category are Avg, AvgDev, Correlation, Count,
HomoscedasticTTest, Intercept, Slope, StDev, Sum, ApplyAgg, and so on. For details,
see Group-value functions, page 24.
OLAP functions (also known as Relative functions): These functions take multiple
elements from a list and return a new list of elements. Each element is related to and
dependent on one or more other elements in the list, and the relative positions of
elements within the list determines how computation is performed. Examples
include Rank, RunningSum, MovingAvg, NTile, ApplyOLAP, and so on. For details,
see OLAP (Relative) functions, page 25.
Comparison operators: These operators compare single values or lists of values,
or compare a list to a threshold value. Examples of this category are Between, Like,
Greater than(>), Less than (<), ApplyComparison, and so on. For details, see
Comparison operators, page 26.
Logical operators: These operators provide basic comparisons and return TRUE
or FALSE values based on the evaluation of the formula. This type of operator
includes And, Or, and Not. For details, see Logical operators, page 26.
Apply functions: These functions provide access to functions and syntactic
constructs that are not standard in MicroStrategy but are offered by various
relational database management system (RDBMS) platforms. Each of the functions
in this category substitutes for one of the function types mentioned above and can be
used wherever that type is used. For example, ApplySimple can be used wherever a
single-value function is used. For details, see Apply (Pass-through) functions, page
27.
Single-value functions
A single-value function operates on each individual component of one or more
arguments, resulting in an output component for each set of input components.
Subtraction, addition, division, and multiplication operators (, +, /, *) are common
examples of single-value functions. Other examples include Abs, Cos, Ln, Round, Sin,
Trunc, ApplySimple, and so on.
Single-value functions can be used to create facts, metrics, attribute forms, consolidation
elements, and transformations.
For example, using a single-value function that operates on four arguments, where each
argument is composed of a five-component list, returns five components. In other
words, the number of output components is equal to the number of input components in
each argument. A simple example using numbers follows:
Using the single-value + (addition) function, A+B=C
Where
A=1 (an argument containing one component whose value is 1)
B=2 (an argument containing a single component whose value is 2)
C=3 (the returned value, containing a single output component, whose value is 3)
In the example above, A, B, and C each contain one component. More generally,
given variables D and E used as arguments in the addition function, where D and E
each contain a five-component list, D+E results in a five-component list. Single-
value functions need not take a single value as an argument or even a single
argument. Rather, the basic requirement for a function to be categorized as single-
value is that the number of output components equals the number of input
components of the arguments.
The following two examples illustrate the use of single-value functions in the creation of
a transformed fact and a compound metric. Transforming a fact and creating a
compound metric are similar in that both use a single-value function to turn one or more
lists of values into another list of values. They differ in that, for a transformation, the
single-value function must be applied before a group-value function, while in a
compound metric the single-value function is applied after the group-value function.
Group-value functions
A group-value function takes one or more lists of values as input and returns a single
output value for each list. The existence of a GROUP BY clause in a SQL statement
indicates that you are using a group-value function.
The most common group-value functions include Avg, Count, Max, Median, Min, Stdev,
Sum, Var, ApplyAgg, and so on. First, Last, IRR, and NPV functions also belong to this
category, but they have an additional sort by feature (for more information, see Common
parameters, page 33). Sort by specifies the order that the values returned by an
expression will appear on a report. (For more information on the SortBy parameter, see
BreakBy and SortBy parameters, page 33.)
Group-value functions can be used to create simple metrics, nested metrics, and
compound metrics, as well as in the calculation of subtotals. The following examples
illustrate their use.
Example 1: Average
Avg([Employee Age])
In this example, the group-value function Avg operates on the argument Employee Age,
which is a list of the following elements: 27, 35, 32, 47, 43, 40, 30. The function reduces
the seven elements of the input value to a single output value of 36. For more
information on the Avg function, see Avg (average), page 95.
Example 2: Median
Median([Employee Age])
The only difference between Example 2 and Example 1 above is the fact that the group-
value function, Median, is used, instead of Avg. Again, the function reduces the seven
elements of the input value to a single output value of 35. For more information, see
Median, page 107.
Example: RunningSum
RunningSum <BreakBy={[Customer Region]}, SortBy=
([Customer State]) >(Revenue)
BreakBy refers to the attribute or hierarchy where calculations for an OLAP function
restart. To break by an attribute or hierarchy means to restart calculations that use
OLAP, or Relative, functions when the analytical engine reaches the next instance of the
specified attribute or hierarchy. Examples of OLAP functions include RunningStdevP,
Rank, NTile, and various expressions that calculate percent values. To break by an
attribute or hierarchy in an expression, you set the BreakBy parameter.
The RunningSum metric computes the sum of the revenue for each Customer Region by
adding the revenue for each Customer State to the revenue of the Customer States in the
rows above it and displaying the incremented total. The BreakBy Customer Region
condition causes calculations to begin again, however, when the next Customer Region is
encountered. (Notice in the figure below that the metrics Total Revenue and the
Running Sum for Arizona are equal because the calculation for Running Sum has
restarted, since Arizona is categorized in Southwest, a different Customer Region than
Wyoming, the previous Customer State on the report.) Because of the SortBy Customer
State condition, the Customer States are listed in ascending (alphabetical) order, as
shown in the report excerpt below.
Comparison operators
Comparison operators allow you to compare values. Using these operators, you can
compare single values or lists of values, or compare a list to a threshold value.
Comparison operators include < (less than), > (greater than), = (is equal to), Between,
Contains, Ends with, ApplyComparison, and so on. They are only used to create filters,
which limit report data to a subset based on your need.
Logical operators
Logical operators provide basic comparisons and return TRUE or FALSE values based on
the evaluation of the formula. For numeric values, 0 is treated as FALSE, and 1 is treated
as TRUE. These operators provide a means to combine data evaluations and comparison
operators into complex expressions. These expressions, in turn, can answer questions
such as Which of our regions produced revenue that exceeded a success threshold?
Logical operators include And, Or, Not, and ApplyLogic, all of which can only be used to
build filters where criteria are provided for the inclusion and exclusion of data from a
report display or metric calculation.
Example: And
((Revenue - Cost) > 50000) And [Sell-through Percentage]
> 25
Built for the attribute State, this filter limits report data to those states where Profit
(defined as Revenue - Cost) is greater than $50,000 and the Sell-through Percentage
is greater than 25%.
Each row in the table corresponds to an item that was on sale during the time between
Effec Date and Term Date. Your objective is to generate a report that lists all items (and
an associated metric that you choose) that were on sale on a particular date your user
chooses at run time. To generate this report, first create a value prompt named Test Date
that allows the user to input a date. Next, using that prompt, create a report filter using
the Custom expression box located in the Advanced Qualification pane of the Filter
Editor, as shown below.
Even though the filter is validated when you click Validate, MicroStrategy returns an
error when the report is executed. The error results from the fact that you are supplying
the SQL engine with two attributes and a value prompt, while MicroStrategy is expecting
to compare an attribute to the attributes Effec Date and Term Date. In effect, you have a
type mismatch problem.
In this case, you can use an Apply function. Instead of having MicroStrategy test the date
value prompt, you instruct your database to perform the test. It is important to
remember that you have chosen to use an Apply function only because MicroStrategy
Notice that the syntax is nested. The outer portion of the expression contains the
MicroStrategy function ApplyComparison, as well as the MicroStrategy prompt Test Date
and the attributes Effec Date and Term Date.
The inner portion of the syntax, which is contained within double quotes, is the database
operation #0 between #1 and #2. Code that is passed to the database using an Apply
function is always enclosed in quotes, and the arguments that are passed with that code
are written as placeholders in the form of #n, with the specific forms of the passed
attributes specified by the characters after the @ sign. In this example, [Effec
Date]@ID specifies that MicroStrategy pass the ID form of the Effec Attribute instead
of the DESC or any other form that may exist in the database. At run time, #0, #1, and
#2 are replaced by Test Date, Effec Date, and Term Date, respectively, so that the
database effectively receives the following syntax:
Test Date between Effec Date and Term Date
If the user chooses 06/16/07 as the value of Test Date at run time, the RDBMS reads the
table row by row to see if the date falls between Effec Date and Term Date. Whenever
06/16/07 falls between Effec Date and Term Date on a particular row, the item on that
row is returned in the result set. In this example, Blouse, Jeans, and Leather Shoes are
returned. (You can verify this result by looking at the data warehouse table shown in the
beginning of this section.) If your report is set up with Item as a row attribute, those
three items appear on your report, indicating that they (and only they) were on sale on
06/16/07.
For additional information about Apply functions, see Apply (Pass-Through) functions,
page 134. The syntax of each Apply function as well as examples appear in the sections
that immediately follow.
The attribute Hire Date is enclosed in brackets. Any time you type an attribute
whose name contains one or more spaces, the attribute must be enclosed in
brackets. (The use of brackets around compound object names is standard for
many objects in MicroStrategy and is not restricted to custom expressions and
Apply functions.)
The above example used an Apply function, ApplySimple. The next example uses
ApplyComparison.
The attributes Customer City and Call Center are enclosed in brackets. Any
time you type an attribute whose name contains one or more spaces, the attribute
must be enclosed in square brackets. (The use of brackets around compound object
names is standard for many objects in MicroStrategy and is not restricted to
custom expressions and Apply functions.)
Placing a filter that uses the custom expression above on a report that lists the Customer
City, Customer, and Call Center attributes yields the results below. (Only a portion of the
report is shown. Also, the Revenue metric has been added.)
Notice that the custom expression qualification filter accomplished the goal of returning
only data that satisfies the criterion that the Customer City attribute is the same as
the Call Center attribute.
Function parameters
Parameters determine how functions perform calculations. Any function, whether
standard or user-defined, can have parameters, which are contained within angle
brackets <> in an expression. If more than one parameter is used, they are separated by
commas.
Function parameter notations are only displayed in the Developer interface if the
parameter settings are changed from the default and you have set your View option
to Show Function Parameters.
You define parameters in the Function Name Parameters dialog box, which displays the
tabs Parameters, Break By, and Sort By. For steps on how to access this dialog box and
how to set function parameters with the Insert Function Wizard, see Accessing and
modifying function parameters, page 35.
Since every function object has parameters, the Parameters tab is always displayed. If a
function has additional parameters, such as BreakBy and SortBy, the related tabs are
displayed accordingly. The following subsections discuss the three tabs in more detail:
Common parameters, page 33
BreakBy and SortBy parameters, page 33
The details of each function are covered in this guide, including a listing and description
of each parameter that is available for the function. All parameters are listed within angle
brackets <> as part of the function syntax. To review the details on the parameters
available for each function, review the functions provided in:
Chapter 2, Standard Functions
Chapter 3, Operators
Chapter 4, Plug-In Package Functions
Common parameters
There are three common Parameter settings for a function object:
Distinct: is a TRUE/FALSE parameter that allows you to use all values or only the
unique values in the calculation.
Fact ID: forces the calculation to take place on a fact table containing the Fact_
ID.
NULL: is a TRUE/FALSE parameter that determines if the NULL value can be used
in the calculation.
Not all these settings apply to every function. In general, all group-value functions display
the FactID Parameter setting. OLAP functions do not have any of these Parameter
settings, but they may have BreakBy or SortBy parameters.
across customer regions can be useful, this report uses the BreakBy parameter to
focus on revenue comparisons within each customer region.
SortBy: The order of the return values of an expression in relation to the order of
the value or metadata object given. A sort by includes whether to sort in ascending or
descending order, and which metadata object to sort by. Sort by may also be
performed on the value of the subexpression, which is the input argument.
For example, in the report shown below the FirstInRange metric returns the first
profit value in a list of profit values. The FirstInRange function for this metric
uses a sort by of the Customer State attribute, which means the first value for each
customer state is returned.
OLAP functions often include BreakBy and SortBy parameters. For example, Rank has a
BreakBy parameter, and MovingAvg has a SortBy parameter.
A few group-value functions (First, Last, IRR, and NPV) are also defined by the SortBy
parameter. The First and Last functions are used effectively to calculate subtotals (see
Subtotal expressions, page 53).
For example, an inventory report lists the on-hand supply for each day. The report
subtotals are the last days inventory. Creating a user-defined subtotal that uses the Last
function provides the last day inventory subtotal. If the SortBy parameters of the
function are not set to sort by Day, the function may not provide the correct answer.
1 Open an object editor for a MicroStrategy object that can include functions in its
expression.
For steps to access the Insert Function Wizard from the different object
editors, see the MicroStrategy online help and search for Steps to access the
Insert Function Wizard. You can also see the section Using functions in
expressions, page 39 below that discusses the different types of expressions in
MicroStrategy.
2 Click the Insert Function button, labeled as f(x) on the expression toolbar.
The pages that you see depend on the function that you select.
This functionality is available in any editor in Developer where functions are used
in expressions. For more information, see the following sections:
You can insert a function by writing the name of the function and all required
parameters into the expression. You can also insert a function using the Insert
Function Wizard (see the procedure To build an expression using the Insert
Function Wizard, page 55).
The Function Name Parameters dialog box opens. All parameter tabs for the selected
function are available, and settings editable, from this dialog. This example uses the
RunningSum function.
Example 2: RunningSum
RunningSum<BreakBy={Quarter}, SortBy=(Region)>(Revenue)
This metric is defined to display the running sum of revenue on a quarterly basis, sorted
by region in ascending order. For another RunningSum example and its report, see
OLAP (Relative) functions, page 25.
Arguments
Arguments are the input data used in the calculation of a function. Arguments can be
numbers, text, or logical values (such as TRUE or FALSE) as well as constants (such as 1,
2, 3, or NULL). They can be lists of values or variables referencing lists of values.
Arguments in MicroStrategy are most often references to lists of values. In function
syntax, the arguments are enclosed in parentheses (). If the argument is a reference to a
MicroStrategy object, and the object name is alphanumeric or contains multiple words, it
is also contained in brackets [ ]. Depending on the function selected and the object being
created, in a MicroStrategy environment the input could comprise one or more of the
following objects:
Attributes: Attributes are most often used to group fact data. They are included in
reports to define the level of detail. Typically non-numeric, some common examples
of attributes are Year, Category, and Region.
Facts: Facts are the most commonly used input for metrics. They are numerical lists
obtained from specific columns in a fact table. Examples of facts include Units Sold,
Units Received, and Discount.
Metrics: Metrics represent calculations performed on data and can themselves be
used as input for further calculation by a function. Examples of metrics include
Percent Growth, Profit Margin, and Sell-through Percentage.
Columns: Column data is used when creating attribute form expressions and fact
expressions. The expressions for these objects define how column data is retrieved
from the warehouse. Examples of columns include TOT_DOLLAR_SALES, TOT_
COST, and CUST_CITY_ID.
Size is a positive integer that designates the number of elements per bucket.
The argument Size is a good candidate to use a prompt for, since it expects a single
value. Using a prompt to provide the value for Size allows a user to determine how
many elements should be included in each NTile bucket. This is a more flexible reporting
solution than defining a static value for the argument that is always used for the
calculation.
To include a prompt in a function expression, you can use the following syntax:
?[Prompt Name]
The Prompt Name is the name of the prompt object. For example, you can have the
following definition:
NTileSize([Total Revenue], ?[NTileValue Prompt])
In the syntax shown above, NTileValue Prompt is the name of a value prompt that
supplies the size for the NTileSize function.
When prompts are created, you can choose whether answering the prompt is
optional or required. Since arguments are required for a function to work properly,
it is a good practice to define prompt answers as required if the prompt is going to
be used in a function expression.
Many of the financial functions (see Financial functions, page 261) use arguments that
expect a single value, and thus are good candidates for using functions to provide their
values. For example, the function Coupdays (see Coupdays (coupon period, number of
days with settlement), page 267) includes a Frequency argument which can accept the
value of 1, 2, or 4 to determine the number of coupon payments per year. You could use a
value prompt for the Frequency argument to prompt the user to enter the frequency of
the coupon payments.
Derived attributes
This section explores the various roles of functions for each type of object and how to
access the expression builder in each case.
Metric expressions
Metrics are MicroStrategy objects that represent calculations performed on data. You can
define metrics by using the available functions to analyze your data and determine
business measures.
Formula and dimensionality are the two important components in a metric. While all
metrics have a formula, not all of them have dimensionality.
Formula: Is a mathematical expression using one or more functions, applied to the
data to be used in the calculation (facts, attributes, constants, or metrics). In SQL,
the formula commonly becomes part of the SELECT clause of the SQL command.
You can re-use the same formula in multiple metric definitions. This type of formula
is called a base formula, which can contain arithmetic operators, attributes, facts,
group functions, and non-group functions. A base formula does not have
dimensionality (see below). For more information on base formulas, see the Basic
Reporting Guide.
Dimensionality: determines the attribute level at which a metric is calculated.
After deciding on the target (the attribute), in dimensionality you can further define
filtering and grouping involved in the metric. All metrics, by default, calculate at the
report level.
Other optional components of a metric include condition (filter) and transformation. For
the purposes of this book, we only discuss formula and dimensionality related to the use
of functions. For information on all metric components, including additional
information and examples of level metrics, conditional metrics, and transformation
metrics, see the Advanced Reporting Guide.
There are two types of metrics:
Simple metric: has a formula and dimensionality (level). It can stand alone or be
used as a building block for a compound metric. A simple metric must use at least
one group-value function, such as Sum or Avg. It can also contain a non-group
function or arithmetic operator, in addition to the required group function, for
example, Sum(Revenue - Cost){~+}; however, the outermost formula must be
a group function.
Compound metric: is a combination of expressions that, through the use of
functions, are themselves metrics. In other words, a compound metric is made of
more than one complete metric. Any metric that is not a simple metric is a
compound metric by default. For example, all arithmetic functions that are used as
the root to connect two metrics yield compound metrics.
A compound metric cannot have dimensionality placed on the entire metric,
although dimensionality can be set separately on each of its component metrics.
The following three types of functions can be used to build simple and compound
metrics:
Single-value functions
Group-value functions
OLAP functions
The optional condition (filter) component of a metric can contain logical and
comparison operators. See the Filter Expressions subsection for details.
While the single-value and group-value functions are used to create both simple and
compound metrics under different circumstances (see examples to follow), the OLAP
functions always yield compound metrics, due to their unique characteristics (see OLAP
(Relative) functions, page 25).
In this example, the expression is Avg on the fact Revenue. Together they make up the
base formula. This simple aggregation metric has dimensionality, which is indicated by
{~+}, meaning that the metric is calculated at the lowest level on the report. For
example, if a report contains revenue by year and month, the numbers are calculated to
reflect monthly sales data. If month was removed from the report, the metric would
automatically be calculated at the new report level, which would reflect yearly sales data.
All group-value functions are aggregation functions, which, when used alone, yield
simple metrics.
In this example, the expression is Sum on the fact Cost. Together they make up the base
formula. This simple aggregation metric has dimensionality. However, unlike in Example
1, dimensionality is set at the level of the attribute Year, indicated by {Year +}. This
means that if a report contains cost by year and month, the numbers are calculated to
reflect yearly cost data.
Dimensionality of compound metrics is defined by the other metric definitions that are
combined to create a compound metric. In this example, the root Division (/) has two
children, Avg(Revenue) and Sum(Revenue), both of which are simple metrics
themselves, and each of which has its own dimensionality. The whole expression itself is
a compound metric because it uses two metrics and does not have its own
dimensionality.
You can also create metrics in Command Manager. For more information on this
method, see the Advanced Reporting Guide.
Metric Editor
The Metric Editor is used to create new metrics and edit existing metrics in
MicroStrategy. The interface allows you to build metric expressions and validate them.
1 Log in to a project.
2 In the MicroStrategy Developer File menu, point to New and then select Metric.
The New Metric dialog box is displayed.
3 Choose a Metric template and click OK to proceed. The Metric Editor displays.
4 Build the metric expression, accessing the functions in one of the following ways:
Expand the Functions and Operators folder using the drop-down list or
shortcut list in the Object Browser pane. Then expand the Functions,
Operators, or Plug-In Packages folder to access the various categories of
functions and operators.
Click (Insert Function) in the Definition pane. The Insert Function wizard
opens.
Type the function name and all required metric syntax directly in the Enter
your formula here box.
You can also edit existing metrics by using the Metric Editor. To access the editor,
select the appropriate metric in the folder list, object browser, or report view. Then
right-click and select Edit from the shortcut menu. The Metric Editor opens with
the selected metric loaded.
1 Log in to a project.
Example 1: Subtraction ( - )
(Year(CurrentDate()) - Year([HIRE_DATE]))
The attribute form Employee Experience is defined by the above expression using the
simple mathematical operator, subtraction.
This example can be found in the MicroStrategy Tutorial project in the following folder:
MicroStrategy Tutorial/Schema Objects/Attributes/Geography.
Example 2: InitCap
InitCap([CUST_LAST_NAME])
Text data is typically in all upper-case or all lower-case letters. This example shows that
for the attribute form of customers last name, you can use the single-value function,
InitCap, to make the first letter capitalized and all other letters in lower case.
Example 3: ApplySimple
ApplySimple("Datediff(YY,#0,getdate())", [BIRTH_DATE])
The attribute form, Age, can be defined by using the single-value function, ApplySimple.
For all Apply functions, do not use a group for the attribute form expression. Use
a single form because form groups are ignored by the Analytical Engine. For
example, you cannot use Customer@Name, where Name is a form group defined
as the customers first name, middle name, and last name.
The syntax of apply functions is database-specific. For more information, see
Internal functions, page 133.
Click (Insert Function) in the Definition pane. The Insert Function wizard
opens.
Type the function name and all required expression syntax directly in the Enter
your formula here box.
2 Select the attribute form you wish to edit from the Attribute Forms pane and then
click Modify. The Modify Attribute Form dialog box displays.
To add a new form to the existing Attribute, click New. This automatically
opens the New Attribute Form Expression dialog box.
To add a new expression to the existing form, click New. This automatically
opens the New Attribute Form Expression dialog box.
4 The Modify Attribute Form Expression dialog displays with the selected expression
loaded.
5 Create or edit the expression, accessing the functions in one of the following ways:
Click (Insert Function) in the Definition pane. The Insert Function wizard
opens.
Type/edit the function name and all required expression syntax in the Enter
your formula here box.
1 In the MicroStrategy Developer File menu, point to New and then select
Consolidation. The Consolidation Editor opens.
2 Double-click Click here to add new consolidation element.
3 The New Consolidation Element pane is enabled, in the lower right corner of the
editor. Build the expression for the new element.
You must drag and drop attributes into the Enter your expression here
box. Only the operators can be typed directly in the box.
For more information on custom groups, see Custom Groups and Consolidations
in the MicroStrategy Advanced Reporting Guide.
When you define custom group elements through advanced qualification, you can use
two types of functions:
Logical functions
Comparison functions
See the following examples.
Example 1: Subtraction ( - )
([Unit_Profit] - [Unit_Cost]) > 500
Example 2: And
([Units Sold] > 500) and ([Unit Profit] > 1000)
1 In the MicroStrategy Developer File menu, point to New and then select Custom
Group. The Custom Group Editor opens.
2 Double-click Double-click here or drag an object from the object browser
to add a custom group element.
3 Provide a name for the new element and double-click Add Qualification.
4 In the Custom Group Options pane, select Add an Advanced qualification and
click OK.
5 The Advanced Qualification pane opens. This is where the expression is built. The
functions are accessed in one of the following ways:
Click (Insert Function) in the Definition pane. The Insert Function wizard
opens.
Type the function name and all required expression syntax directly in the Enter
your formula here box.
Fact expressions
Facts are objects created by and shared between MicroStrategy users. They relate
numeric data values from the data warehouse to the MicroStrategy reporting
environment. A fact expression defines how a fact is calculated. The fact expression is
part of the Fact Definition component of a fact structure. You can use functions to create
fact expressions, and arguments that are used in the expressions are columns.
Facts can be defined as:
Implicit
Derived
Heterogeneous
For more information on facts and fact structure, see the MicroStrategy Project
Design Guide.
In the context of MicroStrategy functions, this book discusses derived fact expressions.
Derived fact expressions can only use single-value functions, including simple arithmetic
operators (+, -, /, *). See the following two examples.
Example 1: Subtraction ( - )
([UNIT_PRICE] - [UNIT_COST])
The fact Unit Profit is defined using the table columns Unit_Price and Unit_Cost and a
simple mathematical operator, subtraction.
Example 2: Multiplication ( * )
([QTY_SOLD] * ([UNIT_PRICE] - DISCOUNT))
The fact Revenue is defined using three table columns and two arithmetic operators,
subtraction and multiplication.
Both examples can be found in the MicroStrategy Tutorial project in the following
folder: MicroStrategy Tutorial/Schema Objects/Facts.
Click (Insert Function) in the Definition pane. The Insert Function wizard
opens.
Type the function name and all required expression syntax directly in the Enter
your formula here box.
Click (Insert Function) in the Definition pane. The Insert Function wizard
opens.
Type the function name and all required expression syntax directly in the Enter
your formula here box.
You can use either the Fact Editor or the Fact Creation Wizard to create facts;
however, only the Fact Editor allows you to use advanced expressions to define the
fact.
Filter expressions
A filter specifies the conditions that data must meet to be included in the report results.
In SQL, a filter is specified after the WHERE clause. A filter can be a report object, that
is, a report filter, a report limit, or a view filter, that restricts the data returned or the
display or view of data on a report. For detailed information on report filters, see the
Advanced Reporting Guide .
A filter can also be a metric qualifier created using custom expressions employing
functions. It is used as the optional condition component of a metric. You can create this
type of filters by using the Advanced Qualification dialog box within the Filter Editor.
Only the following types of functions can be used in filter expressions:
Logical operators
Comparison operators
You can achieve the same result by using a set (metric) qualification on a
compound metric (such as the one in the example defined as Revenue - Cost).
The custom filter expression is used here for illustration purposes. It is up to you
which method you prefer to use.
Example 2: ApplyComparison
ApplyComparison("#0 between #1 and #2", ?[Value Prompt
Date], [Order Date]@ID, [Ship Date]@ID)
ApplyComparison is commonly used to create custom filters. In this example, the filter
compares a user-entered date to see if it is between the Order_Date and the Ship_Date.
1 In the MicroStrategy Developer File menu, point to New and then select Filter. The
Filter Editor is displayed.
2 In the Filter Definition pane, double-click Double-click here to add a
qualification or drag an object from the Object Browser. The Filtering
Options pane is displayed.
3 In the Filtering Options pane, select the Add an Advanced qualification option.
Then click OK. The Advanced Qualification pane is displayed.
4 Select Custom Expression from the Option list. Then use the Custom Expression
box to build and validate your custom filter. Access the functions in one of the
following ways:
Expand the Functions and Operators folder using the drop-down list or
folder list. Then expand the Functions, Operators, or Plug-In Packages
folder to access the various categories of functions and operators.
Click (Insert Function) in the Definition pane. The Insert Function Wizard
opens.
Type the function name and all required metric syntax directly in the Enter
your formula here box.
Subtotal expressions
Subtotals allow you to dynamically control the computation and display of report data
within desired groupings. Subtotals are applied to report metrics to calculate totals and
for dynamic aggregation.
The standard predefined subtotal functions, which are automatically available for use
with every metric and report, are simple aggregate functions that satisfy many
subtotaling requirements. If they do not answer your particular needs, you can create a
user-defined subtotal using the Subtotal Editor or through the SDK. User-defined
subtotals allow you to develop your own subtotals, using single-value functions or group-
value functions.
Both predefined and user-defined subtotals can be applied to reports from the
Subtotals/Aggregation tab in the Metric Editor.
For more information on subtotals and the procedures for creating and applying
them, see the Reports chapter of the Advanced Reporting Guide or the
MicroStrategy online help.
Example: Division ( / )
Sum(Sum(x*[Units Sold]){Year}/Sum([Units Sold]){Year}){}
1 Log in to a project.
2 In the MicroStrategy Developer File menu, point to New and then select Subtotal.
The Subtotal Editor displays.
3 The Subtotal Editor is very similar to the Metric Editor. To access the functions used
to create a new subtotal, you can do one of the following:
Expand the Functions and Operators folder using the drop-down list or
shortcut list in the Object Browser pane. Then expand the Functions,
Operators or Plug-In Packages folder to access the various categories of
functions and operators.
Click (Insert Function) in the Definition pane. The Insert Function wizard
opens.
Type the function name and all required subtotal syntax directly in the Enter
your formula here box.
Transformation expressions
Transformations are schema objects that use business rules to compare values at
different time periods. A typical example of this type of analysis is a TY/LY comparison
(This Year versus Last Year).
Transformations are schema objects; therefore, you must have the appropriate
privileges to create or modify them.
1 In the MicroStrategy Developer File menu, point to New and then select
Transformation. The Transformation Editor is displayed. The Select Member
Attribute dialog box also opens.
2 Select the attribute on which to base the transformation. Then click OK. The
Expression Editor opens.
3 Build an expression for the transformation of the selected member attribute,
accessing functions in one of the following ways:
Click (Insert Function) in the Definition pane. The Insert Function wizard
opens.
Type the function name and all required expression syntax directly in the Enter
your formula here box.
For detailed information on each page of the Insert Function Wizard, see the
MicroStrategy online help and search for Using the Insert Function Wizard.
1 Click the Insert Function button to access the wizard. The Select Function
2 Navigate through the folder structure to the function you want to use. Select the
function and click Next to continue. The Arguments page opens.
When a function is highlighted, its syntax and a short description are displayed
in the lower left corner of the window.
3 Include the arguments for your function by typing the values or names of the
arguments or by browsing for the arguments:
Type the appropriate values or name of the arguments into the available boxes.
Click (the Browse button). The Open dialog box opens, which is a standard
Windows dialog box for file selection.
Select the argument on which the function acts. Click Open to select the
argument and return to the Insert Function Wizard.
4 Click Next when you have provided all arguments. The Parameters page is displayed
(if applicable).
For group-value metrics such as Count, Min, and Max, standard parameters
(Distinct, NULL, and FactID) display together on the only page available, called
Parameters. The default for FactID is (Nothing), meaning that the calculation
searches for the input argument from the lookup table. Otherwise, make a
selection from the pull-down list to force the calculation to look in another table.
Parameter values are displayed only if you have set your view to Show
Function Parameters and have modified a parameter from its default
setting.
If the database can perform the calculation, the SQL Engine sends the instructions
to the database; otherwise, the Analytical Engine processes the task.
Most of these examples (except where noted) can be recreated using the objects in
the MicroStrategy Tutorial. Tutorial data is stored in a Microsoft Access
database.
Now, consider Report 1B, again with the same attribute, Region, on the row axis, but
with a different simple metric defined as M1B=AvgDev(Revenue){~} on the column
axis. This report shows how revenue data varies from its mean for each region. The
database does not support the function Average Deviation; therefore, the computation is
performed by the Analytical Engine. The following SQL is generated:
Report 1B (MicroStrategy Group-value function)
select a11.[CALL_CTR_ID] AS CALL_CTR_ID,
a11.[CUST_CITY_ID] AS CUST_CITY_ID,
a12.[REGION_ID] AS REGION_ID,
a13.[REGION_NAME] AS REGION_NAME,
a11.[TOT_DOLLAR_SALES] AS WJXBFS1
from [CITY_CTR_SLS] a11,
[LU_CALL_CTR] a12,
[LU_REGION] a13
where a11.[CALL_CTR_ID] = a12.[CALL_CTR_ID] and
a12.[REGION_ID] = a13.[REGION_ID]
[An analytical SQL]
WJXBFS1 DOUBLE)
insert into ZZT1Y03009ZMD000
select a12.[COUNTRY_ID] AS COUNTRY_ID,
sum(a11.[TOT_DOLLAR_SALES]) AS WJXBFS1
from [CITY_CTR_SLS] a11,
[LU_CALL_CTR] a12
where a11.[CALL_CTR_ID] = a12.[CALL_CTR_ID]
group by a12.[COUNTRY_ID]
select a11.[REGION_ID] AS REGION_ID,
a11.[REGION_NAME] AS REGION_NAME,
pa1.[WJXBFS1] AS WJXBFS1
from [ZZT1Y03009ZMD000] pa1,
[LU_REGION] a11
where pa1.[COUNTRY_ID] = a11.[COUNTRY_ID]
drop table ZZT1Y03009ZMD000
The first pass of SQL creates a temporary table to hold the data. The second pass
computes the metric at the Country level, while the third pass joins with attribute Region
since the result of the aggregation has to be displayed for each region. The final pass
drops the temporary table.
In Report 2B, an Analytical SQL pass is necessary to compute AvgDev since it is not a
database supported group-value function. In the next pass, the results of the calculation
are inserted back into the temporary database structures. The last SQL pass is the same
as Report 2A, since it is used to display the result for all regions.
Each example contains two reports, the first one showing the SQL syntax when
calculations are processed by the database and the second one when calculations are
processed by the Intelligence Server.
The use of transform in this context refers to retrieving a fact in a different form.
For example, you can obtain the absolute value for a fact or the natural logarithm,
but the fact is the same. This differs from a transformation where the data
retrieved is different when a transformation is applied, for example, last years
revenue instead of this years revenue.
2 Then, the Sum function is performed on the new fact, namely Ln(Revenue).
Now, put M3B with Region on the template, the following SQL is generated:
In this case, as noted by the text [An Analytical SQL], the functions Trunc and
Sum are computed by the Intelligence Server. Intelligence Server computes the new fact
Trunc([Dollar Sales]) first and then uses the Sum function to sum the new fact
for each region.
Report 4A (SQL single-value before and after group-value functions) - SQL Server
2000
Pass0 - Duration: 0:00:02.58
select a13.REGION_ID REGION_ID,
max(a14.REGION_NAME) REGION_NAME,
sum(LOG(a11.ORDER_AMT)) WJXBFS1,
LOG(sum(a11.ORDER_AMT)) WJXBFS2
from ORDER_FACT a11
join LU_EMPLOYEE a12
on (a11.EMP_ID = a12.EMP_ID)
join LU_CALL_CTR a13
on (a12.CALL_CTR_ID = a13.CALL_CTR_ID)
To process metric M3A, the single-value function Ln is calculated before the group-value
function Sum, and for metric M4A, Ln is calculated after Sum.
Similarly, if you put metrics M3B and M4B together with attribute Region on the
template, and the database does not support the Trunc function, then the following SQL
is generated:
Pass0 - Duration: 0:00:12.67
select a11.ORDER_DATE DAY_DATE,
a11.EMP_ID EMP_ID,
a11.ORDER_ID ORDER_ID,
a13.REGION_ID REGION_ID,
a14.REGION_NAME REGION_NAME,
a11.ORDER_AMT WJXBFS1
from ORDER_FACT a11
join LU_EMPLOYEE a12
on (a11.EMP_ID = a12.EMP_ID)
join LU_CALL_CTR a13
on (a12.CALL_CTR_ID = a13.CALL_CTR_ID)
join LU_REGION a14
on (a13.REGION_ID = a14.REGION_ID)
Pass1 - Duration: 0:00:08.46
[An Analytical SQL]
Alternatively, if you execute the above report against a database that does support OLAP
computations (in this case Oracle 9i), then the following SQL is generated:
The following example shows how the Intelligence Server computes OLAP functions
when the database does not support OLAP functions. The Intelligence Server retrieves all
components: the input metric, BreakBy parameter, and SortBy parameter. In the above
examples, since the SortBy parameter setting is by Value, it is sufficient to bring back just
the input metric (WJXBFS1).
Run a report similar to the one for window size, deleting the attributes Category and
Item from the template and adding Subcategory. The results for metric M1A are
completely different from the previous report because if Category and Item are not on
the template, then the level of aggregation for metric M1A is replaced by Subcategory,
which is on the template. On the other hand, OLAP metric OM1 must still restart the
calculation (break by) for each Category and therefore remains in the appropriate
Select and Partition by clauses. Notice that in both the SQLs below, the
Intelligence Server always selects Category even though Category is not on the template.
For a database that does not support OLAP functions (in this case Microsoft Access), the
following SQL is generated:
If the database supports computation of OLAP functions (in this example Oracle), then
the following SQL is generated:
If the database supports computation of OLAP functions (in this example Oracle 9i), the
following SQL is generated:
In both SQLs, the Intelligence Server selects a13.CUST_CITY_ID, even though attribute
Customer City is not on the report. In Report 7B, this attribute is also in the group by
clause. Sort by attribute Customer City@ID is done because of attribute Customer that is
a child of Customer City.
In Report 7B, the SQL has to issue group by CUST_LAST_NAME and CUST_FIRST_
NAME due to the sort by Customer@Name. For optimization purposes, the Intelligence
Server only groups by the ID column.
There is a VLDB setting that allows you to group by non-ID columns. This VLDB
setting can be set for any report that uses an OLAP metric with a sort by attribute
description.
If the database supports computation of OLAP functions (in this example Oracle), the
following SQL is generated:
For instructions on creating a plug-in function, see the Function Plug-in Wizard
online help.
Byte
Short
Long
Float
Double
String (BSTR)
Bool
Date
The following two examples illustrate how plug-in functions could be defined:
FORECAST<n>(numeric_vector1) = numeric1
Aggregate function with a numeric vector as an input argument and a numeric
scalar as an output argument.
One parameter, n, which is a long integer.
Given a series of values, and given that those values are each separated by one
time interval, this function predicts what the value will be after n additional time
intervals.
For example, you include the unit cost of an item in order to predict how much the
unit cost will be two years later.
FORECAST<2>(UnitCost)
In this example, UnitCost includes a four year history of data, providing the
following yearly values to the FORECAST function.
FORECAST<2>(100,120,140,160)
This results in a value of 200, which is the predicted unit cost two years from the
time of the most recently recorded cost data.
CUSTOMNUMBERFORMAT(numeric1) = string1
Simple function with numeric scalar as input argument and string scalar as
output argument.
No parameters.
Transforms a number into a string representation of that number not supported
by any of MicroStrategy's out-of-the-box metric format strings.
Example: CUSTOMNUMBERFORMAT(123456789) = '1 2345.6789'
1 From the Start button, select Programs, then Microsoft Visual Studio, and
then Microsoft Visual C++. The InstallShield window is displayed.
2 From the File menu, select New. The New window is displayed.
3 On the Projects tab, select MicroStrategy Function Plug-in Wizard.
4 Provide a name in the Project Name text box.
Do not use spaces in the project name. Because the project name will become
the name of the library, use something short and descriptive. For illustration
purposes, the project name myFP is used throughout the online help.
5 Change the location of the project, if needed. Then click OK. The Function Plug-in
Wizard - Step 1 of 2 window is displayed.
6 Click Help for the Function Plug-in Wizard online help whenever needed.
1 In the master MicroStrategy online help, search for custom functions, or open
the Creating and Modifying Additional Report Objects folder, expand the
Metrics folder, and then expand the Using custom functions folder.
2 Launch the Using custom functions topic. This topic contains a link to the
Function Plug-in Wizard online help.
3 Click the Function Plug-in Wizard on-line help link. The Function Plug-in
Wizard online help opens in a new help window.
In this report it looks like all call centers had a significant increase in the average daily
sales in each successive year. However, an average value by itself does not represent the
complete picture.
To get more information, you can check the standard deviation of daily sales between
each successive year for each call center. You can accomplish this by adding Standard
Deviation in Daily Sales to the report. The metric is defined as:
StDev Daily Sales = Stdev(Sum(Revenue) {~+, Day+} ) {~+}
In statistics, standard deviation is a value which shows how widely a set of values
differs from the mean.
The resulting report provides the average and the standard deviation of daily sales for all
years, for each call center.
This report shows that all call centers have greater average daily sales in each successive
year. Additionally, the standard deviation of daily sales is higher for each successive year,
with a number of exceptions. A couple of these exceptions include Atlanta between 2009
and 2010, as well as San Francisco between 2008 and 2009. The higher standard
deviation values mean that there is more volatility in these results. Therefore, the higher
average daily sales in each successive year are not necessarily a progressive increase over
previous years; they may have been caused by random fluctuations.
Based on this observation, you next need to find out which call centers have a
statistically significant difference in their average daily sales between these successive
years. You can get the result by testing the hypothesis that the average daily sales are the
same, against the hypothesis that the average daily sales are significantly different. This
must be tested for each call center.
The hypothesis testing is accomplished by computing the p-value. In statistics, p-value is
the probability of making a decision to reject a fact, given that the fact is correct. In the
context of this example, it is the probability of making a mistake by concluding that the
average daily sales in 2008 is significantly different from 2009, given that actually they
are about the same. In general, you want to restrict this type of error so that it is smaller
than a certain tolerance level. This tolerance level is usually set to between 2.5% to
10.0%.
If you assume that the standard deviations of daily sales for all years are the same, then
you can use a function called HomoscedasticTTest to compute the p-value. If you assume
that the daily standard deviations are different, then you must use the function
HeteroscedasticTTest. The following examples consider both of these assumptions and
compute the p-value using HomoscedasticTTest and HeteroscedasticTTest.
This report uses simple metrics based on other metrics, because to calculate the p-value,
you need to compute the daily sales for each call center for each day. You also need to
group the fact Revenue at the levels of Day and Call Center for all years. The fact table
DAY_CTR_SLS is available at the levels of Employee, Order, and Day.
You need to create a temporary table with this structure using metrics. These metrics are
then used in simple metrics to calculate the p-value.
Follow the steps below to build the necessary metrics for the Hypothesis Testing report.
1 Build a metric to create the column for [Daily Sales (current year)] in the temporary
table. This metric is defined as:
Daily Sales (current year)= Sum(Revenue) {~+, Day+} <
[Current year in sample DB]; @2; ->
The default level notation {~+} is placed on the metric since the default is to group
by an attribute on the report. In this example, that report attribute is Call Center.
The metric condition Current year in sample DB is also applied to calculate
the data for the current year available in the MicroStrategy Tutorial data.
2 Build a metric to create the column for [Daily Sales (last year)] in the temporary
table. This metric is defined as:
Daily Sales (last year) = Sum(Revenue) {~+, Day+} <
[Last year in sample DB]; @2; -> | [Last Year's] |
This metric uses a metric condition and a transformation.
The metric condition Last year in sample DB is applied to calculate the
data for the previous year available in the MicroStrategy Tutorial data.
The transformation Last Year's is necessary because attribute Day is a child
of attribute Year. To show Daily Sales in Day 1, 2, , N of last year together with
Daily Sales in Day 1, 2, , N of the current year, you must use the
transformation to supply this data.
3 Build the simple metrics to compute the p-value for each call center by using the
metrics above. The simple metrics are defined as follows:
The resulting report, Hypothesis Testing, is shown above. All call centers, except for
Atlanta, Salt Lake City, Seattle, and Fargo, have a p-value of less that 5%. This indicates
that the probability of making an error in concluding that the sales have significantly
increased is low for all but these four call centers. Additionally, even Salt Lake City and
Fargo are at 20% or lower. This is strong evidence that average daily sales for the
majority of the call centers can be attributed to a steady increase, rather than random
fluctuations.
The SQL generated for the report Hypothesis Testing is displayed below, along with a
summary of the actions taken at the end of the SQL statement:
Pass0 - Execution Duration:0:00:00.06
create table ZZTH0FDXLS4MD000 (
DAY_DATE TIMESTAMP,
CALL_CTR_ID SHORT,
WJXBFS1 DOUBLE)
Pass1 - Execution Duration:0:00:00.34
insert into ZZTH0FDXLS4MD000
select a12.[DAY_DATE] AS DAY_DATE,
a11.[CALL_CTR_ID] AS CALL_CTR_ID,
a11.[TOT_DOLLAR_SALES] AS WJXBFS1
from [DAY_CTR_SLS] a11,
[LU_DAY] a12
where a11.[DAY_DATE] = a12.[LY_DAY_DATE]
and a12.[YEAR_ID] in (2010)
Pass2 - Execution Duration: 0:00:00.00
create table ZZTU1RY0YSKMD001 (
DAY_DATE TIMESTAMP,
CALL_CTR_ID SHORT,
WJXBFS1 DOUBLE)
Who are my valuable customers? (Example 1), page 78: Determines valuable
customers as those whose average spending is above an upper bound of sales orders.
Who are my valuable customers? (Example 2), page 82: Determines valuable
customers as those whose average spending is above an upper bound of sales orders.
Additionally, valuable customers are compared for each Customer Region, rather
than comparing customers in all regions.
The metric to compute the population standard deviation of sales orders from the
ORDER_FACT table is defined as follows:
M02 = StdevP(Revenue) {![Call Center]+, !Year+,
!Employee+, !Order+, !Day+}
3 You must know the number of rows in the ORDER_FACT table. You need this value
to calculate the cut-off value. You can retrieve this value by using the Count function,
in particular, Count from the ORDER_FACT table. The metric to count the data in
the ORDER_FACT table is defined as follows:
M03 = Count(Revenue) {![Call Center]+, !Year+,
!Employee+, !Order+, !Day+}
4 Under the assumption of normal distribution with the parameters given above, you
must determine the cut-off value that represents the top 5% of sales order amounts.
To do this, you can use the Confidence plug-in function. The metric to compute the
cut-off number is defined as follows, using some of the metrics defined above:
M04 = Confidence(0.01, [M02], [M03])
The number 0.01 comes from a normal distribution with 99% confidence level.
5 The metric that calculates the upper bound uses some of the metrics defined above,
and is defined as follows:
M05 = ([M01] + [M04])
6 You must calculate the average sales for each customer to get a list of valuable
customers based on the criteria. The metric is defined as follows:
Average Sales = Avg(Revenue) {~+}
You do not need to include the level of aggregation for Average Sales since the
default {~+} notation is replaced by the attribute Customer.
7 You must also apply a metric qualification in a filter to restrict the rows returned to
those that meet the definition of valuable customers. The filter is defined as follows:
F01 = Set of Customers where (Average Sales Greater
than [M05]
To generate a report listing valuable customers, create a report with the attribute
Customer on the row axis and the attribute Customer Region on the page-by axis. Apply
filter F01 to the report to produce a list of valuable customers for each attribute element
in Customer Region. The Valuable Customers 01 report is shown below:
]
Pass5 - Execution Duration: 0:00:00.00
insert into ZZTW4A12VECMD001 values (1, 33.4351602545)
Pass6 - Execution Duration: 0:00:00.00
create table ZZTPDKUSLWSMQ002 (
CUSTOMER_ID LONG)
Pass7 - Execution Duration: 0:00:00.10
insert into ZZTPDKUSLWSMQ002
select pa11.[CUSTOMER_ID] AS CUSTOMER_ID
from [ZZTLZV82TJ0MD000] pa11,
[ZZTW4A12VECMD001] pa12
where pa11.[CUSTOMER_ID] = pa12.[CUSTOMER_ID]
and (pa11.[WJXBFS1] > pa12.[WJXBFS1])
Pass8 - Execution Duration: 0:00:01.53
select a11.[CUSTOMER_ID] AS CUSTOMER_ID,
max(a13.[CUST_LAST_NAME]) AS CUST_LAST_NAME,
max(a13.[CUST_FIRST_NAME]) AS CUST_FIRST_NAME,
a15.[CUST_REGION_ID] AS CUST_REGION_ID,
max(a16.[CUST_REGION_NAME]) AS CUST_REGION_NAME0,
avg(a11.[TOT_DOLLAR_SALES]) AS WJXBFS1
from [CUSTOMER_SLS] a11,
[ZZTPDKUSLWSMQ002] pa12,
[LU_CUSTOMER] a13,
[LU_CUST_CITY] a14,
[LU_CUST_STATE] a15,
[LU_CUST_REGION] a16
where a11.[CUSTOMER_ID] = pa12.[CUSTOMER_ID] and
a11.[CUSTOMER_ID] = a13.[CUSTOMER_ID] and
a13.[CUST_CITY_ID] = a14.[CUST_CITY_ID] and
a14.[CUST_STATE_ID] = a15.[CUST_STATE_ID] and
a15.[CUST_REGION_ID] = a16.[CUST_REGION_ID]
group by a11.[CUSTOMER_ID],
a15.[CUST_REGION_ID]
Pass9 - Execution Duration: 0:00:00.00
[Populate Report Data]
Pass10 - Execution Duration: 0:00:00.06
drop table ZZTLZV82TJ0MD000
Pass11 - Execution Duration: 0:00:00.00
drop table ZZTW4A12VECMD001
Pass12 - Execution Duration: 0:00:00.00
drop table ZZTPDKUSLWSMQ002
Pass0 and Pass1 compute the average sales per customer (Average Sales metric) and
put the results in a temporary table.
Pass2 retrieves ORDER_DETAIL data, puts the data into memory, and uses the data
to compute M01, M02, and M03.
Pass3 creates a temporary table used to store the results of the calculations.
Pass4 calculates M02 using the Intelligence Server because the group-value function
StDevP is not supported by the Access database. The values of M01, M02, and M03
are used to compute M05.
Pass5 inserts the results of the calculations into the temporary table.
Pass6 and Pass7 use the earlier two temporary tables to qualify on valuable customers
based on the definition.
Pass8 displays the report with attributes Customer and Customer Region.
The remaining passes perform additional report preparation and drop the temporary
tables.
The number 1.96 comes from a normal distribution with 95% confidence
level. In practice, this number is often rounded to 2 instead of 1.96.
5 The metric used to determine each customers spending so that it can be compared
to the cut-off value is defined as follows:
M10 = Sum(Revenue){~+}
6 The metric qualification (filter) needed to restrict the report to a list of valuable
customers based on Definition 2 is defined as follows:
F03 = Set of Customer where (M10 Greater than [M09])
7 To view the last order sales from all valuable customers, use the metric defined as
follows:
Last Order Sales = Sum(Revenue) {~+, >|Day+}
You must compute order sales for each customer at the Day level from the ORDER_
FACT table, but must take it from the last Day on that fact table. The {~+} is
replaced by any attribute on the report. In this example, it is the Customer attribute.
Build a report putting the attribute Customer on the row axis, the attribute Customer
Region on the page-by axis, and the Last Order Sales metric on the column axis, then
applying the filter F03. The Valuable Customers 02 report is shown below.
a11.[DISCOUNT]))) AS WJXBFS1
from [ORDER_DETAIL] a11,
[LU_CUSTOMER] a12,
[LU_CUST_CITY] a13,
[LU_CUST_STATE] a14,
[LU_DAY] a15
where a11.[CUSTOMER_ID] = a12.[CUSTOMER_ID] and
a12.[CUST_CITY_ID] = a13.[CUST_CITY_ID] and
a13.[CUST_STATE_ID] = a14.[CUST_STATE_ID] and
a11.[ORDER_DATE] = a15.[DAY_DATE]
and a15.[YEAR_ID] in (2010)
group by a14.[CUST_REGION_ID]
Pass4 - Execution Duration: 0:00:00.03
select a11.[CUSTOMER_ID] AS CUSTOMER_ID,
a11.[ORDER_ID] AS ORDER_ID,
a11.[ITEM_ID] AS ITEM_ID,
a11.[EMP_ID] AS EMP_ID,
a11.[ORDER_DATE] AS DAY_DATE,
a14.[CUST_REGION_ID] AS CUST_REGION_ID,
(a11.[QTY_SOLD] * (a11.[UNIT_PRICE] - a11.[DISCOUNT]))
AS WJXBFS1
from [ORDER_DETAIL] a11,
[LU_CUSTOMER] a12,
[LU_CUST_CITY] a13,
[LU_CUST_STATE] a14
where a11.[CUSTOMER_ID] = a12.[CUSTOMER_ID] and
a12.[CUST_CITY_ID] = a13.[CUST_CITY_ID] and
a13.[CUST_STATE_ID] = a14.[CUST_STATE_ID]
Pass5 - Execution Duration: 0:00:00.00
create table ZZTS6MZ3N2BMD002 (
CUST_REGION_ID SHORT,
WJXBFS1 DOUBLE)
Pass6 - Execution Duration: 0:00:00.00
[Analytical SQL calculated by the Analytical Engine:
select CUST_REGION_ID,
ISNULL((1.96 * Stdev(WJXBFS1)), 0)
from [previous pass]
]
Pass7 - Execution Duration: 0:00:00.00
insert into ZZTS6MZ3N2BMD002 values (1, 127.4088118401)
Pass8 - Execution Duration: 0:00:00.00
create table ZZTSMWZF9SRMQ003 (
CUSTOMER_ID LONG)
Pass9 - Execution Duration: 0:00:00.36
insert into ZZTSMWZF9SRMQ003
select distinct pa11.[CUSTOMER_ID] AS CUSTOMER_ID
from [ZZT3WSP7T8BMD000] pa11,
[LU_CUSTOMER] a12,
[LU_CUST_CITY] a13,
[LU_CUST_STATE] a14,
[ZZT36UF785VMD001] pa15,
[ZZTS6MZ3N2BMD002] pa16
where pa11.[CUSTOMER_ID] = a12.[CUSTOMER_ID] and
a12.[CUST_CITY_ID] = a13.[CUST_CITY_ID] and
a13.[CUST_STATE_ID] = a14.[CUST_STATE_ID] and
a14.[CUST_REGION_ID] = pa15.[CUST_REGION_ID] and
pa15.[CUST_REGION_ID] = pa16.[CUST_REGION_ID]
and (pa11.[WJXBFS1] > (IIF(ISNULL(pa15.[WJXBFS1]), 0,
pa15.[WJXBFS1]) + IIF(ISNULL(pa16.[WJXBFS1]), 0,
pa16.[WJXBFS1])))
Pass10 - Execution Duration: 0:00:00.00
create table ZZTRX7EEWHNNB004 (
DAY_DATE TIMESTAMP,
CUSTOMER_ID LONG,
WJXBFS1 DOUBLE)
Pass11 - Execution Duration: 0:00:07.89
Pass10, Pass11, Pass12, and Pass13 compute the Last Order Sales metric.
Pass 14 displays the results for the report.
All other passes drop the temporary tables.
4 This metric determines the standard deviation of customer spending in each region:
e.StDev of Revenue Per Customer = Stdev(Sum(Revenue)
{~+, Customer+} ) {~+}
5 This metric determines the threshold for the 25th percentile:
25th Percentile of Revenue Per Customer = Percentile
(Sum(Revenue) {~+, Customer+} , 0.25) {~+}
6 This metric determines the threshold for the 75th percentile:
75th Percentile of Revenue Per Customer = Percentile
(Sum(Revenue) {~+, Customer+} , 0.75) {~+}
Create a report and place all of the metrics described above on the row axis and place the
attribute Customer Region on the column axis. Execute the Statistical Descriptors -
Simple report, which is shown below:
This report provides information on the behavior of customer spending in each customer
region. For example, the Northwest customer region has the least number of customers,
but most customers in that region spend more than any other region, as seen in the
larger mean and median revenues per customer. This can highlight that it is worthwhile
to gain a larger customer base in this region. However, the somewhat lower value for the
standard deviation of revenue per customer in the Northwest region also indicates that
this result might be due to the smaller sample size and a few customers that spend
abnormally large amounts. This standard deviation value helps to show that while a
campaign to increase the customer base in the region is still an attractive idea, the results
should be monitored to determine if revenues continue to be higher per customer.
The SQL generated for the Statistical Descriptors - Simple report is as follows:
Pass0 - Execution Duration: 0:00:00.00
create table ZZT42W71C95MD000 (
CUSTOMER_ID LONG,
WJXBFS1 LONG,
WJXBFS2 DOUBLE)
Pass1 - Execution Duration: 0:00:00.06
insert into ZZT42W71C95MD000
select a11.[CUSTOMER_ID] AS CUSTOMER_ID,
count(1.0) AS WJXBFS1,
sum(a11.[TOT_DOLLAR_SALES]) AS WJXBFS2
from [CUSTOMER_SLS] a11
group by a11.[CUSTOMER_ID]
Pass2 - Execution Duration: 0:00:00.09
select distinct pa11.[CUSTOMER_ID] AS CUSTOMER_ID,
a14.[CUST_REGION_ID] AS CUST_REGION_ID,
a15.[CUST_REGION_NAME] AS CUST_REGION_NAME0,
pa11.[WJXBFS1] AS WJXBFS1,
pa11.[WJXBFS2] AS WJXBFS2
from [ZZT42W71C95MD000] pa11,
[LU_CUSTOMER] a12,
[LU_CUST_CITY] a13,
[LU_CUST_STATE] a14,
[LU_CUST_REGION] a15
where pa11.[CUSTOMER_ID] = a12.[CUSTOMER_ID] and
a12.[CUST_CITY_ID] = a13.[CUST_CITY_ID] and
a13.[CUST_STATE_ID] = a14.[CUST_STATE_ID] and
a14.[CUST_REGION_ID] = a15.[CUST_REGION_ID]
Pass3 - Execution Duration: 0:00:00.00
[Analytical SQL calculated by the Analytical Engine:
select CUST_REGION_ID,
CUST_REGION_NAME0,
sum(WJXBFS1),
avg(WJXBFS2),
Median(WJXBFS2),
Stdev(WJXBFS2),
Percentile(WJXBFS2, 0.25),
Percentile(WJXBFS2, 0.75)
from [previous pass]
]
Pass4 - Execution Duration: 0:00:00.00
[Populate Report Data]
Pass5 - Execution Duration: 0:00:00.00
drop table ZZT42W71C95MD000
The first two passes of SQL (Pass0 and Pass1) prepare and calculate the values used
in other metrics.
The Intelligence Server optimizes the process by pulling only a single column of
revenue data even though it is used in several other metrics.
In Pass2 and Pass3 the Intelligence Server retrieves the results from Pass1 to
compute the other metrics. In Pass3 the Intelligence Server acts as an in-memory
database, using the values from Pass2 to calculate the following group-value
functions: Sum, Avg, Median, Stdev, and Percentile.
The remaining passes prepare the report and drop the temporary tables.
Forecasting example
The report and report components in this example can be found in the MicroStrategy
Tutorial project in the following folder:
MicroStrategy Tutorial\Public Objects\Reports\
MicroStrategy Platform Capabilities\Advanced Analytics\
Statistics and Forecasting\Forecasting
of values. For information on these functions, how they forecast values, and forecasting
examples using these functions, see:
ForecastV (forecast, vector input), page 344
GrowthV (growth, vector input), page 348
TrendV (trend, vector input), page 370
To perform the analysis, build a set of metrics that calculate each of the components in
the analysis, then use those metrics together to create the final Forecasting metric.
1 The metric that calculates sales revenue at the Year level is defined as follows:
Revenue {Year} = Sum(Revenue) {~+, Year+}
2 The metric that expresses the Year elements as a series of integers, to simplify the
analysis, is defined as follows:
YearNumber = RunningSum<SortBy= (Year@ID) >(Sum(1) {~+,
Year } )
3 The metric that calculates the slope of the line produced by the Revenue {Year}
metric is defined as follows:
SlopeMetric = Slope([Revenue {Year}], YearNumber) {~+,
!Year+}
4 The metric that calculates the Y-intercept of the line produced by the Revenue {Year}
metric is defined as follows:
InterceptMetric = Intercept([Revenue {Year}],
YearNumber) {~+, !Year+}
5 The final metric combines the three preceding metrics into a forecast value. This
formula follows the standard formula for a line: y = mx + b. The metric is defined
as follows:
Forecast = ((SlopeMetric * YearNumber) +
InterceptMetric)
Place the Forecast metric on a report with Year. A sales forecast is generated for all
available years. The Forecast (Graph) report displays as follows:
The sales for 2008, 2009, and 2010 are actual recorded values, and the sales for 2011 are
a linear extrapolation of the existing data into the future.
Another report in the Forecasting folder, Forecast (Grid) places the Forecast
metric alongside the Revenue metric for comparison. However, it requires the use
of outer joins to work properly. The MicroStrategy Tutorial includes Microsoft
Access as its default database; in order for the Forecast (Grid) report to work, the
Tutorial warehouse must be moved into a database platform that fully supports
outer joins.
RunningSum<SortBy= ([YEAR_ID])>(WJXBFS1)
from [previous pass]
]
Pass5 - Execution Duration: 0:00:00.00
insert into ZZT3M2QSNWDMD001 values (2008, 1, 1)
Pass6 - Execution Duration: 0:00:00.00
create table ZZTDMBESMXPOJ002 (
YEAR_ID SHORT,
CATEGORY_ID SHORT)
Pass7 - Execution Duration: 0:00:00.00
insert into ZZTDMBESMXPOJ002
select pa11.[YEAR_ID] AS YEAR_ID,
pa11.[CATEGORY_ID] AS CATEGORY_ID
from [ZZT16JMSID1MD000] pa11
Pass8 - Execution Duration: 0:00:00.00
insert into ZZTDMBESMXPOJ002
select pa11.[YEAR_ID] AS YEAR_ID,
pa11.[CATEGORY_ID] AS CATEGORY_ID
from [ZZT3M2QSNWDMD001] pa11
Pass9 - Execution Duration: 0:00:00.00
create table ZZT9MCAB4STOD003 (
YEAR_ID SHORT,
CATEGORY_ID SHORT)
Pass10 - Execution Duration: 0:00:00.00
insert into ZZT9MCAB4STOD003
select distinct pa11.[YEAR_ID] AS YEAR_ID,
pa11.[CATEGORY_ID] AS CATEGORY_ID
from [ZZTDMBESMXPOJ002] pa11
Pass11 - Execution Duration: 0:00:00.00
select pa11.[YEAR_ID] AS YEAR_ID,
pa11.[CATEGORY_ID] AS CATEGORY_ID,
pa12.[WJXBFS1] AS WJXBFS1,
pa13.[WJXBFS1] AS WJXBFS2
from [ZZT9MCAB4STOD003] pa11,
[ZZT16JMSID1MD000] pa12,
[ZZT3M2QSNWDMD001] pa13
where pa11.[CATEGORY_ID] = pa12.[CATEGORY_ID] and
pa11.[YEAR_ID] = pa12.[YEAR_ID] and
pa11.[CATEGORY_ID] = pa13.[CATEGORY_ID] and
pa11.[YEAR_ID] = pa13.[YEAR_ID]
Pass12 - Execution Duration: 0:00:00.00
create table ZZTMYCAAR65MD004 (
CATEGORY_ID SHORT,
WJXBFS1 DOUBLE,
WJXBFS2 DOUBLE)
Pass13 - Execution Duration: 0:00:00.00
[Analytical SQL calculated by the Analytical Engine:
select CATEGORY_ID,
Slope(WJXBFS1, WJXBFS2),
Intercept(WJXBFS1, WJXBFS2)
from [previous pass]
]
Pass14 - Execution Duration: 0:00:00.00
insert into ZZTMYCAAR65MD004 values (1,
58938.0812500116, 585341.077083335)
Pass15 - Execution Duration: 0:00:00.04
select pa11.[CATEGORY_ID] AS CATEGORY_ID,
a13.[CATEGORY_DESC] AS CATEGORY_DESC0,
pa11.[YEAR_ID] AS YEAR_ID,
(IIF(ISNULL((pa12.[WJXBFS1] * pa11.[WJXBFS1])), 0,
(pa12.[WJXBFS1] * pa11.[WJXBFS1])) +
IIF(ISNULL(pa12.[WJXBFS2]), 0, pa12.[WJXBFS2])) AS
WJXBFS1
from [ZZT3M2QSNWDMD001] pa11,
[ZZTMYCAAR65MD004] pa12,
[LU_CATEGORY] a13
The report examples in this section use objects and data found in the
MicroStrategy Tutorial.
See Appendix A, MicroStrategy and Database Support for Functions, for a list
of the databases and the functions they support.
Basic functions
These are basic mathematical functions like Avg, Greatest, Least, Max, Min, and so on,
and are among the most commonly used functions.
Add
Returns the sum of two or more values. The Add function differs from the Sum function
(see Sum , page 115), which returns the sum of values in a single value list. Add can take
multiple metrics as inputs and add the values of the metrics.
You can also construct these types of metrics using the plus operator (see Plus (+), page
242) instead of the Add function.
Syntax
Add(Argument1, Argument2,..., ArgumentN)
Where
The arguments must be metrics or constants.
Example
You can use the Add function to return the sum of related metrics. In the report shown
below, the Total Paid Compensation metric uses the formula Add([Paid Bonus],
[Paid Salary]) to return the total compensation paid to each employee. This report
was created in the MicroStrategy Human Resources Analysis Module.
Average
Average performs a sum of a set of values and divides this total by the number of values
in the set. This returns the average (also known as arithmetic mean) for the set of values.
The Average function differs from the Avg function (see Avg (average), page 95),
which returns the average of values in a single value list. The Average function can take
multiple metrics as inputs and average the values of the metrics. You can use this
function to compute and display the average of two or more metrics on a report.
Syntax
Average(Argument1, Argument2,..., ArgumentN)
Where:
The arguments must be metrics or constants.
Avg (average)
Avg calculates the sum of a single value list and divides the result by the number of
values in the list. This returns the average (arithmetic mean) of the listed values.
Avg is often used to create subtotals and metrics based on fact data. This is a group-value
function.
To calculate an average while applying a weight to the values, see WeightedMean, page
201.
Syntax
Avg<Distinct, FactID, UseLookupForAttributes>(Argument)
Where:
Argument is an attribute, fact, or metric representing a list of numbers.
Distinct is a TRUE/FALSE parameter that allows you to use all values in the
calculation or to calculate using only the unique values.
FactID is a parameter that forces a calculation to take place on a fact table that
contains the selected fact.
UseLookupForAttributes is a TRUE/FALSE parameter that can be used when
performing an aggregation of an attribute. The Count function is most commonly
used to aggregate attributes. For information on this parameter, including an
example of using it with the Count function, see Count , page 97.
Usage notes
The Avg function ignores NULL values but uses zero values in its calculation.
Example
Example 1: In this simple example the average of a value list containing the values
(4,9,2,9) is calculated as follows:
(4+9+2+9)/4 = 6
Example 2: This report obtains the average salary for employees in each region. The
report contains the attributes Region, Employee, and Salary as well as the metric Average
Salary. A report filter limits the regions displayed to Northeast and Southeast. The metric
Average Salary is defined as follows: Avg(Salary){Region}
The function sums all salaries within a region and divides by the number of values,
resulting in the regional average salary.
For further examples of using the Avg function, see Example 1: Transformed fact, page
23 and Example 2: Compound metric, page 24, as well as Example 1: Average, page 24.
Condition
Condition is a shortcut function, available for various features in MicroStrategy Web,
that allows you to easily define the condition (filtering) of the final metric expression. A
conditional metric allows you to apply a filter to only one metric on a report without
affecting the other metrics. The metric filter can be either a filter or a prompt that
returns a list of filters to choose from. Only one filter or prompt can be associated with
each metric, but the metric filter can contain multiple qualifications. For additional
information on when to create conditional metrics, see the Advanced Reporting Guide.
Once you select the Condition shortcut function, you can then select the group
function for the calculation, such as Sum or Max. Additionally, the options to add or
remove a condition are displayed:
To add a condition to the metric, click the Browse icon ( ) to select a filter or a
prompt that returns a list of filters.
To remove the condition from a metric, click the Delete icon ( ).
You can also define how the condition is evaluated by clicking Condition advanced
options:
By default, the parts of the report filter that are based on parent or child attributes of
the attribute in the metric condition are ignored, and do not affect the calculation of
the conditional metric. To apply all criteria in the report filter to the conditional
metric, clear the Ignore related report filter elements check box. This option
is selected by default.
By default, the report filter is applied to the metric data and then the metric filter is
applied to those results. You can determine the order in which the report filter and
metric filter are applied to the metric. From the Interaction between metric
filter and report filter drop-down list, select one of the following:
To apply the report filter criteria first, then apply the metric filter to the results,
select Merge report filter into metric (default). For example, the metric
filter is revenue greater than $100 and the report filter is bottom 10 items for
sales. In this example, the report filter narrows the result set to only 10 items,
and then the metric condition filters out, from those 10 items, any items with a
revenue above $100.
To evaluate the metric filter first, then apply the report filter to the results, select
Merge metric condition into report. Using this option with the example
above, the metric condition returns all items with a revenue above $100. The
report filter then filters out all but the bottom 10 of those items, based on sales.
To combine the metric filter and the report filter, select Merge into new. Only
those results that meet both the metric filter and the report filter are included in
the metric. Using this option with the example above, the two filters are merged,
so that only those items that are in the bottom 10 in terms of sales and that have
sales greater than $100 are included.
Count
Count returns the number of elements in a list of values. This is a group-value function.
Syntax
Count<Distinct, FactID, UseLookupForAttributes, Null> (Argument)
Where:
Argument is an attribute, fact, or metric representing a list of values.
Distinct is a TRUE/FALSE parameter that allows you to count all elements in a list
or only the unique elements.
FactID is a parameter that forces a calculation to take place on a fact table that
contains the selected fact.
UseLookupForAttributes is a TRUE/FALSE parameter that can be used when
performing an aggregation of an attribute:
If you set this parameter to TRUE, the aggregation is done for the unique set of
attribute elements, excluding any duplicates caused by additional attributes on
the report.
If you set this parameter to FALSE, the aggregation is done for all elements of an
attribute, including duplicate elements that can be included by displaying
additional attributes on a report.
For an example of how to use this parameter, see Performing counts of attributes,
page 98.
Example
This example creates a report that calculates the count of employees in each region. The
report contains the attributes Region and Employee, and the metric # of Employees. A
report filter limits the regions displayed to Central, South, Southeast, and Southwest. The
metric # of Employees is defined as follows: Count(Employee){Region, ~}.
The function counts each entry within a region and returns the last number in the
count.
This report also uses two derived metrics to display the following count information:
Number of Customers: This derived metric displays the count of customers. The
expression used to define the derived metric is
Count<UseLookupForAttributes=True>(Customer){}. By defining the
parameter UseLookupForAttributes=True, the Count function ignores any
multiple listings of each Customer attribute element. In the report shown above,
each separate item is ignored and only the unique attribute elements for Customer
are counted.
Number of Customer Purchases: This derived metric displays the count of
customer purchases. The expression used to define the derived metric is
Count<UseLookupForAttributes=False>(Customer){}. By defining the
parameter UseLookupForAttributes=False, the Count function counts each
listing of the Customer attribute element. In the report shown above, each separate
item is counted, which provides a count of customer purchases.
For information on creating derived metrics, along with other OLAP Services features,
see the In-memory Analytics Guide.
First
Returns the result of an aggregate applied over a set of rows that ranks as the first within
a specified order. This is a group-value function that shares the sort by capability of the
OLAP functions.
Syntax
First<FactID, SortBy>(Argument)
Where:
Argument is an attribute, fact, or metric representing a list of values.
FactID is a parameter that forces a calculation to take place on a fact table that
contains the selected fact.
SortBy is a parameter that allows you to define the attribute or metric on which to
sort the data.
Example
The First function is often used to define subtotals. In this example, the First function
defines the subtotal for the metric units received, returning the units received for the
first quarter containing a value in 2003. The expression defines the subtotal as follows:
First<SortBy= (Day, Month, Quarter, Year) >([Units
Received]){@}
Argument is the metric to which the subtotal is applied.
For detailed instructions on creating and applying user-defined subtotals, see the
MicroStrategy Advanced Reporting Guide.
Usage notes
This function returns an error if a value in the value list is negative.
Example
Suppose you have an investment that earns 10% the first year, 60% the second year, and
20% the third year, and you want to answer the question What is its average rate of
return? You do not want to use the Avg function to obtain the arithmetic mean, because
these numbers show that in the first year your investment was multiplied by 1.10, in the
second year by 1.60, and in the third year by 1.20. The average is the geometric mean of
these three numbers. This can be understood as looking for a constant that you can
multiply each years investment by, and get the same result as multiplying the first year
by 1.10, the second year by 1.60, and so forth. This constant is the geometric mean.
(1.10 * 1.60 * 1.20)1/3 = 1.283
The geometric mean is 1.283, so the average rate of return is about 28%.
Greatest
Returns the larger of two or more values. The Greatest function differs from the Max
function, which returns the largest value in a single value list. Greatest can take
multiple lists as input and compare the elements in the lists. It is used for comparisons
between metrics.
Syntax
Greatest(Argument1, Argument2,..., ArgumentN)
Where:
The arguments must be metrics.
Example
This simple example illustrates how data is returned by the Greatest function.
Given two value lists, the function compares the values in each position in the list and
returns a list containing the highest numbers from each position.
21 50 50
18 3 18
42 22 42
30 6 30
7 20 20
Histogram Median
Histogram Median is a distributive implementation to calculate approximation of median
over large datasets.
Formula
Where:
Lm is the lower limit of the median bar.
n is the total number of observations in the set
Fm-1 is the total number of observations in all bars below the median bar.
fm is the frequency of the median bar
c is the median bar width.
Syntax
HistogramMedian([ValueList], NumberOfHistograms)
Where:
ValueList is an attribute, fact, or metric representing a list of values.
NumberOfHistograms is an integer representing the number of histograms in the set to
be analyzed.
Example
This example shows a report to find the median Revenue per Customer for each Income
Bracket in the Central Region.
HistogramMedia([Max Revenue per Customer], [Max Revenue per Customer]) {~ ,
Region}
Last
The Last function returns the last value in a sorted set of values. It is often used to
define subtotals, as shown in the example below. This is a group-value function.
Syntax
Last<FactID, SortBy>(Argument)
Where:
Argument is an attribute, fact, or metric representing a list of values.
FactID is a parameter that forces a calculation to take place on a fact table that
contains the selected fact.
SortBy is a parameter that allows you to define the attribute or metric on which to
sort the data.
Example
In this example, Last is used in the subtotal for the metric End on Hand, returning the
total items on hand in the last quarter of 2003. The subtotal expression is defined as
follows:
Last<SortBy= (Day, Month, Quarter, Year) >(End on Hand)
{@ }
For detailed instructions on creating and applying user-defined subtotals, see the
MicroStrategy Advanced Reporting Guide.
Least
This function returns the smaller of two or more values. The Least function differs
from the Min function, which returns the smallest value in a single value list. Least can
take multiple lists as input and compare the elements of the lists. It is used for
comparisons between metrics. This is a single-value function.
Syntax
Least(Argument1, Argument2,..., ArgumentN)
Where:
The arguments must be metrics.
Example
This simple example illustrates how data is returned by the Least function.
Given two values lists, the function compares the values at each position in the lists and
returns a list of the lowest values from each position.
21 50 21
18 3 3
42 22 22
30 6 6
7 20 7
Level
Level is a shortcut function, available for various features in MicroStrategy Web, that
allows you to easily define the level (dimensionality) of the final metric expression. The
level of a metric determines the conceptual level at which a calculation is performed. For
example, rather than just calculating your revenue, you want to specify that a metric
always calculates yearly revenue. For additional information on when to create level
metrics, see the Advanced Reporting Guide.
Once you select the Level shortcut function, you can then select the group function for
the calculation, such as Sum or Max. Additionally, the options to add and remove levels
are displayed:
Report Level is the default level. If you remove Report Level as a level of the metric,
you can add it back by typing Report Level in the level text field.
To add a level to the metric, click the Browse icon ( ) to select an attribute.
To remove a level from a metric, click the Delete icon ( ).
You can also define how levels are evaluated:
To define the level options, for each level, click the Level options icon ( ).
From the Relationship To include only data that meets the conditions in the report filter in the
with Report Filter metric calculation, select Standard filtering.
drop-down list, you can
define how the report
To define the advanced level options, such as whether to apply the metric filter to
the metric calculation, click Level advanced options:
Allow other users to add extra units to this definition: This option is
used to emulate MicroStrategy 6.x behavior and affects only those projects that
have been upgraded from 6.x. Clear the check box only if your project was
upgraded from MicroStrategy 6.x. This option is selected by default.
Max (maximum)
Max returns the largest value in a list of values. For example, it can be used on a list of
prices to determine the maximum cost of an item. This is a group-value function.
To compare the highest values in multiple lists of values, use the Greatest
function.
Syntax
Max <FactID, UseLookupForAttributes>(Argument)
Where:
Argument is an attribute, fact or metric representing a list of numbers.
FactID is a parameter that forces a calculation to take place on a fact table that
contains the selected fact.
UseLookupForAttributes is a TRUE/FALSE parameter that can be used when
performing an aggregation of an attribute. The Count function is most commonly
used to aggregate attributes. For information on this parameter, including an
example of using it with the Count function, see Count , page 97.
Example
This example shows a report displaying the cost range of items within a subcategory. The
Max function is used to determine the highest cost of an item within a subcategory. The
metric, Maximum Unit Cost, is defined as follows:
Maximum([Unit Cost]) {~}
The metric is placed on a report with the attributes Category and Subcategory and the
metric Minimum Unit Cost. The resulting report appears as follows:
Median
Median returns the value in the middle of a set of listed values. The result will be greater
than half the values in the list and less than the other half. The median can be used as an
alternative to the arithmetic mean when handling values that are not evenly distributed
or contain outliers. This is a group-value function.
Syntax
Median <FactID>(Argument}
Where:
Argument is an attribute, fact or metric representing a list of numbers.
FactID is a parameter that forces a calculation to take place on a fact table that
contains the selected fact.
Usage notes
This function provides a location measure: the value returned has a relative position with
regard to other values in the list. Mode is another function that provides a location
measure.
Example
This example shows a report built to obtain the median age of employees within each
region. The report includes the attributes Region, Employee, and Employee Age, and the
metric Median Age. A report filter limits the regions displayed to Mid Atlantic,
Northeast, and Southeast. The metric Median Age is defined as follows:
Median([Employee Age){Region,~}
The function evaluates the list of employee ages within a region and selects a value in the
middle of the value list.
For another example of using the Median function, see Example 2: Median, page 24.
Min (minimum)
Min returns the lowest value in a list of values. For example, it can be used on a list of
prices to determine the minimum cost of an item. This is a group-value function.
To compare the lowest values in multiple lists of values, use the Least function.
Syntax
Min <FactID, UseLookupForAttributes>(Argument)
Where:
Argument is an attribute, fact, or metric representing a list of numbers.
FactID is a parameter that forces a calculation to take place on a fact table that
contains the selected fact.
UseLookupForAttributes is a TRUE/FALSE parameter that can be used when
performing an aggregation of an attribute. The Count function is most commonly
used to aggregate attributes. For information on this parameter, including an
example of using it with the Count function, see Count , page 97.
Example
This example shows a report displaying the cost range of items within a subcategory. The
Min function is used to determine the lowest cost of an item within a subcategory. The
metric Minimum Unit Cost is defined as follows:
Minimum([Unit Cost]) {~}
The metric is placed on a report with the attributes Category and Subcategory and the
metric Maximum Unit Cost.
Mode
Returns the most frequently occurring value in a given list. This is a group-value
function.
Syntax
Mode <FactID, IsRemovable>(Argument)
Where:
FactID is a parameter that forces a calculation to take place on a fact table that
contains the selected fact.
The formula listed above uses the Unit Cost fact rather than the Unit Cost metric.
Multiply
Multiply returns the product of two or more values. This function differs from the
Product function (see Product, page 111), which returns the product of values in a
single value list. The Multiply function can take multiple metrics as inputs and
multiply the values of the metrics.
You can also construct these types of metrics using the times operator (see Times (*),
page 242) rather than the Multiply function.
Syntax
Multiply(Argument1, Argument2,..., ArgumentN)
Where:
The arguments must be metrics or constants.
Example
In the report shown below, the Unit Profit metric uses the formula Multiply([Unit
Price],[Units Sold]) to return the revenue for each item. This report was created
in the MicroStrategy Tutorial project.
Product
Multiplies all values in a list. This is a group-value function.
Syntax
Product<FactID>(Argument)
Where
Argument is an attribute, fact, or metric representing a list of numbers.
FactID is a parameter that forces a calculation to take place on a fact table that
contains the selected fact.
Example
Given a value list containing the values (1,2,3,4), the product calculates as 1*2*3*4 = 24.
Usage notes
For this function, arguments correspond to an entire population as opposed to a
population sample. For population samples, see StDev (standard deviation of a
sample), page 113.
When very large population samples are used, this function and the StDev (standard
deviation of a sample), page 113 function return approximately equal results.
Example
This example shows a report where the standard deviation of the revenue is calculated.
This calculation is based on the assumption that the list of values supplied in the metric
represents the entire population of the data for which you want to obtain the standard
deviation. The calculation is based on the revenue values for each state within a region
and calculated at the region level.
Compare this example report to the example for StDev to see the different values
returned when calculating for a population as opposed to a sample.
The report contains the attributes Customer Region and Customer State, and the metrics
Total Revenue and StDevP. A report filter limits the regions displayed to South,
Northwest, and Southwest. The definition of the StDevP metric is as follows:
Usage notes
In this function, arguments correspond to a population sample as opposed to the
entire population. For entire populations, see StDevP (standard deviation of a
population), page 112.
To perform a weighted standard deviation, see WeightedStDev (weighted standard
deviation of a sample), page 202.
When very large population samples are used, this function and the StDevP
(standard deviation of a population), page 112 function return approximately equal
results.
Example
This example shows a report where the standard deviation of the revenue is calculated.
This calculation is based on the assumption that the list of values supplied in the metric
represents a sample of the data for which you want to obtain the standard deviation. The
calculation is based on the revenue values for each state within a region and calculated at
the region level.
Compare this example report to the example for StDevP to see the different values
returned when calculating for a population as opposed to a sample.
The report contains the attributes Customer Region and Customer State, and the metrics
Total Revenue and StDev. A report filter limits the regions displayed to South,
Northwest, and Southwest. The definition of the StDev metric is as follows:
StDev([Total Revenue]){[Customer Region], ~}
Sum
Returns the sum of all numbers in a list of values. This function is commonly used in
metrics and subtotals. Sum is a group-value function.
Syntax
Sum <Distinct, FactID, UseLookupForAttributes>(Argument)
Where:
Argument is an attribute, fact, or metric representing a list of numbers.
Distinct is a TRUE/FALSE parameter that allows you to calculate using all values
in the list or only the unique values.
FactID is a parameter that forces a calculation to take place on a fact table that
contains the selected fact.
UseLookupForAttributes is a TRUE/FALSE parameter that can be used when
performing an aggregation of an attribute. The Count function is most commonly
used to aggregate attributes. For information on this parameter, including an
example of using it with the Count function, see Count , page 97.
Example
In this example, the metric Regional Revenue is defined as follows:
Sum(Revenue) {[Customer Region], ~}
This simple report uses the attributes Customer Region and Customer State, and the
metrics Revenue and Regional Revenue to generate a report showing the sum of the
revenue for several regions. A report filter limits the regions displayed to Northeast,
Northwest, and Southeast.
Transformation
Transformation is a shortcut function, available for various features in MicroStrategy
Web, that allows you to easily define transformations for the final metric expression.
Transformations allow you to apply an attribute-element based offset to compare metric
data. For example, a transformation metric can help a user compare last month's
revenue to this month's revenue. Although transformations can be applied to any
attribute hierarchy, the Time hierarchy is used most often. For the Time hierarchy, the
offset can be set as a fixed number of days, weeks, months, or years. For additional
information on when to create transformation metrics, see the Advanced Reporting
Guide.
Once you select the Transformation shortcut function, you can then select the group
function for the calculation, such as Sum or Max. Additionally, the options to add or
remove a transformation are displayed:
To add a transformation to the metric, click the Browse icon ( ) to select a
transformation.
To remove a transformation from a metric, click the Delete icon ( ).
Usage notes
For this function, arguments relate to an entire population as opposed to a population
sample.
Example
Variance is calculated as the average squared deviation of each number from its mean.
This example creates a report in which the variance of the units sold in the subcategories
within a category is calculated with the assumption that the data provided represents the
entire population.
Compare this example report to the example for variance of a sample to see the
different values returned when calculating for a population as opposed to a sample.
The report includes the attributes Category and Subcategory, and the metrics Units Sold
and VarP by Category. A report filter limits the categories displayed to Books and Movies.
The VarP by Category metric is defined as follows:
VarP([Units Sold]) {Category, ~}
Usage notes
Assume when using this function that arguments constitute a population sample, as
opposed to a entire population.
Example
This example creates a report in which the variance of the units sold in the subcategories
within a category is calculated, with the assumption that the data provided is a sample.
Compare this example report to the example for variance of a population to see the
different values returned when calculating for a population as opposed to a sample.
The report includes the attributes Category and Subcategory, and the metrics Units Sold
and Var by Category. A report filter limits the categories displayed to Books and Movies.
The Var by Category metric is defined as follows:
Var([Units Sold]) {Category, ~}
The results returned by the date/time functions may differ depending on the way
your database stores and interprets dates, for example, whether Monday is
considered the first or second day of the week.
AddDays
AddDays is used to calculate dates that occur N days before or after a given date. It
returns this information in the form of a date or timestamp.
Syntax
AddDays(Date/Time,Offset)
Where:
Date/Time is the input date or timestamp.
Offset is an integer number of days to add.
For information on whether your database supports various date and time functions, see
the Appendix A, MicroStrategy and Database Support for Functions.
Example
AddDays('2004-07-29', 4) = 2004-08-02
AddMonths
AddMonths is used to calculate dates that occur N months before or after a given date. It
returns this information in the form of a date or timestamp.
If the new date does not occur in the new month, the last date of the new month is
returned.
Syntax
AddMonths(Date/Time,Offset)
Where:
Date/Time is the input date or timestamp.
Offset is an integer number of months to add.
For information on whether your database supports various date and time functions, see
Appendix A, MicroStrategy and Database Support for Functions.
Example
AddMonths('2004-07-29', 3) = 2004-10-29
AddMonths('2004-07-29 10:00:00', 3) = 2004-10-29 10:00:00
AddMonths('2003-03-31', -1) = 2003-02-28
CurrentDate
Returns the current date as provided by the database timer.
Syntax
CurrentDate()
For information on whether your database supports various date and time functions, see
Appendix A, MicroStrategy and Database Support for Functions.
CurrentDateTime
Returns the current date and time as provided by the database timer.
Syntax
CurrentDateTime()
For information on whether your database supports various date and time functions, see
Appendix A, MicroStrategy and Database Support for Functions.
CurrentTime
Returns the current time as provided by the database timer.
Syntax
CurrentTime()
For information on whether your database supports various date and time functions, see
Appendix A, MicroStrategy and Database Support for Functions.
Date
Returns only the date portion of the date-time column. The time is truncated, not
rounded.
Syntax
Date(Date/Time)
Where:
Date/Time is the input date or timestamp.
For information on whether your database supports various date and time functions, see
Appendix A, MicroStrategy and Database Support for Functions.
Example
Input is the date 2004-07-29; output is the date 2004-07-29.
Input is the date-time 2004-07-29 02:00:00; output is the date 2004-07-29.
DateDiff
DateDiff is used to calculate the length of time between two dates. A numeric value is
returned.
Syntax
DateDiff<firstWeekDay>(Date1, Date2, Unit)
Where:
Date1 and Date2 are the inputs used for date or timestamp values. You can use
metrics, constants, attribute forms, or functions that result in a date or timestamp.
For example, you can include CurrentDate() as an input to compare historical dates
from an attribute form to the current date.
Unit is the unit of time that is to be measured. You can return the length of time in
one of the following units:
Seconds s
Minutes mn
Hours h
Days d
Weeks w
Months m
Quarters q
Years y
When using the DateDiff function in MicroStrategy Web, you will need to replace
the Day@ID attribute in the function definition. Create the metric [MAX
(Day@ID)] and define the function as follows: DateDiff([MAX(Day@ID)],
CurrentDate(), d)
DayofMonth
Returns a number corresponding to the day of the month of the date provided. The value
returned is an integer between 1 and 31.
Syntax
DayofMonth(Argument)
Where:
Argument is a metric representing a list of dates.
For information on whether your database supports various date and time functions, see
Appendix A, MicroStrategy and Database Support for Functions.
Example
Input is the date 7/11/2002; output is the integer 11.
Input is the date 2003/10/10; output is the integer 10.
DayofWeek
Returns the number of the day in the week corresponding to the input date. The return
value is an integer between 1 and 7. The value of 1 represents Sunday and the value of 7
represents Saturday.
Syntax
DayofWeek(Argument)
Where:
Argument is a metric representing a list of dates.
For information on whether your database supports various date and time functions, see
Appendix A, MicroStrategy and Database Support for Functions.
Example
Input is the date 5/16/2003; output is the integer 6, which represents Friday.
Input is the date 2003/9/9; output is the integer 3, which represents Tuesday.
DayofYear
Returns the number of the day in the year of the input date. The return value is an
integer between 1 and 365.
Syntax
DayofYear(Argument)
Where:
Argument is a metric representing a list of dates.
For information on whether your database supports various date and time functions, see
Appendix A, MicroStrategy and Database Support for Functions.
Example
Input is the date 1/16/2003; output is the integer 16.
Input is the date 2/17/2003; output is the integer 48.
DaysBetween
Returns the difference in days between two given dates as an integer value. The
calculation of the difference is based on the number of day boundaries crossed, not the
number of twenty-four hours periods elapsed. If the first date argument is later than the
second date argument, the result is a negative number. The result does not display the
time stamps, as they are truncated before performing the calculation.
Syntax
DaysBetween(Date/Time1, Date/Time2)
Where:
Date/Time1 is the start date.
Date/Time2 is the end date.
For information on whether your database supports various date and time functions, see
Appendix A, MicroStrategy and Database Support for Functions.
Examples
Inputs are the dates 2004-07-29 and 2004-07-25; output is the integer -4.
Inputs are the dates 2004-07-29 02:00:00 and 2004-07-31 01:00:00; output is
the integer 2.
FiscalMonth
Returns the numeric position of a month within a fiscal year, for a given input date. This
function is useful in financial reporting when the start of the fiscal year is different than
the start of the calendar year.
Syntax
FiscalMonth<firstMonth>(Date/Time)
Where:
Date/Time is the input date or timestamp.
firstMonth (default value is 1) is a parameter that determines which month is
considered as the start of the fiscal year. You can type an integer value from 1 to 12,
with 1 representing January, 2 representing February, and so on until 12
representing December.
For information on whether your database supports various date and time functions, see
Appendix A, MicroStrategy and Database Support for Functions.
Example
Consider a report or dashboard that includes a Day attribute with a single ID form. You
can create a metric with the following definition:
FiscalMonth<firstMonth=4>(Day)
For each element of the Day attribute, the metric displays the numeric position of the
month within the fiscal year for that date. For this example, since the fiscal year starts in
April, a date of July 4, 2014 would return 4. This is because July is the fourth month in
the fiscal year.
FiscalQuarter
Returns the numeric position of a quarter within a fiscal year, for a given input date. This
function is useful in financial reporting when the start of the fiscal year is different than
the start of the calendar year.
Syntax
FiscalQuarter<firstMonth>(Date/Time)
Where:
Date/Time is the input date or timestamp.
firstMonth (default value is 1) is a parameter that determines which month is
considered as the start of the fiscal year. You can type an integer value from 1 to 12,
with 1 representing January, 2 representing February, and so on until 12
representing December.
For information on whether your database supports various date and time functions, see
Appendix A, MicroStrategy and Database Support for Functions.
Example
Consider a report or dashboard that includes a Day attribute with a single ID form. You
can create a metric with the following definition:
FiscalQuarter<firstMonth=7>(Day)
For each element of the Day attribute, the metric displays the numeric position of the
quarter within the fiscal year for that date. For this example, since the fiscal year starts in
July, a date of October 13, 2014 would return 2. This is because October is in the second
quarter of the fiscal year.
FiscalWeek
Returns the numeric position of a week within a fiscal year, for a given input date. This
function is useful in financial reporting when the start of the fiscal year is different than
the start of the calendar year.
Syntax
FiscalWeek<firstWeekDay, firstMonth>(Date/Time)
Where:
Date/Time is the input date or timestamp.
firstWeekDay (default value is 1) is a parameter that determines which
day of the week is considered as the first day of the week. You can type an
FiscalYear
Returns the fiscal year of the input date. This function is useful in financial reporting
when the start of the fiscal year is different than the start of the calendar year.
When determining the fiscal year, the year returned is the year in which the fiscal year
ends. For example, if a fiscal year runs from March 1, 2014 through April 30, 2015, the
fiscal year is 2015.
Syntax
FiscalYear<firstMonth>(Date/Time)
Where:
Date/Time is the input date or timestamp.
firstMonth (default value is 1) is a parameter that determines which month is
considered as the start of the fiscal year. You can type an integer value from 1 to 12,
with 1 representing January, 2 representing February, and so on until 12
representing December.
For information on whether your database supports various date and time functions, see
Appendix A, MicroStrategy and Database Support for Functions.
Example
Consider a report or dashboard that includes a Day attribute with a single ID form. You
can create a metric with the following definition:
FiscalYear<firstMonth=2>(Day)
For each element of the Day attribute, the metric displays the fiscal year for that date. A
date of July 4, 2013 would have a fiscal year of 2014.
Hour
Returns the integer value for the hour of the input time. The return value is an integer
between 0 and 23.
Syntax
Hour(Argument)
Where:
Argument is a metric representing a list of dates and times.
For information on whether your database supports various date and time functions, see
Appendix A, MicroStrategy and Database Support for Functions.
Example
Input is the time 9:45 am; output is the integer 9.
Input is the time 11:10 pm; output is the integer 23.
Millisecond
Returns the integer value for the millisecond of the input time.
Syntax
Millisecond(Argument)
Where:
Argument is a metric representing a list of dates and times.
For information on whether your database supports various date and time functions, see
Appendix A, MicroStrategy and Database Support for Functions.
Minute
Returns the integer value for the minute of the input time. The return value is an integer
between 0 and 59.
Syntax
Minute(Argument)
Where:
Argument is a metric representing a list of dates and times.
For information on whether your database supports various date and time functions, see
Appendix A, MicroStrategy and Database Support for Functions.
Example
Month
Returns the number of the month in the year of the input date. The return value is an
integer between 1 and 12.
Syntax
Month(Argument)
Where:
Argument is a metric representing a list of dates.
For information on whether your database supports various date and time functions, see
Appendix A, MicroStrategy and Database Support for Functions.
Example
Input is the date 5/16/2003; output is the integer 5.
Input is the date 2003/9/3; output is the integer 9.
MonthEndDate
Returns the date of the last day of the month in which a date or timestamp occurs.
Syntax
MonthEndDate(Date/Time)
Where:
Date/Time is the input date or timestamp.
For information on whether your database supports various date and time functions,see
Appendix A, MicroStrategy and Database Support for Functions.
Example
Input is the date 2004-07-29; output is the date 2004-07-31.
MonthStartDate
Returns the date of the first day of the month in which a date or timestamp occurs.
Syntax
MonthStartDate(Date/Time)
Where:
Date/Time is the input date or timestamp.
For information on whether your database supports various date and time functions, see
Appendix A, MicroStrategy and Database Support for Functions.
Example
Input is the date 2004-07-29; output is the date 2004-07-01.
MonthsBetween
Returns the difference in months between two dates as an integer value. The difference
is calculated by the number of months elapsed and not by the number of month
boundaries crossed. If the first date argument is later than the second date argument, the
result is a negative number. The result does not display the timestamps, as they are
truncated before performing the calculation.
Syntax
MonthsBetween(Date/Time1, Date/Time2)
Where:
Date/Time1 is the start date.
Date/Time2 is the end date.
For information on whether your database supports various date and time functions, see
Appendix A, MicroStrategy and Database Support for Functions.
Example
Inputs are the dates 2004-07-29 and 2004-02-28; output is the integer -5.
Inputs are the dates 2004-07-29 and 2004-09-29; output is the integer 2.
Quarter
Returns the number of the quarter in the year of the input date. The return value is an
integer between 1 and 4.
Syntax
Quarter(Argument)
Where:
Argument is a metric representing a list of dates.
For information on whether your database supports various date and time functions, see
Appendix A, MicroStrategy and Database Support for Functions.
Example
Input is the date 5/16/2003; output is the integer 2.
Input is the date 2003/9/3; output is the integer 3.
QuarterStartDate
Returns the date of the first day of the quarter in which a date or timestamp occurs.
Syntax
QuarterStartDate<firstMonth>(Date/Time)
Where:
Date/Time is the input date or timestamp.
firstMonth (default value is 1) is a parameter that determines which months are
considered as the first months of each quarter. You can type an integer value from 1
to 12, with 1 representing January, 2 representing February, and so on until 12
representing December. Defining one month automatically defines the first month
for the other quarters as well. For example, if you specify January as the first month,
April, July, and October are also considered as the first month of quarters.
For information on whether your database supports various date and time functions, see
Appendix A, MicroStrategy and Database Support for Functions.
Example
Consider a report or dashboard that includes a Day attribute with a single ID form. You
can create an attribute form with the following definition:
QuarterStartDate<firstMonth=1>(Day)
For each element of the Day attribute, the new attribute form displays the start date of
the quarter.
Second
Returns the integer value for the second of the input time. The return value is an integer
between 0 and 59.
Syntax
Second(Argument)
Where:
Argument is a metric representing a list of dates and times.
For information on whether your database supports various date and time functions, see
Appendix A, MicroStrategy and Database Support for Functions.
Example
Input is the time 9:45:13 am; output is the integer 13.
Input is the time 11:10:47 pm; output is the integer 47.
Week
Returns the number of the week in the year of the input date. The return value is an
integer between 1 and 54.
Syntax
Week(Argument)
Where:
Argument is a metric representing a list of dates.
For information on whether your database supports various date and time functions, see
Appendix A, MicroStrategy and Database Support for Functions.
Example
Input is the date 5/16/2003; output is the integer 20.
Input is the date 2003/9/9; output is the integer 37.
WeekStartDate
Returns the date of the first day of the week in which a date or timestamp occurs.
Syntax
WeekStartDate<firstDay>(Date/Time)
Where:
Date/Time is the input date or timestamp.
firstDay (default value is 1) is a parameter that determines which day of the week
is considered as the first day of the week. You can type an integer value from 1 to 7,
with 1 representing Sunday, 2 representing Monday, and so on until 7 representing
Saturday.
For information on whether your database supports various date and time functions, see
Appendix A, MicroStrategy and Database Support for Functions.
Example
Consider a report or dashboard that includes a Day attribute with a single ID form. You
can create an attribute form with the following definition:
WeekStartDate<firstDay=1>(Day)
For each element of the Day attribute, the new attribute form displays the start date of
the week.
Year
Returns the year of the input date. The return value is an integer between 1900 and
9999.
Syntax
Year(Argument)
Where:
Argument is a metric representing a list of dates.
For information on whether your database supports various date and time functions, see
Appendix A, MicroStrategy and Database Support for Functions.
Example
Input is the date 5/16/2003; output is the integer 2003.
Input is the date 2002/9/9; output is the integer 2002.
YearEndDate
Returns the date of the last day of the year in which a date or timestamp occurs.
Syntax
YearEndDate(Date/Time)
Where:
Date/Time is the input date or timestamp.
For information on whether your database supports various date and time functions, see
Appendix A, MicroStrategy and Database Support for Functions.
Example
Input is the date 2004-07-29; output is the date 2004-12-31.
YearStartDate
Returns the date of the first day of the year in which a date or timestamp occurs.
Syntax
YearStartDate(Date/Time)
Where:
Date/Time is the input date or timestamp.
For information on whether your database supports various date and time functions, see
Appendix A, MicroStrategy and Database Support for Functions.
Examples
Input is the date 2004-07-29; output is the date 2004-01-01.
Internal functions
The following are internal function types:
MicroStrategy Apply, or Pass-through, functions provide access to
functionality that is not standard in MicroStrategy but is available in many Relational
Database Management Systems (RDBMS). These MicroStrategy functions act as
containers for non-standard SQL expressions passed to your warehouse database.
The MicroStrategy Apply functions are listed below:
ApplyAgg defines simple metrics or facts using group-value aggregation
functions.
ApplyLogicdefines custom filters using comparison operators.
ApplyLogic defines custom filters using logical operators.
ApplyOLAP defines compound functions using database-specific OLAP functions
such as Rank and RunningSlope.
ApplySimple uses simple operators and functions like +, -, and * to perform
single-value operations at the database level.
Banding functions are used to differentiate displayed data on a report. You can
divide data into bands in the following ways:
Banding distributes the values into bands of equal size.
BandingC (banding count) distributes values into a specified number of bands.
BandingP (banding points) distributes values into bands based on specific
intervals of values.
Case functions return specified data based on the evaluation of user-defined
conditions.
Case evaluates multiple expressions until a condition is determined to be true,
then returns a corresponding value.
CaseV (case vector) evaluates a single metric and returns different values
according to the results.
Coalesce returns the value of the first non-null argument.
To use # as a character rather than a placeholder, use four # characters in a row. See
the syntax below for an example.
ApplyComparison(UPPER(#0) like
Z####%, Country@DESC)
The SQL for the function is:
Select a.11[COUNTRY_ID] AS COUNTRY_ID
from [LU_COUNTRY] a11
where upper(a11.[COUNTRY_NAME])
like Z#%
Do not use form groups for the attribute form expression when using Apply
functions, because form groups are ignored by the Analytical Engine. Instead, use a
single form. For example, instead of using Customer@Name, where Name is defined
to contain Customers first name, middle name, and last name, use ID or any other
single form.
For more general information on Apply functions as well as an example, see Apply (Pass-
through) functions, page 27.
ApplyAgg
The ApplyAgg function is used to define simple metrics or facts by using database-
specific, group-value functions. The ApplyAgg function itself is a group-value function
and accepts facts, attributes, and metrics as input.
Depending on your MicroStrategy product and licensing, this function may not be
available.
Syntax
ApplyAgg()
Accepts facts, attributes, and metrics as input.
Example
ApplyAgg(Regrsxx(#0,#1), [Argument 1], [Argument 2] {~+}
ApplyComparison
ApplyComparison is used to define a filter by populating the WHERE clause in the SQL
passed to your RDBMS, and can take facts, attributes, and metrics as input.
The ApplyComparison function is used with RDBMS comparison operators such as >,
like, and In.
Depending on your MicroStrategy product and licensing, this function may not be
available.
Syntax
ApplyComparison()
Example
ApplyComparison ("#0>#1", Store@ID,2)
For another example of the ApplyComparison function, see Example:
ApplyComparison used to check a prompted date, page 28.
ApplyLogic
The ApplyLogic function is used to define custom filters. It is used with logical
operators such as AND and OR. ApplyLogic is a logical function.
Depending on your MicroStrategy product and licensing, this function may not be
available.
Syntax
ApplyLogic()
Accepts logic (Boolean) values as input.
Example
ApplyLogic(#0 and #1, Year@ID>2003, Month@ID>200301)
ApplyOLAP
OLAP functions are group-value functions that take a set of data as input and generate a
set of data as output, usually reordering the set according to some criteria.
ApplyOLAP is the MicroStrategy Apply function tool used for OLAP functionality when
you wish to use the native capabilities of your RDBMS. It is used to define compound
metrics via database-specific functions such as Rank(). ApplyOLAP, like
ApplySimple, is used to define metrics but differs in that it only accepts metrics as
input.
Depending on your MicroStrategy product and licensing, this function may not be
available.
Syntax
ApplyOLAP()
Accepts only metrics as input.
Example
ApplySimple
The ApplySimple function is a single-value function. It is used to insert any single-
value, database-specific functions and simple operators directly into SQL.
In general, ApplySimple can be used to create the following objects:
Attribute form
For any Apply function, the attribute form in the arguments should be a single
formnot a form group. The engine ignores any definitions based on attribute
forms.
Consolidation
Custom group
Fact
Metric
Subtotal
Transformation
For information about consolidations, custom groups, metrics, and subtotals, see the
MicroStrategy Advanced Reporting Guide.
Depending on your MicroStrategy product and licensing, this function may not be
available.
Syntax
ApplySimple()
Accepts facts, attributes, and metrics as input.
Examples of object creation
ApplySimple("Datediff(YY,#0,getdate())", [BIRTH_DATE])
ApplySimple("Months_between(sysdate,#0)", [CURRENT_DT])
Examples: Incorrect usage
ApplySimple("Sum(#0)",[Column 1])
ApplySimple("Count(#0)",[Column 2])
The two examples immediately above are incorrect and should not be used in your
application because of the following two reasons:
ApplySimple is a single-value function and therefore can only be used with single-
value functions. Sum and Count are both group-value functions and therefore should
not be used with ApplySimple.
Sum and Count are both MicroStrategy functions and are not database-specific;
therefore, they should not be used with ApplySimple or any other Apply functions.
Banding functions
Banding functions are used to group data on a report so that it is both more
comprehensible and aesthetically pleasing than when it is displayed as one contiguous
list. MicroStrategy provides different banding options for you to use, depending on how
you want to divide your data. The banding functions, their syntaxes, and examples are
listed below.
Banding
This function maps metric values that fall within a certain range to a particular integer
band value. The range and band values are determined by the parameter input to the
function. For example, if 5,000 is the specified range, the dollar sales are shown in bands
of 0 - 5,000, 5,001 - 10,000, 10,001 - 15,000, and so on. Banding is a single-value
function.
Syntax
Banding <HasResidue>(Argument, StartAt, StopAt, Size)
Where:
Argument is a metric.
StartAt and StopAt are real numbers specifying the full range of the values to be
placed in bands.
Size is a real number indicating the width of each band.
HasResidue is a TRUE/FALSE parameter that defines whether an extra band is
created for all values that do not fall within the StartAt and StopAt values.
The result is that 21 bands are created, each encompassing a range of 20,000 dollars of
total revenue. To determine the number of bands, 410,000 is divided by 20,000 resulting
in 20.5 (rounded to nearest integer, 21). Each band is given an integer value of between 1
and 21.
The result is that 20 bands of equal sizes are created. To determine the range of each
band, 410,000 is divided by 25 resulting in bands of 16,400. Each band is given an
integer value of between 1 and 25.
Case functions
Case functions return specified data in a SQL query based on the evaluation of user-
defined conditions. In general, a user specifies a list of conditions and corresponding
return values. When MicroStrategy queries the data warehouse, the software determines
which condition evaluates as true and then returns the value that the user has specified
that corresponds to that condition. The case functions, their syntaxes, and examples are
listed below.
Case
This function evaluates multiple expressions until a condition is determined to be true,
then returns a corresponding value. If all conditions are false, a default value is returned.
Case can be used for categorizing data based on multiple conditions. This is a single-
value function.
Depending on your MicroStrategy product and licensing, this function may not be
available.
Syntax
The If function is very similar to the Case function. Each function takes a condition as
an argument and returns a value depending on whether the condition is true or not. The
Case function can evaluate multiple conditional arguments, while the If function can
only evaluate one condition. However, the If function can be evaluated by either the SQL
Engine or the Analytical Engine, while the Case function is evaluated only by the
Analytical Engine.
Depending on your MicroStrategy product and licensing, this function may not be
available.
Syntax
CaseV (Argument, Value1, Result1, Value2, Result2, ...,
DefaultResult)
Where:
Argument is the metric against which all values are compared.
Value1 is the first value (constant or metric) to be evaluated.
Result1 is the information to return (constant or metric) if the Value1 value is
equal to the value for the Metric.
Value2 is the second value (constant or metric) to be evaluated.
Result2 is the information to return (constant or metric) if the Value2 value is
equal to the value for the Metric.
... represents any number of Conditions and Return Values that can be passed
through this function.
DefaultResult is the information to return (constant or metric) if none of the
other values are Equal to the Metric.
Usage notes
The metric or argument in the CaseV expression is always held as a float. This means
that even if the value is 2, it is held as 2.00000; and therefore 2 and 2.00000 are never
considered equal. For this reason, it is best if you wrap the metric or argument in the
integer function, for example, CaseV(int(M1), 2, A,...).
Example
This simple example generates a report where if the Unit Profit for the item is 2, the
function returns a 200; if the Unit Profit for the item is 3, the function returns a 300; if
Unit Profit is any other value, the function returns a 1000000. Notice how a single
metric, Unit Profit, is evaluated against multiple numeric values. The report contains the
attribute Item and the metrics Unit Profit and CaseV. A report filter limits the items
displayed to those in the subcategory Action. The CaseV metric is defined as follows:
CaseV ([Unit Profit], 2, 200, 3, 300, 1000000)
Coalesce
Returns the value of the first non-null argument. Coalesce can be used to identify data
in tables that may not be fully populated or in metric definitions.
Depending on your MicroStrategy product and licensing, this function may not be
available.
Syntax
Coalesce (Argument1, Argument2,..., ArgumentN)
Where:
The arguments for the Coalesce function can be any expression that can be evaluated
as null or not null.
Usage Notes
You can use the Coalesce function in defining a metric, but more often it is used with the
Query Builder feature to support the inclusion of the Coalesce function in SQL queries.
See the example below for more detailed information.
Example
Your database has two tables T1 and T2 that include the column MONTH_ID with the
format yyyymm. You want to filter on a specific month, but you are not sure which table
has been populated with month data. In the Query Builder Editor, you can filter your
SQL query by creating the condition Coalesce(T1.MONTH_ID, T2.MONTH_ID) =
200410. The WHERE clause of the SQL query checks for the first non-null MONTH_ID
column and compares it to the value 200410.
For more information on Query Builder, see the Advanced Reporting Guide.
NULL/Zero functions
The NULL/Zero functions are often used to determine how NULLs and zeros are
displayed on a report. They can also be used as a form of data validation to ensure
meaningful results. For example, an otherwise invalid mathematical expression such as 5
+ NULL can be changed to 5 + 0.
IsNotNull
Returns TRUE if value input is not NULL; otherwise, returns FALSE. This is a comparison
function.
Depending on your MicroStrategy product and licensing, this function may not be
available.
Syntax
IsNotNull(Argument)
Where:
Argument is a fact or metric.
Usage notes
The IsNull and IsNotNull functions work only with the data returned from the database.
For example, if the database data is NULL, the IsNotNull function returns a FALSE.
However, you may see NULL data when you manipulate a report after its original
generation and that manipulation does not regenerate the data from the database. This
can happen when you page by, for example, and the result includes a NULL.
IsNull
Returns TRUE if the value is NULL; otherwise, returns FALSE. This is a comparison
function.
Depending on your MicroStrategy product and licensing, this function may not be
available.
Syntax
IsNull(Argument)
Where:
Argument is a fact or metric.
Usage notes
The IsNull and IsNotNull functions work only with the data returned from the database.
For example, if the database data is NULL, the IsNotNull function returns a FALSE.
However, you may see NULL data when you manipulate a report after its original
generation and that manipulation does not regenerate the data from the database. This
can happen when you page by, for example, and the result includes a NULL.
NullToEmpty
Converts a value of NULL to an empty string. If the value is not NULL, the original value
is kept.
Syntax
NullToEmpty(Argument)
Where:
Argument is metric or attribute form.
Example
You can use NullToEmpty when creating derived attributes to convert NULL values for
attribute elements to empty strings. For example, you can convert NULL values to empty
strings so that attribute element values can be successfully concatenated with functions
such as Concat (see Concat (concatenate), page 225) or ConcatBlank (see ConcatBlank
(concatenate plus blank space), page 226).
For steps to create derived attributes, see the MicroStrategy Web Help.
NullToZero
Converts a value of NULL to 0. If the value is not NULL, the original value is kept.
Syntax
NullToZero(Argument)
Where:
Argument is a fact or metric.
Example
In this simple example, the function NullToZero is applied to a list of values (12, NULL,
97, 43, NULL). The resulting list is (12, 0, 97, 43, 0). This function could be applied to a
value list before it is acted on by another function such as Average so that NULL values
in a list are included as list elements and factored into the average as zeros.
ZeroToNull
Converts a value of 0 to NULL. If the value is not 0, the original value is kept.
Syntax
ZeroToNull(Argument)
Where
Argument is a fact or metric.
Example
In this simple example, the function ZeroToNull is applied to a list of values (12, 0, 97,
43, 0). The resulting list is (12, NULL, 97, 43, NULL). This function could be applied to a
value list before it is acted on by another function such as Average so that zero values in
a list are not included as list elements and therefore not factored into the average.
OLAP functions
OLAP functions are also known as relative functions. They take multiple elements from a
list and return a new list of elements. The following applies to all OLAP functions:
SortBy is applied before the engine performs the calculation of an OLAP function.
In OLAP functions, the SortBy parameter can be either a metric or an attribute.
Many OLAP functions calculate measures useful for analyzing a set of values such as the
sum, average, and standard deviation. These functions fall into three groups depending
on how they select the window of values on which they base their calculations. These
groups are as follows:
Running: Functions with a running window include the current value and all
preceding values. For example, given the list (1, 2, 3, 4), RunningSum returns the
sums 1, 3, 6, and 10. This example is illustrated in the table below. These functions
include the word Running in their name, such as RunningAvg and
RunningStDev.
Moving: Functions with a moving window include the current value and a fixed
number of preceding values. For example, given the list (1,2,3,4) and a window size
of 2, MovingSum returns 1, 3, 5, and 7. This example is illustrated in the table below.
These functions include the word Moving in their name, such as MovingAvg and
MovingStDev.
OLAP: Functions with flexible windows allow you to set where windows begin and
end in relation to the current value. This feature allows you to include both
preceding and succeeding values in your calculations. For example, you can use
OLAPSum to include one value above and below the current row. This example is
illustrated in the table below. These functions include the word OLAP, such as
OLAPSum and OLAPAvg.
The following table lists a comparison of the example scenarios described above.
Example
This example uses small numbers to demonstrate the calculation for the exponential
weighted moving average (ExpWghMovingAvg) function. For example, you have a list of
values (32, 8, 5), with 5 being the most recent value, and you assign a rate of .5 and a
window size of 2.
As an additional example, the Human Resources Analysis Module project includes the
Division Breakdown report shown below.
Conversely, you can modify the same ExpWghMovingAvg metric to use the following
expression:
ExpWghMovingAvg<BreakBy={Division}, SortBy= (Quarter) >
(Employees, 4.0, 2)
The rate of 2 changes the moving average to apply more significance, or weight, to older
data. This means that the number of Sales employees during the first quarter (13) has
more weight than the number of Sales employees in the fourth quarter (18). When
comparing MovingAvg and ExpWghMovingAvg for the Sales division, you can see that
the ExpWghMovingAvg is smaller. This is because more significance is given to older
data, and employment was lower earlier in the year. This is shown in the report below.
Example
This example uses small numbers to demonstrate the calculation for the exponential
weighted running average (ExpWghRunningAvg) function. For example, you have a list
of values (32, 8, 5), with 5 being the most recent value, and you assign a rate of .5.
FirstInRange
Returns the first value in a range of values. FirstInRange can be used to examine data
such as inventory at the beginning of each month.
Calculations can be restarted based on attributes set in the function parameters. This
restart capability differentiates FirstInRange from First. While First is a group-
value function and takes both facts and metrics as argument input, FirstInRange is an
OLAP function and takes only metrics as argument input.
Syntax
Where:
k = row number
y1 = first non-NULL value of the metric after applying the BreakBy and SortBy
parameters
Example
This example shows the results of using the FirstInRange function. The report includes
the attributes Customer Region and Customer State and the metrics Profit and
FirstInRange. A report filter limits the regions displayed to Northwest, Southeast, and
Southwest. The FirstInRange metric is defined as follows:
FirstInRange<BreakBy={[Customer Region]}, SortBy=
([Customer State]) >(Profit)
In the following report, FirstInRange returns the first profit value in the list of Customer
States for each Customer Region.
Lag
The Lag function is useful to display a set of metric values in an order determined by
another metric or attribute on the report. This allows you to compare metric values side-
by-side. The easiest way to understand the Lag function is with an example, provided
below.
Syntax
Lag <BreakBy, SortBy> (Argument, Offset, DefaultValue)
Where:
BreakBy is the attribute indicating where the calculation restarts.
SortBy is the attribute or metric by which the data is sorted.
Argument is an attribute or metric representing a list of values. It is common to use
a metric for Argument.
Offset specifies the offset from the current row to display information for. This
offset trails behind the current row (you can use the Lead function to use an offset
that precedes ahead of the current row, see Lead, page 162). For example, with an
offset of two, row three displays data for the row two behind it, which would be row
one.
DefaultValue is the value displayed for any entries that do not have any data due
to the offset. For example, when using an offset of 2, the first two entries use the
default value.
Some common default values to display include:
0: To display a value of 0 for any entries that do not have any data due to the
offset, type 0.
No data: To display no data for any entries that do not have any data due to the
offset, type ZeroToNull(0).
Example
On a report with Item, Cost, and Profit, you can use the Lag function to create a Cost
(Lag on Profit) metric. This metric displays Cost values based on the descending sort
order of the Profit metric, and is defined with the following expression:
Lag<SortBy= (Profit Desc) >(Cost, 3.0, 0.0)
Notice that the offset is set to three, meaning that the display of cost values lags behind
by three entries. This is displayed in the report results shown below.
Only the top and the bottom of the report is shown. To view the entire report
results, you can create this report in the MicroStrategy Tutorial project.
The Cost (Lag on Profit) values are displayed three behind the Cost metric, and are
displayed based on the descending sort order of Profit. Notice that with an offset of
three, the first three entries for Cost (Lag on Profit) use the default value of zero. Also,
the last three values of Cost are not included in the Cost (Lag on Profit) metric.
The report has been sorted based on the Profit metric to make the Cost (Lag on Profit)
values easier to analyze.
The examples shown below were created in the MicroStrategy Tutorial project.
The examples below use the Lag function. The Lead function can be used in the
same way. The difference in using Lead rather than Lag is that the Lead
function would display information by going forward in time rather than
backward. For example, while the Lag function can return historical data from
one year ago, the same formula used for the Lead function would return
historical data from one year ahead.
The Lead function does not predict future values. For functions that can
predict future values based on historical data, see ForecastV (forecast,
vector input), page 344, GrowthV (growth, vector input), page 348, and
TrendV (trend, vector input), page 370. Additionally, you can use data
mining functions from MicroStrategy Data Mining Services to predict future
trends, as described in Data mining functions, page 259.
For example, a Last Years Monthly Revenue metric can be created using the following
function:
Lag<SortBy=(Month@ID)>(Revenue,12,ZeroToNull(0))
This metric can then be included on a report with the Month attribute and the Revenue
metric, as shown below.
This allows you to perform a side-by-side comparison of monthly revenue for different
years. In this report, the 2007 monthly revenue is displayed next to the 2008 monthly
revenue. The element Jan 2009 is included to show that the Last Years Monthly
Revenue is displaying the monthly revenue from the previous year.
By modifying the offset of the Lag function, you can change the time periods that can be
compared side by side. For example, the function listed above uses an offset of 12, which
displays monthly data from one year ago. Using an offset of 3 would display monthly
data from three months ago, while using an offset of 24 would display monthly data from
two years ago. These slight modifications could be used to create separate metrics that
could all be included on the same report. The report below shows an example of
including three different metrics that use the same Lag formula with a different offset.
The report shown above allows side-by-side comparison of monthly revenue for three
different time periods. In this report, the Monthly Revenue 2 Years Ago metric displays
no data for months in the year 2008 because no revenue data exists for the year 2006.
To use the Lag or Lead functions for transformation-style analysis, the metric formulas
must be created to support the required reporting scenario. For example, the report with
the Month attribute and the Revenue metric has the Category attribute added to it. To
support this reporting scenario, you can modify the Lag formula described above to
include the Category attribute, as shown below.
Lag<BreakBy={Category},SortBy=(Month@ID)>
(Revenue,12,ZeroToNull(0))
Using the formula shown above, the calculation is restarted for each category, which
allows the side-by-side comparison of monthly revenue over time for each category, as
shown in the report below:
Only the Month attribute elements Jan 2007, Jan 2008, and Jan 2009 are displayed to
show that the Last Years Monthly Revenue (Category) metric is displaying the monthly
revenue from the previous year.
LastInRange
Returns the last value in a range of values. LastInRange can be used to examine data
such as inventory at the end of each month.
Calculations can be restarted based on attributes set in the function parameters. This
restart capability differentiates LastInRange from Last. While Last is a group-value
function and takes both facts and metrics as argument input, LastInRange is an OLAP
function and takes only metrics as argument input.
Syntax
LastInRange <BreakBy={}, SortBy=()> (Argument)
Where:
BreakBy is the attribute indicating where the calculation restarts.
SortBy is the attribute or metric by which the data is sorted.
Argument is a metric representing a list of numbers.
Expression
Where:
k = row number
yk = last non-NULL value of the metric after applying the BreakBy and SortBy
parameters
Lead
The Lead function is useful to display a set of metric values in an order determined by
another metric or attribute on the report. This allows you to compare metric values side-
by-side. The easiest way to understand the Lead function is with an example, provided
below.
Syntax
Lead <BreakBy, SortBy> (Argument, Offset, DefaultValue)
Where:
BreakBy is the attribute indicating where the calculation restarts.
SortBy is the attribute or metric by which the data is sorted.
Argument is an attribute or metric representing a list of values. It is common to use
a metric for Argument.
Offset specifies the offset from the current row to display information for. This
offset precedes ahead of the current row (you can use the Lag function to use an
offset that trails behind the current row, see Lag, page 157). For example, with an
offset of two, row one displays data for the row two ahead of it, which would be row
three.
DefaultValue is the value displayed for any entries that do not have any data due
to the offset. For example, when using an offset of 2, the last two entries use the
default value.
Some common default values to display include:
0: To display a value of 0 for any entries that do not have any data due to the
offset, type 0.
No data: To display no data for any entries that do not have any data due to the
offset, type ZeroToNull(0).
Example
For an example of using Lag and Lead functions to perform transformation-style
analysis, see Transformation-style analysis using the Lag and Lead functions, page 158.
On a report with Item, Cost, and Profit, you can use the Lead function to create a Cost
(Lead on Profit) metric. This metric displays Cost values based on the descending sort
order of the Profit metric, and is defined with the following expression:
Lead<SortBy= (Profit Desc) >(Cost, 3.0, 0.0)
Notice that the offset is set to three, meaning that the display of cost values is displayed
three ahead of the current value. This is displayed in the report results shown below.
Only the top and the bottom of the report is shown. To view the entire report
results, you can create this report in the MicroStrategy Tutorial project.
The Cost (Lead on Profit) values are displayed three ahead of the Cost metric, and are
displayed based on the descending sort order of Profit. Notice that with an offset of
three, the last three entries for Cost (Lead on Profit) use the default value of zero. Also,
the first three values of Cost are not included in the Cost (Lead on Profit) metric.
The report has been sorted based on the Profit metric to make the Cost (Lead on Profit)
values easier to analyze.
Where:
yi = metric value at the ith row
m = window size
n = number of rows/metric values
Example
This simple example illustrates how the MovingAvg function calculates a list of values
and returns the average of a specified number of values. In this case, the window size is
set to 3, meaning that the value in the MovingAverage column represents the average of
the current value of the two values that precede it in the value list. The calculation is
shown in the following table.
Values MovingAverage
10 10 (10/1)
20 15 ((20+10) / 2)
30 20 ((30+20+10) / 3)
15 51.67 ((15+30+20) / 3)
5 16.67 ((5+15+30) / 3)
20 13.34 ((20+5+15) / 3)
40 21.67 ((40+20+5) / 3)
As an additional example, the Human Resources Analysis Module project includes the
Division Breakdown report shown below.
This report displays details about employee headcounts for each division, over the various
quarters of 2010. Included in this report is the metric MovingAvg. It is defined as a
derived metric, using the following expression:
MovingAvg<BreakBy={Division}, SortBy=(Quarter)>
(Employees, 4.0)
This expression calculates the moving average of employee headcount for a given
division, during the four quarters of 2010. The window size of 4.0 specifies that the
average is calculated across the four quarters, and BreakBy={Divison} ensures that
the moving average calculation is specific to each division.
Using this MovingAvg metric, you can determine that the Sales division had between
13.0 and 16.3 employees on average during the 2010 year, with slight increases
throughout the year.
For an extension of this example on how you can also use a weighted moving average,
see ExpWghMovingAvg (exponential weighted moving average), page 151.
MovingCount
Returns the moving count of a list of values. The calculation can be restarted based on
attributes set in the function parameters. This is an OLAP function.
Syntax
MovingCount <BreakBy={}, SortBy=()> (Argument,
WindowSize)
Where:
BreakBy is the attribute indicating where the calculation restarts.
SortBy is the attribute or metric by which the data is sorted.
Where:
yi = metric value at the ith row
m = window size
n = number of rows/metric values
1i = 1 if the value at the ith row is not NULL
1i = 0 otherwise
Usage Notes
If there are more entries in a section than the integer in the window size parameter,
then all the remaining entries are given the highest number in the count. For example, if
the window size is 4 and there are 6 entries in the list section, they are counted as
follows: 1,2,3,4,4,4.
Example
This simple example demonstrates how the MovingCount function counts rows of data.
This report uses the attributes Region and Employee, and the metrics Revenue and
Moving Count. A filter is applied so the only Regions displayed are South, Northwest, and
Southwest. The Moving Count metric is defined as follows:
MovingCount<BreakBy={Region}, SortBy= (Value) >(Revenue,
3.0)
The count restarts for every Region.
The entries are counted based on the value of the metric Revenue in ascending order
(the lowest value is counted as 1, next lowest is 2, and so on).
The highest number in the count is 3 as designated in the WindowSize parameter.
MovingDifference
Returns the moving difference between current and preceding values. The position of the
preceding row used in the calculation is defined in the function arguments. The
calculations can be restarted based on attributes set in the function parameters. This is
an OLAP function.
Syntax
MovingDifference <BreakBy, SortBy> (Argument, WindowSize)
Where:
BreakBy is the attribute indicating where the calculation restarts.
SortBy is the attribute or metric by which the data is sorted.
Argument is a metric representing a list of numbers.
WindowSize is a positive integer indicating the range of values used to compute
each difference.
Expression
Where:
yi = metric value at the ith row
m = window size
n = number of rows/metric values
Example
This example illustrates how the MovingDifference function subtracts the value of a
preceding row from the value of the current row and returns the difference. In this case,
the window size is set to 3, meaning that the value two rows previous to the current row
is subtracted from the current row. In other words, there are 3 rows in the window, the
current row is 3, the row immediately preceding it is 2, and the row preceding that is 1;
therefore, the calculation for the moving difference of row 3 is (row 3 - row 1).
The value in the MovingDifference column represents the result of the calculation for
every window of three values. The calculation is also shown.
Values MovingDifference
400
500
700 300 (700-400)
300 -200 (300-500)
600 -100 (600-700)
Where:
yi = metric value at the ith row
m = window size
n = number of rows/metric values
Example
This simple example illustrates how the MovingMaximum function moves through a list
of values, subtracting a value from the user-defined number of preceding rows. In this
case, the window size is set to 3, meaning that the value in the MovingMaximum column
represents the highest value among the current and preceding two values in the value
list. The calculation is shown in the following table.
Values MovingMaximum
550 550
30 550 (550>30)
40 550 (550>40 and 550>30)
Where:
yi = metric value at the ith row
m = window size
n = number of rows/metric values
Example
This simple example illustrates how the MovingMin function moves through a list of
values returning the lowest value within a specified number of values. In this case, the
window size is set to 3, meaning that the value in the MovingMinimum column
represents the lowest value among the current and preceding two values in the value list.
The calculation is shown in the following table.
Values MovingMinimum
550 550
30 30 (30<550)
40 30 (30<40 and 30<550)
Where:
yi = metric value at the ith row
y = average of metric
m = window size
n = number of rows/metric values
Example
This example shows a report where the moving standard deviation of the revenue is
calculated. This calculation is based on the assumption that the list of values supplied in
the metric represents the entire population of the data for which you want to obtain the
standard deviation. The calculation starts over for each region, the information is sorted
within the region by state in ascending order, and each calculation is based upon a
window size of 3.
Compare this example report to the example for MovingStDev to see the different
values returned when calculating for a population as opposed to a sample.
The report contains the attributes Customer Region and Customer State, and the metrics
Total Revenue, MovingStDevP, RunningStDevP, and StDevP. A report filter limits data to
the South, Southwest, and Northwest regions. The definition of the MovingStDevP
metric is as follows:
MovingStDevP<BreakBy={[Customer Region]}, SortBy=<
[Customer State])>([Total Revenue],3)
Where:
yi = metric value at the ith row
y = average of metric
m = window size
n = number of rows/metric values
Example
This example shows a report where the moving standard deviation of the revenue is
calculated. This calculation is based on the assumption that the list of values supplied in
the metric represents a sample of the data for which you want to obtain the standard
deviation. The calculation starts over for each region, the information is sorted within
the region by state in ascending order, and each calculation is based upon a window size
of 3.
Compare this example report to the example for MovingStDevP to see the different
values returned when calculating for a population as opposed to a sample.
The report contains the attributes Customer Region and Customer State, and the metrics
Total Revenue, MovingStDev, RunningStDev, and StDev. A report filter limits data to the
Southwest, Southeast, and Northwest regions. The definition of the MovingStDev metric
is as follows:
MovingStDev<BreakBy={[Customer Region]}, SortBy=<
[Customer State])>([Total Revenue], 3)
MovingSum
Returns the moving sum of the current value and preceding values as defined in the
function arguments. The calculations can be restarted based on attributes set in the
function parameters. This is an OLAP function.
Syntax
MovingSum <BreakBy,SortBy>(Argument, WindowSize)
Where:
Where:
yi = metric value at the ith row
m = window size
n = number of rows/metric values
Example
This simple example illustrates how the MovingSum function moves through a list of
values calculating and returning the sum of a specified number of values. In this case the
window size is set to 2 meaning that the sum in the MovingSum column represents the
current value added to the value from the value list that precedes it. The calculation is
shown in the following table.
Values MovingSum
10 10
20 30 (20+10)
30 50 (30+20)
15 45 (15+30)
5 20 (5+15)
Syntax
OLAPAvg<Distinct, OLAPWinStType, OLAPWinStOffset,
OLAPWinEndType, OLAPWinEndOffset, BreakBy, SortBy>
(Argument)
Where:
Distinct is a TRUE/FALSE parameter that allows you to use all values in the
calculation or to calculate using only the unique values. If you define Distinct to
be true, then the parameters OLAPWinStType, OLAPWinStOffset,
OLAPWinEndType, OLAPWinEndOffset, and SortBy are ignored.
BreakBy is the attribute indicating where the calculation restarts.
SortBy is the attribute or metric by which the data is sorted.
OLAPWinStType defines the window type for the starting location of the
calculation. Select one of the following options, listed by the name of the setting and
its corresponding OLAPWinStType value in parentheses:
Top of data set (0): The calculation starts at the top value as determined by the
BreakBy and SortBy values.
Current row (2): The calculation starts at the current row.
N rows before current row (3): The calculation starts a number of rows before
the current row. You define this offset of rows with the OLAPWinStOffset
parameter described below.
N rows after current row (4): The calculation starts a number of rows after the
current row. You define this offset of rows with the OLAPWinStOffset
parameter described below.
OLAPWinStOffset defines the offset of rows from the current row to start the
calculation. You can define this offset if the OLAPWinStType parameter is defined
as N rows before current row (3) or N rows after current row (4).
OLAPWinEndType defines the window type for the ending location of the
calculation. Select one of the following options, listed by the name of the setting and
its corresponding OLAPWinEndType value in parentheses:
Bottom of data set (1): The calculation stops at the bottom value as determined
by the BreakBy and SortBy values.
Current row (2): The calculation stops at the current row.
N rows before current row (3): The calculation stops a number of rows before
the current row. You define this offset of rows with the OLAPWinEndOffset
parameter described below.
N rows after current row (4): The calculation stops a number of rows after the
current row. You define this offset of rows with the OLAPWinEndOffset
parameter described below.
OLAPWinEndOffset defines the offset of rows from the current row to stop the
calculation. You can define this offset if the OLAPWinEndType parameter is defined
as N rows before current row (3) or N rows after current row (4).
Argument is a metric representing a list of numbers.
The function is not valid if your starting point is at a lower point than your ending
point.
Example
An OLAPAvg Unit Cost metric is created using the OLAPAvg function based on the Unit
Cost metric, as defined below:
OLAPAvg<OLAPWinStType=3, OLAPWinStOffset=3,
OLAPWinEndType=4, OLAPWinEndOffset=2, BreakBy={Category}
SortBy={Item}>([Unit Cost])
The starting point for the average is defined as three rows before the current row
(OLAPWinStType=3, OLAPWinStOffset=3). The stopping point for the average is
defined as two rows after the current row (OLAPWinEndType=4,
OLAPWinEndOffset=2).
This metric is displayed on a report along with Category, Item, and Unit Cost, as shown
below.
There are a few facts about this data to take note of.
The first value of OLAPAvg Unit Cost is $15. This is calculated by adding $32, $8, and $5
to get a total of $45. This total of $45 is then divided by three (the number of rows
included in the calculation) to get the final result of $15. These rows are included because
the calculation ends two rows after the current row. Even though the calculation starts
three rows before the current row, there is no data above the current row to include in
the calculation.
The fourth value for OLAPAvg Unit Cost is the first value that can include data from all
three rows above the current row to two rows below the current row in the calculation
(($32 + $8 + $5 + $25 + $19 + $20) / 6 = $18.17). Notice that with this
calculation a value of six is used to calculate the average because six rows were included
in the average.
While it is not shown on this report, the calculation would restart for the first Item of
the next Category because the function is defined to break by the Category attribute.
OLAPCount
Returns the count of the current value, preceding values, and succeeding values as
defined in the function arguments. Unlike RunningCount and MovingCount, which
can only include values above the current row in the calculation, you can use
OLAPCount to include values both above and below the current row in the calculation.
The calculations can be restarted based on attributes defined in the function parameters.
Syntax
OLAPCount<Distinct, Null, OLAPWinStType, OLAPWinStOffset,
OLAPWinEndType, OLAPWinEndOffset, BreakBy, SortBy>
(Argument)
Where:
Distinct is a TRUE/FALSE parameter that allows you to use all values in the
calculation or to calculate using only the unique values. If you define Distinct to
be true, then the parameters Null, OLAPWinStType, OLAPWinStOffset,
OLAPWinEndType, OLAPWinEndOffset, and SortBy are ignored.
Null is a TRUE/FALSE parameter that defines whether null values are included in
the total count.
BreakBy is the attribute indicating where the calculation restarts.
SortBy is the attribute or metric by which the data is sorted.
OLAPWinStType defines the window type for the starting location of the
calculation. Select one of the following options, listed by the name of the setting and
its corresponding OLAPWinStType value in parentheses:
Top of data set (0): The calculation starts at the top value as determined by the
BreakBy and SortBy values.
Current row (2): The calculation starts at the current row.
N rows before current row (3): The calculation starts a number of rows before
the current row. You define this offset of rows with the OLAPWinStOffset
parameter described below.
N rows after current row (4): The calculation starts a number of rows after the
current row. You define this offset of rows with the OLAPWinStOffset
parameter described below.
OLAPWinStOffset defines the offset of rows from the current row to start the
calculation. You can define this offset if the OLAPWinStType parameter is defined
as N rows before current row (3) or N rows after current row (4).
OLAPWinEndType defines the window type for the ending location of the
calculation. Select one of the following options, listed by the name of the setting and
its corresponding OLAPWinEndType value in parentheses:
Bottom of data set (1): The calculation stops at the bottom value. The top value
is determined by the BreakBy and SortBy values.
Current row (2): The calculation stops at the current row.
N rows before current row (3): The calculation starts a number of rows before
the current row. You define this offset of rows with the OLAPWinEndOffset
parameter described below.
N rows after current row (4): The calculation starts a number of rows after the
current row. You define this offset of rows with the OLAPWinEndOffset
parameter described below.
OLAPWinEndOffset defines the offset of rows from the current row to stop the
calculation. You can define this offset if the OLAPWinEndType parameter is defined
as N rows before current row (3) or N rows after current row (4).
Argument is a metric representing a list of numbers.
The function is not valid if your starting point is at a lower point than your ending
point.
Example
An OLAPCount Unit Cost metric is created using the OLAPCount function based on the
Unit Cost metric, as defined below:
OLAPCount<OLAPWinStType=3, OLAPWinStOffset=3,
OLAPWinEndType=4, OLAPWinEndOffset=2, BreakBy={Category}
SortBy={Subcategory}>([Unit Cost])
The starting point for the count is defined as three rows before the current row
(OLAPWinStType=3, OLAPWinStOffset=3). The stopping point for the count is
defined as two rows after the current row (OLAPWinEndType=4,
OLAPWinEndOffset=2).
This metric is displayed on a report along with Category, Subcategory, and Unit Cost, as
shown below.
There are a few facts about this data to take note of.
The first value of OLAPCount Unit Cost is three. This is calculated by counting the
current row and two rows after the current row. Even though the calculation starts three
rows before the current row, there is no data above the current row to include in the
calculation.
The fourth entry for OLAPCount Unit Cost is the first entry that can count all three rows
above the current row to two rows below the current row in the calculation. This entry is
able to reach the maximum value of six. Notice that after this entry the count begins to
decrease because there are no longer two rows below the current row to include in the
calculation.
The calculation restarts for the first Subcategory of the next Category because the
function is defined to break by the Category attribute.
Syntax
OLAPMax<OLAPWinStType, OLAPWinStOffset, OLAPWinEndType,
OLAPWinEndOffset, BreakBy, SortBy>(Argument)
Where:
BreakBy is the attribute indicating where the calculation restarts.
SortBy is the attribute or metric by which the data is sorted.
OLAPWinStType defines the window type for the starting location of the
calculation. Select one of the following options, listed by the name of the setting and
its corresponding OLAPWinStType value in parentheses:
Top of data set (0): The calculation starts at the top value as determined by the
BreakBy and SortBy values.
Current row (2): The calculation starts at the current row.
N rows before current row (3): The calculation starts a number of rows before
the current row. You define this offset of rows with the OLAPWinStOffset
parameter described below.
N rows after current row (4): The calculation starts a number of rows after the
current row. You define this offset of rows with the OLAPWinStOffset
parameter described below.
OLAPWinStOffset defines the offset of rows from the current row to start the
calculation. You can define this offset if the OLAPWinStType parameter is defined
as N rows before current row (3) or N rows after current row (4).
OLAPWinEndType defines the window type for the ending location of the
calculation. Select one of the following options, listed by the name of the setting and
its corresponding OLAPWinEndType value in parentheses:
Bottom of data set (1): The calculation stops at the bottom value. The top value
is determined by the BreakBy and SortBy values.
Current row (2): The calculation stops at the current row.
N rows before current row (3): The calculation starts a number of rows before
the current row. You define this offset of rows with the OLAPWinEndOffset
parameter described below.
N rows after current row (4): The calculation starts a number of rows after the
current row. You define this offset of rows with the OLAPWinEndOffset
parameter described below.
OLAPWinEndOffset defines the offset of rows from the current row to stop the
calculation. You can define this offset if the OLAPWinEndType parameter is defined
as N rows before current row (3) or N rows after current row (4).
Argument is a metric representing a list of numbers.
The function is not valid if your starting point is at a lower point than your ending
point.
Example
An OLAPMax Unit Cost metric is created using the OLAPMax function based on the Unit
Cost metric, as defined below:
OLAPMax<OLAPWinStType=3, OLAPWinStOffset=3,
OLAPWinEndType=4, OLAPWinEndOffset=2, BreakBy={Category}
SortBy={Subcategory}>([Unit Cost])
The starting point for the calculation is defined as three rows before the current row
(OLAPWinStType=3, OLAPWinStOffset=3). The stopping point for the calculation
is defined as two rows after the current row (OLAPWinEndType=4,
OLAPWinEndOffset=2).
This metric is displayed on a report along with Category, Subcategory, and Unit Cost, as
shown below.
There are a few facts about this data to take note of.
The first value of OLAPMax Unit Cost is $14. This is calculated by returning the
maximum value of $14, $11, and $6. These are included because the calculation ends two
rows after the current row. Even though the calculation starts three rows before the
current row, there is no data above the current row to include in the calculation.
The second value also returns $14 as it returns the maximum value of $14, $11, $6, and
$7.
The third value for OLAPMax Unit Cost is the first entry that includes $26 in its
maximum calculation. The rest of the OLAPMax Unit Cost values for the Books Category
return $26 because this is the maximum value, and it is within the window of three rows
above the current row to two rows below the current row.
The calculation restarts for the first Subcategory of the next Category because the
function is defined to break by the Category attribute.
OLAPWinEndType defines the window type for the ending location of the
calculation. Select one of the following options, listed by the name of the setting and
its corresponding OLAPWinEndType value in parentheses:
Bottom of data set (1): The calculation stops at the bottom value. The top value
is determined by the BreakBy and SortBy values.
Current row (2): The calculation stops at the current row.
N rows before current row (3): The calculation starts a number of rows before
the current row. You define this offset of rows with the OLAPWinEndOffset
parameter described below.
N rows after current row (4): The calculation starts a number of rows after the
current row. You define this offset of rows with the OLAPWinEndOffset
parameter described below.
OLAPWinEndOffset defines the offset of rows from the current row to stop the
calculation. You can define this offset if the OLAPWinEndType parameter is defined
as N rows before current row (3) or N rows after current row (4).
Argument is a metric representing a list of numbers.
The function is not valid if your starting point is at a lower point than your ending
point.
Example
An OLAPMin Unit Cost metric is created using the OLAPMin function based on the Unit
Cost metric, as defined below:
OLAPMin<OLAPWinStType=3, OLAPWinStOffset=3,
OLAPWinEndType=4, OLAPWinEndOffset=2, BreakBy={Category}
SortBy={Subcategory}>([Unit Cost])
The starting point for the calculation is defined as three rows before the current row
(OLAPWinStType=3, OLAPWinStOffset=3). The stopping point for the calculation
is defined as two rows after the current row (OLAPWinEndType=4,
OLAPWinEndOffset=2).
This metric is displayed on a report along with Category, Subcategory, and Unit Cost, as
shown below.
There are a few facts about this data to take note of.
The first value of OLAPMinUnit Cost is $6. This is calculated by returning the minimum
value of $14, $11, and $6. These are included because the calculation ends two rows after
the current row. Even though the calculation starts three rows before the current row,
there is no data above the current row to include in the calculation.
All of the OLAPMin Unit Cost values for the Books Category return $6 because this is
the minimum value, and it is within the window of three rows above the current row to
two rows below the current row.
The calculation restarts for the first Subcategory of the next Category because the
function is defined to break by the Category attribute.
OLAPRank
Returns the rank of the current value based on the other values defined by the sorting
criteria. The ranking can be restarted based on attributes defined in the function
parameters.
The OLAPRank function allows the ranking to be calculated in the database, rather than
calculating the ranking using the MicroStrategy Analytical Engine.
Since OLAPRank is calculated in the database, you can only use this function if
your database supports the OLAPRank function.
Any metrics that use the OLAPRank function must not be defined as smart
metrics. If metrics that use OLAPRank are defined as smart metrics, the
calculation is performed in the MicroStrategy Analytical Engine and an error is
returned.
You must include at least one metric in the SortBy parameter.
Syntax
OLAPRank<BreakBy, SortBy>()
Where:
BreakBy is the attribute indicating where the ranking restarts.
SortBy is the attribute or metric by which the data is sorted. For OLAPRank, the
SortBy parameter is also where you can include the metric to perform the
calculation on. You must include at least one metric in the SortBy parameter.
Example
The MicroStrategy Tutorial project includes an Avg Revenue per Customer metric. This
metric can be placed on a report along with the attributes Quarter and Region to display
the quarterly average revenue per customer for each region.
To extend this analysis, you can create an OLAPRank Avg Rev per Customer metric as
defined below:
OLAPRank<BreakBy={Quarter}, SortBy= ([Avg Revenue per
Customer], Region@ID) >()
When this metric is included on a report with Quarter, Region, and Avg Revenue per
Customer, it displays the regional rank of the quarterly average revenue per customer for
each region. This is shown in the report below.
The report has been sorted by Quarter, and then by the OLAPRank Avg Rev per
Customer values.
The report shown above displays regions based on their average revenue per customer
for each quarter, sorted from the lowest average revenue per customer to the highest.
This analysis allows you to quickly see how regions are performing based on average
revenue per customer over different quarters. In the first three quarters of data shown
above, Web has the lowest average revenue per customer. However, there is some
variation in the performance of the other regions. Performing this analysis over extended
periods of time can help to show trends in revenue and regional performance.
OLAPSum
Returns the summation of the current value, preceding values, and succeeding values as
defined in the function arguments. Unlike RunningSum and MovingSum, which can
only include values above the current row in the calculation, you can use OLAPSum to
include values both above and below the current row in the calculation.
The calculations can be restarted based on attributes defined in the function parameters.
Syntax
OLAPSum<Distinct, OLAPWinStType, OLAPWinStOffset,
OLAPWinEndType, OLAPWinEndOffset, BreakBy, SortBy>
(Argument)
Where:
Distinct is a TRUE/FALSE parameter that allows you to use all values in the
calculation or to calculate using only the unique values. If you define Distinct to
be true, then the parameters OLAPWinStType, OLAPWinStOffset,
OLAPWinEndType, OLAPWinEndOffset, and SortBy are ignored.
BreakBy is the attribute indicating where the calculation restarts.
SortBy is the attribute or metric by which the data is sorted.
OLAPWinStType defines the window type for the starting location of the
calculation. Select one of the following options, listed by the name of the setting and
its corresponding OLAPWinStType value in parentheses:
Top of data set (0): The calculation starts at the top value as determined by the
BreakBy and SortBy values.
Current row (2): The calculation starts at the current row.
N rows before current row (3): The calculation starts a number of rows before
the current row. You define this offset of rows with the OLAPWinStOffset
parameter described below.
N rows after current row (4): The calculation starts a number of rows after the
current row. You define this offset of rows with the OLAPWinStOffset
parameter described below.
OLAPWinStOffset defines the offset of rows from the current row to start the
calculation. You can define this offset if the OLAPWinStType parameter is defined
as N rows before current row (3) or N rows after current row (4).
OLAPWinEndType defines the window type for the ending location of the
calculation. Select one of the following options, listed by the name of the setting and
its corresponding OLAPWinEndType value in parentheses:
Bottom of data set (1): The calculation stops at the bottom value. The top value
is determined by the BreakBy and SortBy values.
Current row (2): The calculation stops at the current row.
N rows before current row (3): The calculation stops a number of rows before
the current row. You define this offset of rows with the OLAPWinEndOffset
parameter described below.
N rows after current row (4): The calculation stops a number of rows after the
current row. You define this offset of rows with the OLAPWinEndOffset
parameter described below.
OLAPWinEndOffset defines the offset of rows from the current row to stop the
calculation. You can define this offset if the OLAPWinEndType parameter is defined
as N rows before current row (3) or N rows after current row (4).
Argument is a metric representing a list of numbers.
The function is not valid if your starting point is at a lower point than your ending
point.
Example
An OLAPSum Unit Cost metric is created using the OLAPSum function based on the
Unit Cost metric, as defined below:
OLAPSum<OLAPWinStType=3, OLAPWinStOffset=3,
OLAPWinEndType=4, OLAPWinEndOffset=2, BreakBy={Category}
SortBy={Subcategory}>([Unit Cost])
The starting point for the summation is defined as three rows before the current row
(OLAPWinStType=3, OLAPWinStOffset=3). The stopping point for the summation
is defined as two rows after the current row (OLAPWinEndType=4,
OLAPWinEndOffset=2).
This metric is displayed on a report along with Category, Subcategory, and Unit Cost, as
shown below.
There are a few facts about this data to take note of.
The first value of OLAPSum Unit Cost is $30.82. This is calculated by adding $13.93,
$10.75, and $6.13. These are included because the calculation ends two rows after the
current row. Even though the calculation starts three rows before the current row, there
is no data above the current row to include in the calculation.
The data displayed on the report is rounded to the nearest cent, which can give the
impression that some calculations are slightly incorrect. For example, adding
$13.93, $10.75, and $6.13 actually totals $30.81 rather than $30.82 as displayed on
the report. This difference is because the data is rounded up for display on the
report. You can display more decimal values for the Unit Cost and OLAPSum Unit
Cost metrics to see the exact values.
The fourth value for OLAPSum Unit Cost is the only value that can include data from all
three rows above the current row to two rows below the current row in the calculation
($13.93 + $10.75 + $6.13 + $7.20 + $25.93 + $9.43 = $73.38).
The final OLAPSum Unit Cost value for the Books Category can only include the Unit
Cost value for the current row and the three rows above it ($6.13 + $7.20 +
$25.93 + $9.43 = $48.70). It cannot include two rows below the current row
because the calculation restarts for the first Subcategory of the next Category. The
calculation restarts because the function is defined to break by the Category attribute.
Where:
yi = metric value at the ith row
m = window size
n = number of rows/metric values
Example
This simple example illustrates how the RunningAverage function walks through a list
of values calculating and returning the new average with the addition of each value. The
calculation is shown in the following table.
Values RunningAverage
10 10 (10/1)
20 15 (30/2)
30 20 (60/3)
40 25 (100/4)
50 30 (150/5)
RunningCount
Returns the running count for each value in a list of values, returning the current count
after each value. The count can be restarted based upon attributes identified in the
parameter settings. This is an OLAP function.
Syntax
RunningCount<BreakBy,SortBy>(Argument)
Where:
BreakBy is the attribute indicating where the calculation restarts.
SortBy is the attribute or metric by which the data is sorted.
Argument is a metric representing the list of values.
Expression
Where:
1i = 0 if the ith row of argument is NULL
1i = 1 otherwise
This simple example demonstrates how the RunningCount function counts rows of
data. This report uses the attributes Region and Employee, and the metrics Revenue and
Running count. A filter is applied so the only Regions displayed are South, Northwest,
and Southwest. The Running count metric is defined as follows:
RunningCount<BreakBy={Region}, SortBy= (Value) >(Revenue)
The count restarts for every Region.
The entries are counted based on the value of the metric Revenue in ascending order
(the lowest value is counted as 1, next lowest is 2, and so on).
Where:
yi = metric value at the ith row
Values RunningMaximum
8
6 8 (8>6)
10 10 (10>8)
9 10 (10>9)
5 10 (10>5)
Where:
yi = metric value at the ith row
This simple example illustrates how the RunningMinimum function walks through a list
of values comparing each value to the lowest value identified so far and returning the
minimum value as it progresses. The calculation is shown in the following table.
Values RunningMinimum
8
6 6 (6<8)
10 6 (6<10)
9 6 (6<9)
5 5 (5<6)
Where:
yi = metric value at the ith row
This example shows a report where the running standard deviation of the revenue is
calculated. This calculation is based on the assumption that the list of values supplied in
the metric represents the entire population of the data for which you want to obtain the
standard deviation. The calculation starts over for each region, and the information is
sorted within the region by state in ascending order.
Compare this example report to the example for RunningStDev to see the different
values returned when calculating for a population as opposed to a sample.
The report contains the attributes Customer Region and Customer State, and the metrics
Total Revenue, RunningStDevP, and StDevP. A report filter limits data to the Southwest,
Southeast, and Northwest regions. The definition of the RunningStDevP metric is as
follows:
RunningStDevP<BreakBy={[Customer Region]}, SortBy=<
[Customer State])>([Total Revenue])
Example
This example shows a report where the running standard deviation of the revenue is
calculated. This calculation is based on the assumption that the list of values supplied in
the metric represents a sample of the data for which you want to obtain the standard
deviation. The calculation starts over for each region, and the information is sorted
within the region by state in ascending order.
Compare this example report to the example for RunningStDevP to see the
different values returned when calculating for a population as opposed to a sample.
The report contains the attributes Customer Region and Customer State, and the metrics
Total Revenue, RunningStDev, and StDev. A report filter is used to limit the data to the
Southwest, Southeast and Northwest regions. The definition of the RunningStDev metric
is as follows:
RunningStDev<BreakBy={[Customer Region]}, SortBy=<
[Customer State])>([Total Revenue])
RunningSum
This function returns the running sum of the values in a list, adding the current value to
the preceding values. It can be used to maintain running totals of values in specific
categories as well as an entire set. The calculation can restart based on attributes
identified in the parameter settings. This is an OLAP function.
Syntax
RunningSum <BreakBy,SortBy>(Argument)
Where:
BreakBy is the parameter that sets the attribute designating where the calculation
restarts.
SortBy is the parameter that sets the attribute or metric by which the data is sorted.
Argument is a metric representing the list of numbers.
Expression
Example
Example 1: A running sum displays the results of each calculation as it works towards the
total of a set of values. Using the value set (1, 2, 3, 4, 5), the following table illustrates the
running sum and its calculations.
Values RunningSum
1 1 (0+1)
2 3 (1+2)
3 6 (3+3)
4 10 (6+4)
5 15 (10+5)
Example 2: This example shows a report where the running sum of the revenue is
calculated. The calculation starts over for each region, and the information is sorted
within the region by state in ascending order. The report contains the attributes
Customer Region and Customer State, and the metrics Total Revenue and Running Sum.
A report filter limits data to the Southwest, Southeast, and Northwest regions. The
definition of the Running Sum metric is as follows:
RunningSum<BreakBy={[Customer Region]}, SortBy=<[Customer
State])>([Total Revenue])
Note that the subtotaled Total Revenue is equal to the last value in the Running Sum
column for each region.
Syntax
WeightedCorr <FactID> (Argument1, Argument2, Weight)
Where:
FactID is a parameter that forces a calculation to take place on a fact table that
contains the selected fact.
Argument1 and Argument2 are attributes, facts, or metrics representing lists of
numbers for comparison. A correlation is calculated on these values to determine the
level of association between the two values.
Weight is an attribute, fact, or metric representing a list of numbers to define the
weight of each comparison.
Expression
Where:
x and y are the values being compared.
w is the weight applied to each comparison.
Usage notes
The correlation coefficient is measured on a scale that varies from 1 to - 1. So only a
value between -1 and 1 is returned.
Complete correlation between two variables is expressed by either 1 or -1. When one
variable increases as the other increases, the correlation is positive. When one
decreases as the other increases, the correlation is negative. Complete absence of
correlation is represented by 0.
If an array or reference argument contains text, logical values, or empty cells, those
values are ignored; however, cells with the value zero are included.
If Argument1 and Argument2 have a different number of data points, an error is
returned.
If either Argument1 or Argument2 is empty, or if the standard deviation of their
values equals zero, an error is returned.
Example
Your company keeps employee statistics including their overall satisfaction with their job
and role at the company, as well as their performance score. While these are both
important statistics, it can also be beneficial to know how closely related these two
statistics are. Knowing this information can help determine if an employees satisfaction
with their job is related to their performance.
A report including both the correlation and weighted correlation of these statistics,
displayed as percentages, is shown below for employees at the executive level:
Syntax
WeightedCov <FactID> (Argument1, Argument2, Weight)
Where:
Argument1 and Argument2 are attributes, facts, or metrics representing lists of
numbers for comparison. A covariance is calculated on these values to determine the
level of association between the two values.
Weight is an attribute, fact, or metric representing a list of numbers to define the
weight of each comparison.
FactID is a parameter that forces a calculation to take place on a fact table that
contains the selected fact.
Expression
= average value of x
= average value of y
Usage notes
The following are invalid conditions:
If an array or reference argument contains text, logical values, or empty cells, those
values are ignored; however, cells with the value zero are included.
If Argument1 and Argument2 have a different number of data points, an error is
returned.
If either Argument1 or Argument2 is empty, an error is returned.
Example
Your company keeps employee statistics including their overall satisfaction with their job
and role at the company, as well as their performance score. While these are both
important statistics, it can also be beneficial to know how closely related these two
statistics are. Knowing this information can help determine if an employees satisfaction
with their job is related to their performance.
A report including both the covariance and weighted covariance of these statistics, is
shown below for employees at the executive level:
have been with the company longer. For the executive level employees, factoring in
tenure results in a smaller relationship between satisfaction and performance. This type
of analysis can be crucial in determining how performance can be improved or
maintained both for new hires and long tenured employees.
WeightedMean
An average, also known as an arithmetic mean, is the sum of a set of values divided by
the number of values in the set.
A weighted mean allows you to apply a weight, or relative significance to each value
when determining an average. Values with a higher value for their weight are considered
as more significant when compared to the other values.
To calculate an average without applying a weight to the values, see Avg (average),
page 95.
Syntax
WeightedMean<FactID>(Argument1, Weight)
Where:
Argument1 is an attribute, fact, or metric representing a list of numbers that are
used to calculate an average.
Weight is an attribute, fact, or metric representing a list of numbers to define the
weight of each value.
FactID is a parameter that forces a calculation to take place on a fact table that
contains the selected fact.
Expression
Example
You can calculate a weighted mean to apply greater significance to certain values used to
determine an average. For example, you can use the percent growth of revenue as a way
to define revenue values as more or less significant for an average. The report shown
below contains the attribute Customer Region and the metrics Revenue, Percent Growth,
Average Revenue, and Weighted Mean Revenue. The report also includes the Year
attribute in the page-by to show results by year.
The expressions for the average and weighted mean calculations are as follows:
Average Revenue:
Avg(Revenue){Year}
Weighted Mean Revenue:
WeightedMean(Revenue, [Percent Growth]){Year}
The weighted mean takes into account the weights of each revenue value. For example,
since Centrals percent growth is greater than Northwests percent growth, and the
weight in this example is the percent growth, Centrals revenue is given more significance
in the weighted mean calculation. This results in $2,229,195 for the Weighted Mean
Revenue as compared to $2,122,695 for the Average Revenue for all customer regions for
the given year.
Notice that while the Average Revenue and Weighted Mean Revenue are applicable to a
year in this example, the values are displayed for every Customer Region row. One way to
simplify the display of this information is to include this data on a dashboard. You can
include the Average Revenue and Weighted Mean Revenue results in text fields along
with additional visualizations of the data, as shown below.
Where:
wi: The weight of the ith value. Values with a higher value for their weight are
considered as more significant to a sample as compared to the other values in a
sample.
N: The number of weights that are not equal to zero.
xw: The weighted mean of the values.
Usage notes
In this function, arguments correspond to a population sample as opposed to the
entire population. For entire populations, see StDevP (standard deviation of a
population), page 112.
Example
This example shows a report where the standard deviation and a weighted standard
deviation of the revenue are calculated. This calculation is based on the assumption that
the list of values supplied in the metric represents a sample of the data for which you
want to obtain the standard deviation. The calculation is based on the revenue values for
each state within a region and calculated at the region level.
The report contains the attributes Customer Region and Customer State, and the metrics
Revenue, Standard Deviation, and Weighted Standard Deviation.
The definition of the standard deviation metrics are as follows:
Standard Deviation:
StDev(Revenue){[Customer Region], ~}
Weighted Standard Deviation:
WeightedStDev(Revenue, Revenue) {[Customer Region] , ~
}
For this example, the revenue values are also used as the weights given to each
revenue value included in the standard deviation.
The report is shown below:
The weighted standard deviation also takes into account the weights of each revenue
value. For example, since Connecticuts revenue is greater than Maines revenue, and the
weight in this example is the revenue value, Connecticuts revenue is given more
significance in the weighted standard deviation calculation. This results in $957,689 for
the standard deviation as compared to $1,141,237 for the weighted standard deviation of
Northeast revenue.
Notice that while the standard deviation and weighted standard deviation are applicable
to a Customer Region in this example, the values are displayed for every Customer State
row. One way to simplify the display of this information is to include this data on a
dashboard. You can include the standard deviation and weighted standard deviation
results in text fields along with additional visualizations of the data, as shown below.
NTile
NTile functions are used to group the values in an ordered list into one of several buckets
or NTiles. For the NTile function, the buckets are calculated so that each bucket has
exactly the same number of rows assigned to it or at most one row more than the others
(the exception is that identical value rows are placed in the same bucket). For example, if
you have 100 rows in a partition and define an NTile function with four buckets, 25
rows will be assigned a value of 1, 25 rows will have value 2, and so on. These buckets are
referred to as equiheight buckets.
If the number of rows in the partition does not divide evenly into the number of buckets,
then, barring identical value rows, the number of rows assigned per bucket will differ by
one at most. The extra rows are added to buckets using the calculations ceiling(1*
(buckets/remainder)),...,
ceiling(remainder*(buckets/remainder)).
For example, if there are 103 distinct value rows in a partition which has an
NTile<Tiles=5>() function, the first 20 rows will be in the first bucket, the next 21
in the second bucket, the next 20 in the third bucket, the next 21 in the fourth bucket,
and the final 21 in the fifth bucket. The calculations ceiling(1*(5/3))=2, ceiling
(2*(5/3))=4, and ceiling(3*(5/3))=5 include one of the extra three rows each
in the second, fourth, and fifth buckets.
NTile distributes the values in the specified metric, sorted in either ascending or
descending order, over a user-defined number of buckets. Each bucket has an equal
number of elements (if possible). This is an OLAP function.
Syntax
NTile <Ascending, Tiles, BreakBy> (Argument)
Where:
Ascending is a TRUE/FALSE parameter that designates the organization of data
within the NTiles.
BreakBy is the parameter that sets the attribute determining where the calculation
restarts.
Tiles is a positive integer that designates the number of buckets or NTiles.
Argument is a metric representing a list of values to be distributed equally (if
possible) into n buckets.
Example
Example 1: If you define Tiles=4 for a metric that contains 20 values, the function
distributes the numbers as follows:
Values 1 through 5 in bucket 1
Values 6 through 10 in bucket 2
Values 11 through 15 in bucket 3
Values 16 through 20 in bucket 4
Example 2: This example shows a report where the customer states were sorted based on
revenue and then divided among a specified number of buckets. The number of buckets
is defined as 8. The report includes the attribute Customer State and the metrics Total
Revenue and NTile. The NTile metric is a derived one, the syntax for which is as follows:
NTile<Tiles=8>([Total Revenue])
The resulting report divides the 48 states into 8 NTiles, each containing 6 elements
(states). Within each band the data is sorted in ascending order by the attribute Customer
State. A portion of the report is displayed as follows.
NTileSize
NTileSize distributes the values in the specified metric, sorted in either ascending or
descending order, with the same number of elements in each bucket. The number of
elements in each bucket is user-defined. This is an OLAP function.
Syntax
NTileSize <Ascending, BreakBy> (Argument, Size)
Where:
Ascending is a TRUE/FALSE parameter that designates the organization of data
within the NTiles.
BreakBy is the parameter that sets the attribute determining where the calculation
restarts.
Argument is a metric representing a list of values to be distributed in buckets.
Size is a positive integer that designates the number of elements per bucket.
Example
Example 1: If you define the Size as 2, the function returns buckets containing two
values each. If there are six values, values one and two go in bucket 1, values three and
four go in bucket 2, and values five and six go in bucket 3.
Example 2: This example shows a report where the customer states are sorted by revenue
and then placed in buckets based on the number of elements that can fit in a bucket. The
number of elements per bucket size is defined as 8. The report includes the attribute
Customer State and the metrics Total Revenue and NTileSize. The syntax for the
NTileSize metric is as follows:
NTileSize ([Total Revenue],8)
The resulting report divides the 48 states into 6 buckets each containing 8 elements
(states). A portion of the resulting report displays as follows.
NTileValue
NTileValue distributes the values in the metric by value ranges over a user-defined
number of buckets, sorted in either ascending or descending order. Each bucket is the
same size in terms of the range of values contained in the bucket, but the number of
elements per bucket is not equal. This is an OLAP function.
Syntax
NTileValue <Ascending, Segments, BreakBy> (Argument)
Where:
Ascending is a TRUE/FALSE parameter that designates the organization of data
within the NTiles.
Segments is a positive integer designating the number of buckets in which the
values are distributed.
BreakBy is the parameter that sets the attribute determining where the calculation
restarts.
Argument is a metric representing a list of values to be distributed into buckets.
Example
Example 1: If you define the Segments=4, and the minimum value in the range is 5 and
the maximum is 105, the bucket distribution is as follows, where x is the value:
5 x < 30 in bucket 1
30 x < 55 in bucket 2
55 x < 80 in bucket 3
80 x 105 in bucket 4
Example 2: This example shows a report where the customer states are sorted based on
revenue and then placed in buckets based on the value range to which they belong. The
number of buckets (segments) is defined as 4. The range of values is divided by the
number of buckets and the result is used to define four value ranges into which all the
values fall. The report includes the attribute Customer State and the metrics Total
Revenue and NTileValue. The syntax for the NTileValue metric is as follows:
NTileValue<Segments=4>([Total Revenue])
The resulting report displays the 48 states distributed across 4 buckets. Notice that the
number of elements in each bucket is not equal as more values fall into one range than
another. A portion of the resulting report is displayed as follows.
Example 3: Histogram
The reports and components used in this example are available in the
MicroStrategy Tutorial under the following folder:
MicroStrategy Tutorial\Public Objects\Reports\MicroStrategy
Platform Capabilities\Advanced Analytics\Statistics and Fo
recasting\Histogram
Server. The metric using NTileValue is then used to create a dynamic classification of
Customers using a custom group.
To create a general solution that can be used by different users, use object prompts (see
instructions below).
Create the following object prompts:
Choose a base fact. This object prompt asks the user to select a fact: Revenue, Profit,
or Units Sold.
Choose a sample set level. This object prompt asks the user to select an attribute:
Customer, Item, or Day.
Once you have identified the basic fact and attribute to analyze, you can start building
other objects. Take the following steps:
1 Create a metric defined as follows:
4 Choose to show only individual items within this element since the objective is to
build a graph (histogram) for this custom group.
NTileValueSize
NTileValueSize distributes the values in the metric across buckets based on a user-
specified value range, sorted in either ascending or descending order. This is an OLAP
function.
Syntax
NTileValueSize <Ascending, BreakBy> (Argument, Size)
Where:
Ascending is a TRUE/FALSE parameter that designates the organization of data
within the NTiles.
BreakBy is the parameter that sets the attribute determining where the calculation
restarts.
Argument is a metric representing the list of values to be distributed across buckets.
Size is a real number designating the size of the range of values for each bucket.
Example
Example 1: If you define size as 1000 and your range of values begins at 1200, the first
bucket contains values 1200 through 2199, the second bucket contains values 2200
through 3199, and so on until every value is in a bucket. It does not matter how many
values are in each bucket; it only matters that their value is within the bucket range.
Example 2: This example shows a report where the customer states were sorted based
upon revenue and then placed in buckets based upon the value range to which they
belong. The value range is defined as 100,000. Beginning at the lowest metric value, in
this case 18,654, the first bucket contains values from 18,654 to 118,653, the next bucket
ranges from 118,654 to 218,653, and so on until all values are in buckets. The highest
value in the report is 1,839,238, which falls into bucket 19 and is the only value in that
range.
The report includes the attribute Customer State and the metrics Total Revenue and
NTileValueSize. The syntax for the NTileValueSize metric is as follows:
NTileValueSize ([Total Revenue], 100000)
A portion of the resulting report is displayed as follows.
Percentile
Returns the nth percentile of values in a given range. This function can be used to
establish thresholds indicating, for example, which states have revenue above the 75th
percentile for their region. This is a group-value function.
Syntax
Percentile <Ascending, FactID> (Argument, Percent)
Where:
Ascending is a TRUE/FALSE parameter that indicates the organization of the data.
Argument is an attribute, fact or metric representing a list of numbers.
Percent is the decimal value of the percent for which you want to use as a
threshold.
Example
Example 1: If you have an argument containing the values 1, 2, 3, and 4 and you want to
find the threshold of the 3oth percentile, the syntax is as follows:
Percentile ({1, 2, 3, 4}, 0.3) = 1.9
1.9 is the level of the 30th percentile. All values above 1.9 are greater than the 30th
percentile.
Example 2: This example shows a report where only states with Total Revenue greater
than the threshold for the 75th percentile in its region are displayed. The report contains
the attributes Customer Region and Customer State, and the metrics Total Revenue and
Percentile. A view filter is then applied to the report so that it only displays states where
Total Revenue is greater than Percentile.
The syntax for the Percentile metric is as follows:
Percentile([Total Revenue], .75){[Customer Region]}
PercentRank
This function is used to display the ranking of values as a percentage. For example you
can rank profit for a particular region based on the profit for all regions.
The calculation can restart based on attributes identified in the parameter settings. This
is an OLAP function.
You can also rank values in the following ways:
You use the Rank function (see Rank , page 220) to rank values as an integer value.
For example you can rank profit for five categories from 1 to 5.
You use the PercentRankRelative function (see PercentRankRelative, page
218) to rank values as a percentage, with the ranking based on another data set. For
example you can rank profit for the current year based on last years profit.
Syntax
PercentRank <inclusive, BreakBy> (Argument)
Where:
Argument is a fact or metric representing a list of numbers that are to be ranked.
inclusive is a TRUE/FALSE parameter that indicates whether the rank is inclusive
or exclusive:
TRUE (default): The percent rank is in a range from 0 to 1 inclusive. This means
that 0% and 100% are included.
FALSE: The percent ranks is in a range from 0 to 1 exclusive. This means that
0% and 100% are excluded.
BreakBy is the parameter that designates where the calculation should restart.
Example
The example report shown below displays revenue information across regions for a given
quarter. You can use PercentRank to return the rank of revenue for each region during a
given quarter.
The definition for the Percent Rank Revenue metric in this example is:
PercentRank<BreakBy={Quarter}>(Revenue)
The Percent Rank Revenue metric in the report shown above provides the rank of each
revenue value. You can see that the highest value in the Northeast region is displayed as
100% while the lowest value in the Northwest region is displayed as 0%.
PercentRankRelative
This function is used to display the ranking of values as a percentage, with the ranking
based on a secondary data set. For example you can rank the current years profit for a
particular region based on (relative to) the profit from the previous year.
The calculation can restart based on attributes identified in the parameter settings. This
is an OLAP function.
You can also rank values in the following ways:
The Rank function (see Rank , page 220) ranks values as an integer value. For
example, you can rank profit for five categories from 1 to 5.
Example
The example report shown below displays revenue information across regions for a given
quarter. You can use PercentRankRelative to return the rank of revenue for each
region during a given quarter, relative to last quarters revenue.
The definition for the Percent Rank Revenue metric in this example is:
PercentRankRelative<BreakBy={Quarter}>(Revenue, [Last
Quarters Revenue])
The Percent Rank Relative Revenue metric in the report shown above provides the rank
of each revenue value. The highest value in the Northeast region displays no data because
last quarters revenue is $797,627, which is greater than any revenue value for this
quarter and thus outside of the range of values. Since the default for the function is to
not rank outlier values, no data is displayed. If you modify the rankOutlier parameter to
be rankOutlier=TRUE, then data is returned for this ranking as shown in the report
below.
This report also includes a metric that uses the PercentRank function, ranking the
revenue based on its own values. For information on PercentRank and an explanation
of these results, see PercentRank , page 217.
Rank
This function is used to display the ranking of values in a list relative to the other values.
The calculation can restart based on attributes identified in the parameter settings. This
is an OLAP function.
Unless the defaults are changed, the function ranks the values in ascending order by the
value of the metric, and the rank is an integer.
Syntax
Rank <ASC, ByValue, BreakBy, NullInclude> (Argument)
Where:
Argument is a fact or metric representing a list numbers.
ASC is a TRUE/FALSE parameter that indicates the order of ranking (1 is the lowest
or highest value).
ByValue is a TRUE/FALSE parameter that indicates whether the ranking is done by
integer values (1, 2, 3, 4) or by percentage (10%, 50%, 75%, 100%).
BreakBy is the parameter that designates where the calculation should restart.
NullInclude is a parameter that determines how NULL values are included in the
rank calculation.
The NullInclude parameter only affects the rank of NULL values if the Rank
function is performed by the MicroStrategy Analytical Engine. The Rank function is
performed by the Analytical Engine for smart metrics, derived metrics, and other
metric scenarios. To determine whether the Rank function for a metric is performed
by the Analytical Engine, view the SQL statement for the report. If the metric is
listed in the Analytical Engine calculation steps, this verifies that the Rank function
is performed by the Analytical Engine.
If the Rank function is performed on a database, the NullInclude parameter is
ignored and NULL values are included in the rank calculation based on the database
standards.
For Rank functions that are performed by the Analytical Engine, you have the
following options for this parameter:
1: If you define NullInclude=1, NULL values are given a rank value equal to
the number of other rank values, plus one. For example, the rank of the Profit
metric in the report below ranks four separate profit values.
There is one NULL value, which is given the rank of 4. The Rank (Profit) metric
in this example uses an ascending rank. If you define the metric with a
descending rank, the other rank values change but the rank value for any NULL
values remains the same. This is shown in the report below.
-1: If you define NullInclude=-1, NULL values are given the rank value of
one. For example, the reports shown below both define the Rank (Profit) metric
with NullInclude=-1. The report on the left uses an ascending rank, while
the report on the right uses a descending rank.
As shown in the reports above, the NULL values for both reports are ranked
with the value of one.
0 (default): If you define NullInclude=0, NULL values are included in the
rank calculation based on the NULL value handling defined using the Null
checking for Analytical Engine VLDB property. For information on VLDB
properties, including steps to access and modify them for various MicroStrategy
objects, see the Supplemental Reference for System Administration :
If you define the Null checking for Analytical Engine property as True,
NULL values are treated as zero values in the rank calculation. For example,
the report shown below ranks the NULL values with a rank of two, because
zero is greater than -10 and less than 40.
If you define the Null checking for Analytical Engine property as False,
NULL values are treated as NULL values, which means NULL values are also
displayed for the rank values. For example, the report shown below displays
the NULL values as NULL in the rank.
Example
This example report displays customer states ranked by revenue within their regions.
There are two metrics, one that ranks by value (default) and the other that ranks using a
percentage. In order to have the state with the highest revenue in each region ranked as
1 in the Rank by Value metric, the Rank by Value ranking is descending. In order to have
the largest number ranked at 100% in the Rank by Percent metric, the ranking is
ascending (default).
The report includes the attributes Customer Region, Customer State, the metric Total
Revenue (defined as Sum(Revenue)), and the two ranking metrics. The syntax for the
metrics is as follows:
Rank by Value:
Rank<ASC=False,ByValue=True, BreakBy={[Customer Region]}>
([Total Revenue])
Rank by Percent:
Rank<ASC=True,ByValue=False BreakBy={[Customer Region]}>
([Total Revenue])
The resulting report is displayed as follows.
String functions
String functions perform various actions that modify the characters returned for a string
of characters. While string functions can be used to create metrics, a more common use
case for these functions is in the creation of attribute forms. For example, these
functions can aid in the creation of attribute forms by combining multiple columns of
information, capitalizing the first letter of a column, removing or returning select
characters of a column, and so on. For information on creating attributes and attribute
forms, see the Project Design Guide.
The MicroStrategy Analytical Engine does not calculate string functions; they are
processed by the database. For information on which string functions are supported for
your specific database, see Appendix A, MicroStrategy and Database Support for
Functions, and search in the section corresponding to your database. String functions for
which your database does not include SQL syntax support cannot be calculated in your
environment.
This section of the document includes information and examples on the data returned by
the function.
BeginsWith
Returns 1 if a text string begins with a specified text pattern. If the text string does not
begin with the pattern, the function returns 0.
For the definition and syntax of the Begins with comparison operator, see Begins
with, page 246.
Syntax
BeginsWith(String, Pattern)
Where:
String is the string that is being searched. You can use facts, metrics, columns, or
string values.
Pattern is the string that is being searched for at the beginning of the values from
String. You can use facts, metrics, columns, or string values.
The text pattern comparison may or may not be case sensitive depending on the
database implementation.
Example
BeginsWith(Region@DESC, "North")
Returns 1 for Regions that start with North, such as Northeast and Northwest.
For information on the syntax used in your specific database, see Appendix A,
MicroStrategy and Database Support for Functions and see the section that
corresponds to your database.
Example
Char(65)
This example returns A.
Concat (concatenate)
The Concat function combines two or more input strings into one continuous string
and returns the result. For example, concatenating the two strings Micro and
Strategy would result in the single string MicroStrategy. Concat is often used to
combine related values, such as a first and last name.
Syntax
Concat(Argument1, Argument2,..., ArgumentN)
Where:
Argument1,..., ArgumentN are facts, metrics, columns, or string values.
For information on the syntax used in your specific database, see Appendix A,
MicroStrategy and Database Support for Functions and see the section that
corresponds to your database.
Example
The Concat function can help to create attribute forms that are a combination of
multiple columns in database tables. For example, an LU_CUSTOMER table includes two
columns: CUST_FIRST_NAME and CUST_LAST_NAME. You can create a single attribute
form that combines these two columns as described below.
Concat([CUST_FIRST_NAME], [CUST_LAST_NAME])
The input from the first column is concatenated with the input from the second column,
to display information such as JohnDoe and JaneDoe for the attribute form.
For scenarios such as the one described above, you can use the ConcatBlank
function (see ConcatBlank (concatenate plus blank space), page 226 below) to
concatenate the strings and include a space between the two strings. This can
result in attribute forms that are easier to read. For example, rather than displaying
JohnDoe, the attribute form would display John Doe.
For an additional example of using the Concat function, see the example section for the
function InitCap (initial capitalization), page 227.
Example
The ConcatBlank function can help to create attribute forms that are a combination of
multiple columns in database tables. For example, an LU_CUSTOMER table includes two
columns: CUST_FIRST_NAME and CUST_LAST_NAME. You can create a single attribute
form that combines these two columns as described below.
ConcatBlank([CUST_FIRST_NAME], [CUST_LAST_NAME])
The input from the first column is concatenated with the input from the second column,
and an additional space is included between the two inputs. This displays information
such as John Doe and Jane Doe for the attribute form.
For an additional example of using the ConcatBlank function, see the example section
for the function InitCap (initial capitalization), page 227.
EndsWith
Returns 1 if a text string ends with a specified text pattern. If the text string does not end
with the pattern, the function returns 0.
For the definition and syntax of the Ends With comparison operator, see Ends
with, page 247.
Syntax
EndsWith(String, Pattern)
Where:
String is the string that is being searched. You can use facts, metrics, columns, or
string values.
Pattern is the string that is being searched for at the end of the values from
String. You can use facts, metrics, columns, or string values.
Example
EndsWith(Employee@[Last Name], "son")
Returns 1 for Employees with a last name that ends with son, such as Wilson, Johnson,
and so on.
To capitalize the first letter of every word in a string, see TitleCap (title
capitalization), page 237.
Syntax
InitCap(Argument)
Where:
Argument is a metric, column, or string value representing the text string.
For information on the syntax used in your specific database,see Appendix A,
MicroStrategy and Database Support for Functions and see the section that
corresponds to your database.
Example
The InitCap function can be used to fix capitalization errors for information that is
displayed for attribute forms. For example, an LU_CUSTOMER table includes two
columns: CUST_FIRST_NAME and CUST_LAST_NAME. To ensure that the first letter of
the last name is capitalized you create an attribute form with the following definition.
InitCap([CUST_LAST_NAME])
The input from the column is modified so that the first character is capitalized and all
other characters are lowercase. For example, if the column included information such as
jackson, sMITh, and Hughes, these would be displayed as Jackson, Smith, and Hughes
respectively.
Be aware that this function could potentially return undesired results in certain
scenarios. Using the scenario described above, consider the name McCoy. Using the
InitCap function, this would be displayed as Mccoy.
Another way to use this function would be to create an attribute form that combined the
first letter of someones first name with the persons full last name. The InitCap
function could be used to ensure that the first letter of the first name was capitalized. An
attribute form of this type would require the use of the functions InitCap,
ConcatBlank, Concat, and LeftStr. The definition of such an attribute form is
shown below:
ConcatBlank(Concat(LeftStr(InitCap([CUST_FIRST_NAME]),
1), "."), [CUST_LAST_NAME])
An attribute form using a definition such as the one listed above would display names
such as J. Doe, M. Smith, and L. Martinez. The InitCap function ensures that the first
letter of the first name is capitalized.
Where:
Argument is a metric, fact, column, or string representing the text string(s).
For information on the syntax used in your specific database, w33 Appendix A,
MicroStrategy and Database Support for Functions and see the section that
corresponds to your database.
Example
The Length function can be used in conjunction with other string functions to
manipulate strings in various ways. For example, rather than abbreviating information to
a specific number of characters, you can abbreviate each string to only display half of the
available characters. The definition of an attribute form that displays only half of the
characters available for the first names of customers is shown below:
LeftStr([CUST_FIRST_NAME], Int(Length([CUST_FIRST_NAME])
/ 2))
For first names such as Alan, Frederick, and Jennifer, the function shown above would
display Al, Fred, and Jenn, respectively. This provides an abbreviated version of
customers first names while providing additional characters to possibly distinguish each
abbreviated name.
In the function used in this example, the Int function is used to return only the
integer part of the calculation Length([CUST_FIRST_NAME]) / 2.
Depending on your databases support for functions, you could also use functions
such as Round, Ceiling, and Floor. For information on these types of
functions, see Mathematical functions, page 317.
create an attribute form to display all characters for a customers address in lower case.
The definition of such an attribute form is shown below:
Lower([ADDRESS])
An attribute form using a definition such as the one listed above would take input
addresses such as 10 Main Street, 350 West Elm Avenue, and 4400 Spring Road and
display them as 10 main street, 350 west elm avenue, and 4400 spring road, respectively.
Match
The Match function uses regular expressions to search a string for a pattern of
characters and returns any matches that are found.
Syntax
Match <Group=0,Instance=1>(Argument, Find)
Where:
Argument is a metric, fact, column, or string representing the text strings that are
searched for matches.
Find is a metric, fact, column, or string that provides a regular expression used to
searched the strings returned by Argument. The regular expressions supported by
this function conform to the standards of the International Components for
Unicode. For information about these regular expression standards and syntax, see
http://userguide.icu-project.org/strings/regexp.
Group is a parameter that determines which group within the regular expression is
returned. The groups in a regular expression are each set of characters enclosed by
parentheses () and are ordered left to right. By default, the Group parameter is
defined as 0 and the entire string that is matched is returned. If you define Group as
1, only the first group from the left of the regular expression is returned. If you
define Group to a value greater than the number of groups in the regular expression,
no results are returned. For example if there is one group but Group is defined as 2,
no results are returned.
Instance is a parameter that determines which instance of the matching results
are returned. By default, Instance is defined as 1 and the first match is returned. If
you define Instance to a value greater than the number of matching results, no
results are returned. For example if there are two matches but Instance is defined
as 3, no results are returned.
For information about the syntax used in your specific database, the Appendix A,
MicroStrategy and Database Support for Functions and see the section that
corresponds to your database.
Example
Consider the string of text "Telephone: 703-555-1234, Fax: 704-555-6789". You can
search for and return various parts of the telephone numbers in this string using regular
expressions. The regular expression (\d+)[-\b](\d+)[-\b](\d+) breaks up the
three sets of digits in a phone number into separate groups, which can be returned using
the Match function.
See http://userguide.icu-project.org/strings/regexp for information on the regular
expression standards and syntax.
For example:
Match("Telephone: 703-555-1234, Fax: 704-555-6789", "
(\d+)[-\b](\d+)[-\b](\d+)")
By default this returns the entire string that is the first match, which is 703-555-
1234.
Match<Group=1>("Telephone: 703-555-1234, Fax: 704-555-
6789", "(\d+)[-\b](\d+)[-\b](\d+)")
This returns the first group (the first search criteria in parentheses) from the first
occurrence, which is 703.
Match<Instance=2, Group=3>("Telephone: 703-555-1234,
Fax: 704-555-6789", "(\d+)[-\b](\d+)[-\b](\d+)")
This returns the third group (the third search criteria in parentheses) from the
second occurrence, which is 6789.
In addition to locating the position of a substring, Position also can be used to test
whether the substring is present. If a given substring is not found, 0 will be returned.
Syntax
Position (Argument1, Argument2)
Where:
Argument1 is the substring to search for.
Argument2 is the string in which to search for Argument1.
For information on the syntax used in your specific database, see Appendix A,
MicroStrategy and Database Support for Functions and see the section that
corresponds to your database.
Example
The Position function can be used in conjunction with other functions to perform
various manipulations on strings. For an example of how this function works, consider
an LU_CUSTOMER table that includes an ADDRESS column. You use the Position
function to find the word Street in the addresses as defined below.
Position("Street", [ADDRESS])
For an address of 10 Main Street, the function listed above returns the value of 9. For
addresses that do not include the word Street, a value of 0 would be returned.
Times is a metric, fact, column, or constant value that specifies how many times to
repeat the string of characters. A common practice is to type a constant value.
Example
RepeatStr("Hello ", 3)
This would return the string of characters "Hello Hello Hello ".
Replace
The Replace function searches a string for a pattern of characters and replaces each
instance of those characters with the new characters you specify. The resulting string
with all instances replaced is returned.
Syntax
Replace(Argument, Find, Replace)
Where:
Argument is a metric, fact, column, or string representing the text strings that are
searched.
Find is a metric, fact, column, or string representing the text strings that are
searched for within the strings returned by Argument.
Replace is a metric, fact, column, or string representing the text strings that are
used to replace any instances of the string from Find that are included in the strings
returned by Argument.
For information on the syntax used in your specific database, see Appendix A,
MicroStrategy and Database Support for Functions and see the section that
corresponds to your database.
For information on the syntax used in your specific database, see Appendix A,
MicroStrategy and Database Support for Functions and see the section that
corresponds to your database.
Example
An LU_CUSTOMER table includes a CREDIT_CARD_NUMBER column that contains credit
card numbers for online customers. You create attribute forms to display only the last
four digits of the customers credit card numbers. The definition of such an attribute
form is shown below:
RightStr([CREDIT_CARD_NUMBER], 4)
The integer value of 4 causes the RightStr function to only display the last four
characters from the CREDIT_CARD_NUMBER column.
You could also combine this functionality with the Concat function to display Xs or
other characters to represent the digits for the credit card that are not displayed.
Concat(XXXX-XXXX-XXXX-, RightStr([CREDIT_CARD_NUMBER],
4))
This definition would modify the display of a credit card number from 1111-2222-3333-
4444 to be displayed as XXXX-XXXX-XXXX-4444.
Any trailing blank spaces included in the addresses are removed from the display for the
attribute form.
To remove both leading and trailing blank spaces, use the Trim function (Trim, page
239).
Split
The Split function searches a string, separates the contents into groups of characters
based on a delimiter, and returns the string of characters requested. For example, you
can search a string of characters that separates values with commas, and return the
characters after the first comma. Searching the string "red, yellow, green" and selecting
to return the second set of characters based on a comma as the delimiter returns "yellow
".
Syntax
Split<SeparatorRegex=False>(String, Delimiter, Index)
Where:
String is a metric, fact, column, or string representing the text strings that are
searched.
Delimiter is a metric, fact, column, or string that determines the characters used
to separate each concatenated value. A common practice is to provide a constant text
value for the delimiter. Typing , uses a comma as the delimiter.
You can also choose to use regular expressions to define the delimiter characters. For
information on supporting regular expressions, see the SeparatorRegex
parameter described below.
If the delimiter character is not found in the string of characters, one of two
resolutions can occur:
If you define Index as 1, then the entire string of characters is returned.
If you define Index as any value other than 1, a NULL value is returned.
Index is a metric, fact, column, or constant value that determines which group of
characters are returned. A common practice is to provide a constant numerical value.
For example, using a value of 1 returns the first group of characters before the first
delimiter characters are found in the string.
SeparatatorRegex is a parameter that determines if a regular expression is used
to provide the delimiter characters. The regular expressions supported by this
function conform to the standards of the Intern a ion al Components for Unicode.
For information about these regular expression standards and syntax, see
http://userguide.icu-project.org/strings/regexp.
Example
Split<SeparatorRegex=True>("red yellow green", "\s", 2)
This returns the string of characters "yellow". By using the regular expression \s,
any white space character is considered a delimiter. This splits the string into the
strings "red", "yellow", and "green".
Split("red; yellow; green", ";" 1)
This returns the string of characters "red".
Split("red; yellow; green", ";" 3)
This returns the string of characters " green".
Split("red; yellow; green", ";" 4)
This returns a NULL value, since the string is only split into three separate strings.
lower case. This can help to fix capitalization errors in information that is displayed for
attribute forms, metrics, and other objects.
A word in a string is any string of alphabetic characters that are separated by a non-
alphabetic character such as a space, comma, or number.
To capitalize only the first letter of the first word in a string, see InitCap (initial
capitalization), page 227.
Syntax
TitleCap(Argument)
Where:
Argument is a metric, column, or string value representing the text string.
For information on the syntax used in your specific database, see Appendix A,
MicroStrategy and Database Support for Functions and see the section that
corresponds to your database.
Example
TitleCap(john smith)
This example would return John Smith.
TitleCap(john SMITH)
This example would also return John Smith.
Trim
The Trim function returns a string in which blank spaces on either side of the input
string have been removed. For example, using the Trim function on the string
MicroStrategy would return the string MicroStrategy.
The Trim function helps to remove leading and trailing blank spaces, which may have
been caused by errors in data entry. Removing these spaces helps standardize the display
of information and makes the information more readable.
Syntax
Trim(Argument)
Where:
Argument is a metric, fact, column, or string representing the text string(s).
For information on the syntax used in your specific database, see Appendix A,
MicroStrategy and Database Support for Functions and see the section that
corresponds to your database.
Example
An LU_CUSTOMER table includes an ADDRESS column. You can create an attribute form
to remove any leading and trailing blank spaces from the addresses. The definition of
such an attribute form is shown below:
Trim([ADDRESS])
Any leading or trailing blank spaces included in the addresses are removed from the
display for the attribute form.
Operators may not be available for direct selection when creating MicroStrategy
objects such as metrics. These operators are employed to support the logic of
metrics, filters, thresholds, and so on.
Arithmetic operators
The arithmetic operators are basic mathematical functions, such as Minus, Times,
Divide, Plus, and Unary Minus, which are among the most commonly used operators. A
brief description of each operator follows.
Minus (-)
Returns the difference between two values.
Syntax
Arg1 - Arg2
Where:
Arg1 and Arg2 are attributes, facts, metrics representing a list of numbers, big decimals,
date/time, or functions that return numbers or big decimals. Both Arg1 and Arg2 must
be of the same data type, with the exception if Arg1 is a Date data type. In this case,
Arg2 must be a number.
Example
Times (*)
Returns the product of two values.
Syntax
Arg1 * Arg2
Where:
Arg1 and Arg2 are attributes, facts, metrics representing a list of numbers or big
decimals, or functions that return numbers or big decimals.
Example
A metric is defined as:
([Unit Profit] * [Units Sold])
This metric returns the product of the unit profit and the units sold values.
Divide (/)
Returns the quotient when one value is divided by another.
Syntax
Arg1 / Arg2
Where:
Arg1 and Arg2 are attributes, facts, metrics representing a list of numbers or big
decimals, or functions that return numbers or big decimals. In addition, Arg2 must not
be zero.
Example
A metric is defined as:
(Profit / [Units Sold])
This metric returns the quotient of the profit and number of units sold.
Plus (+)
Returns the sum of two values.
Syntax
Arg1 + Arg2
Where:
Arg1 and Arg2 are attributes, facts, metrics representing a list of numbers or big
decimals, or functions that return numbers and big decimals. In addition, if either of the
two arguments is date/time, the other argument must be a number.
Example
A metric is defined as:
Cost + Freight
This metric returns the sum of the cost and the freight charges.
Comparison operators
These operators are used to compare values, which can be numbers, text strings, date
and time, expressions, or operators that return any values of the mentioned data types. A
brief description of each operator follows. The comparison patterns of text strings may
or may not be case-sensitive depending on the database implementation.
Arg1 and Arg2 are attributes, facts, metrics representing a list of numbers, text strings,
date/time, or functions that return literal values. Arg1 and Arg2 must be of the same
data type.
Example
A condition is defined as:
Profit < Cost
This condition returns TRUE only if the profit is less than the cost.
Equal (=)
Returns TRUE if the two given values are equal to each other.
Syntax
Arg1 = Arg2
Where:
Arg1 and Arg2 are attributes, facts, metrics representing a list of numbers, text strings,
date/time, or functions that return literal values. Arg1 and Arg2 must be of the same
data type.
Example
A condition is defined as:
Profit = Cost
This condition returns TRUE if the profit is equal to the cost.
Greater (>)
Returns TRUE if the first value is greater than the second value.
Syntax
Arg1 > Arg2
Where:
Arg1 and Arg2 are attributes, facts, metrics representing a list of numbers, text strings,
date/time, or functions that return literal values. Arg1 and Arg2 must be of the same
data type.
Example
A condition is defined as:
Profit > Cost
This condition returns TRUE only if the profit is greater than the cost.
Arg1 and Arg2 are attributes, facts, metrics representing a list of numbers, text strings,
date/time, or functions that return literal values. Arg1 and Arg2 must be of the same
data type.
Example
A condition is defined as:
Profit >= Cost
This condition returns TRUE only if the profit is greater than or equal to the cost.
Begins with
Returns TRUE if a text string begins with a specified text pattern.
For the definition and syntax of the BeginsWith string function, which can be used
to create attribute forms, see BeginsWith, page 224.
Syntax
Arg1 Begins With Arg2
Where:
Arg1 and Arg2 are text strings.
The text pattern comparison may or may not be case sensitive depending on the
database implementation.
Example
Region@DESC Begins with "North"
Returns TRUE for Regions that start with North, such as Northeast and Northwest.
Between
Returns TRUE if the specified value is between the inclusive range of two boundaries.
Between can be used to test if a value is within a valid data range.
Syntax
Value Between Boundary1 and Boundary2
Where:
Value, Boundary1, and Boundary2 can be numbers, date/time, text, or functions
that return the mentioned data types. Value, Boundary1 and Boundary2 must be
of the same data type.
Example
M1 Between 1 and 1000
region@DESC Between "A" and "Z"
Contains
Returns TRUE if a text string contains a specified text pattern.
Syntax
Arg1 Contains Arg2
Where:
Arg1 and Arg2 must be of data type Text.
Example
Employee@[Last Name] Contains "Smith"
Returns TRUE for Employees with a last name such as Smith, Smithson, and so on.
Ends with
Returns TRUE if a text string ends with a specified text pattern.
For the definition and syntax of the EndsWith string function, which can be used
to create attribute forms, see EndsWith, page 227.
Syntax
Arg1 Ends With Arg2
Where:
Arg1 and Arg2 must be of data type Text.
Example
Employee@[Last Name] Ends with "son"
Returns TRUE for Employees with a last name that ends with son, such as Wilson,
Johnson, and so on.
In
Returns TRUE if a value is contained in a specified list of values.
Syntax
Arg1 In Arg2
Where:
Arg2 is a list of the literals with the same data type as Arg1. It can be of the data type
numbers, big decimals, text, date/time, or functions that return these data types.
Examples
Like
Returns TRUE if a text string matches a specified text pattern; otherwise, returns FALSE.
Depending on whether you use wildcards and how they are used in the text in the
pattern, Like can be used in place of Begins With, Ends With, Contains, or =.
This operator is used to search for related strings.
Syntax
Arg1 Like Arg2
Where:
Arg1 and Arg2 must be of data type Text.
Usage notes
Using wildcards with the Like operator allows you to search for more than just a static
set of text. For example, rather than searching for the exact text pattern South, you can
use wildcards to search for any text pattern that includes South, such as Mid Southern,
SouthEast, and South.
The Like operator can be processed by the MicroStrategy Analytical Engine, or it can be
passed to the database to be processed using the databases own comparison support. You
can determine if the Like operator was processed by the MicroStrategy Analytical
Engine or passed to the database by viewing the SQL view of a report. If the Like
operator is included in the SQL of the report, the database performed the comparison.
By contrast, if the Like operator is not included in the SQL of the report, or the Like
operator is part of retrieving results from an Intelligent Cube (see the In-memory
Analytics Guide for reporting on Intelligent Cubes), then the MicroStrategy Analytical
Engine processed the Like operator. Wildcard support depends on how the Like
operator is processed:
If the MicroStrategy Analytical Engine processes the Like operator, the following
wildcard characters are supported:
The % character can be used to represent any number of characters. For
example, using the comparison Like 'Sout%' returns TRUE for South,
SouthEast, and Southern.
The _ character can be used to represent a single character. For example, using
the comparison Like 'Sout_' returns TRUE for South but returns FALSE for
SouthEast and Southern.
The / character can be used as an escape character for the %, _, or / characters,
which means it can be used prior to these wildcard characters to search for the
character rather than to use it as a wildcard. To search for the characters %, _, or
/, you must include a single / character before the character you are searching
for. For example, to search for the exact text User_ID, you would need to use
the comparison Like 'User/_ID'.
Not between
Returns TRUE if a specified value does not lie in between two given boundaries.
Syntax
Value Not Between Boundary1 and Boundary2
Where:
Value, Boundary1, and Boundary2 must be of the same data type. They can be of
any data type that MicroStrategy supports.
Example
Year not between 2000 and 2005
Returns TRUE if Year = 1999
Not contains
Returns TRUE if a text string does not contain the specified text pattern.
Syntax
Arg1 Not Contains Arg2
Where:
Arg1 and Arg2 must be of Text data type.
Example
Region@DESC Not Contains "South"
Returns TRUE if region is North, West, and so on.
Not in
Returns TRUE if a given value is not in the specified list of values.
Syntax
Arg1 not in Arg2
Where:
Arg2 must be a list with one or more elements. Arg1 must be of the same data type as
the elements in Arg2. Arg1 and Arg2 can be of any data type that MicroStrategy
supports.
Example
Year not in (2002, 2003)
Returns TRUE if year is 2000, 2001, and so on.
Not like
Returns TRUE if a text string does not match the specified text pattern; otherwise,
returns FALSE.
Syntax
Arg1 Not Like Arg2
Where:
Arg1 and Arg2 must be of data type Text.
Example
Region@DESC not like South%
Returns TRUE if region is Northeast, North, Mid South, and so on.
Metric: M1
Function: Rank
Operator: *Not between
Value: 2 and
Value: 8
Return TRUE for the values of M1 whose rank values are less than 2 or greater than 8.
Logical operators
The logical operators allow certain conditions to be applied to two sets of filter
expressions simultaneously.
And
Returns TRUE if both the specified conditions are TRUE; otherwise, returns FALSE.
Syntax
Arg1 And Arg2
Where:
Arg1 and Arg2 are conditional expressions. The condition can contain metrics,
comparison and logical operations, functions, and constants. The condition must be
evaluated as TRUE or FALSE.
Example
A condition is defined as:
(Cost < 1000) And (Freight < 500)
This condition will return TRUE only if both, the Cost is less than 1000, and the Freight
is less than 500.
IF
Returns a value if the specified condition is TRUE; otherwise, a default value is returned.
This is a single value function.
Syntax
IF (Condition, TrueBranch, FalseBranch)
Where:
Condition is the conditional expression. The condition can contain metrics,
comparison and logical operations, and constants. The condition must be evaluated
to be TRUE or FALSE.
Not
Returns TRUE if the specified condition is FALSE, and FALSE if the condition is TRUE.
Syntax
Not(Arg1)
Where:
Arg1 is the conditional expression. The condition can contain metrics, comparison and
logical operations, and constants. The condition must be evaluated as TRUE or FALSE.
Example
A condition is defined as:
Not ((Profit <= 0))
This condition returns TRUE only if the profit is greater than zero.
Or
Returns FALSE if both the specified conditions are FALSE; else returns TRUE.
Syntax
Arg1 Or Arg2
Where:
Arg1 and Arg2 are conditional expressions. The condition can contain metrics,
comparison and logical operations, and constants. The condition must be evaluated as
TRUE or FALSE.
Example
A condition is defined as:
(Cost <= 1000) Or (Freight <= 500)
This condition returns FALSE only if the Cost is greater than 1000, and the Freight is
greater than 500.
For the functions listed below, scalars are variables with a single value while
vectors are variables with one or more values.
RScript: Supports R scripts that use vectors for the inputs and output. Sorting is
also supported.
RScriptAgg: Supports R scripts that use vectors for the inputs and a scalar output.
Sorting is also supported.
RScriptAggU: Supports R scripts that use vectors for the inputs and a scalar
output. This is a version of the RScriptAgg function that does not include sorting.
RScriptSimple: Supports R scripts that use scalar for the inputs and output.
Sorting is not supported.
RScriptU: Supports R scripts that use vectors for the inputs and output. This is a
version of the RScript function that does not include sorting.
The easiest way to create a metric expression that utilizes these functions
A metric expression that can then be used in a derived metric to include the statistical
analysis of an R script on a dashboard in Analytics Desktop. The R Integration Pack
User Guide provides steps to use the deployR utility to create metric expressions for R
scripts.
When defining these functions in MicroStrategy Analytics Desktop, you have the
following options:
Value1, ..., ValueN: The MicroStrategy metrics that act as inputs for the R
script.
BooleanParam1, ..., BooleanParam9: A set of boolean parameters that
allow you to pass boolean values into R scalar values that do not change from
execution to execution. If you use any boolean parameters in your R script, you can
define the default value for the parameter when using the function in Analytics
Desktop.
NumericParam1, ..., NumericParam9: A set of numeric parameters that
allow you to pass numeric values into R scalar values that do not change from
execution to execution. If you use any numeric parameters in your R script, you can
define the default value for the parameter when using the function in Analytics
Desktop.
StringParam1, ..., StringParam9: A set of string parameters that allow you
to pass numeric values into R scalar values that do not change from execution to
execution. If you use any string parameters in your R script, you can define the
default value for the parameter when using the function in Analytics Desktop.
_WorkingDir: The R scripts working directory, which is used to store various
supporting files.
_OutputVar: The R variable that is used as the output for the metric. If there is
more than one output, the first output is considered the default output unless
otherwise specified here.
_NullsAllowed: Controls whether records containing null values are to be passed
in as inputs to your analytic:
True (default): Null values are included in the analysis.
False: All records containing null values are eliminated from the analysis.
Financial functions
The financial functions plug-in package in MicroStrategy provides access to many
standard financial calculations. All finance-related calculations are performed by the
MicroStrategy Analytical Engine, regardless of the database environment.
Par is a parameter that indicates the par value. The default, and only valid value is
1000.
Frequency is the number of coupon payments per year. The valid values are, 1, 2,
and 4 where annual payments =1, semiannual payments =2, and quarterly payments
=4.
Basis is a parameter that indicates the time-count basis to be used. The default
value for Basis is 0, which is typically used by American agencies and assumes 30-
day months and 360-day years (30/360). Possible values for this parameter are listed
in the following table.
2 (actual/360) Assumes actual number of days in each month, 360 days in each year.
3 (actual/365) Assumes actual number of days in each month, 365 days in each year.
4 (30/360) Used by European agencies, assumes the same values as 0 for American
institutions.
Expression
Where:
Ai is the number of accrued days for the ith quasi-coupon period within an odd
period
NC is the number of quasi-coupon periods that fit an odd period (if this period
contains a fraction, that fraction is rounded up to the nearest integer)
NLi is the normal length, in days, of the ith quasi-coupon period within an odd
period
Usage notes
If Issue, FirstInterest, Settlement, or Frequency is not an integer, it is truncated
The engine returns an empty cell if:
Issue, FirstInterest, or Settlement is not a valid date
Par 1000
Issue Settlement
Where:
Ai is the number of accrued days for the ith quasi-coupon period within an odd
period
NC is the number of quasi-coupon periods that fit an odd period (if this period
contains a fraction, that fraction is rounded up to the nearest integer)
NLi is the normal length, in days, of the ith quasi-coupon period within an odd
period
Usage notes
If Issue, FirstInterest, Settlement, or Frequency is not an integer, it is truncated
The engine returns an empty cell if:
Issue, FirstInterest, or Settlement is not a valid date
Par 1000
Issue Settlement
Frequency is a value other than 1, 2, or 4
The Issue date, the FirstInterest date and the Settlement date should be included
within single quotations in the expression for the expression to be considered as a
valid expression
Example
This example displays the expression built using Accrint for a treasury bond with the
following terms:
March 22, 2003, issue date
June 20, 2003, first interest date
September 16, 2003, settlement date
10.0 percent coupon
$1,000 par value
Frequency is semiannual
Basis is 30/360
The accrued interest is defined as:
Accrint <Par=1000, Basis=0>
(3/22/2003,9/16/2003,6/20/2003,0.1,2) {~+}
Expression
Where:
A is the accrued time (for interest-at-maturity items, the value used is the number of
days from issue to maturity)
D is the annual-yield basis
Usage notes
If Issue or Maturity is not an integer, it is truncated.
The engine returns an empty cell if
Issue or Maturity is not a valid date
Rate0
Par 1000
The Issue date and the Maturity date should be included within single quotations in
the expression for the expression to be considered as a valid expression.
Example
This example displays the expression built using the Accrintm function for a note with
the following terms:
March 22, 2001, issue date
June 20, 2003, maturity date
10.0 percent coupon
$1,000 par value
Frequency is semiannual
Basis is Actual/365
The accrued interest at maturity is defined as:
Where:
A is the accrued time (for interest-at-maturity items, the value used is the number of
days from issue to maturity)
D is the annual-yield basis
Usage notes
If Issue or Maturity is not an integer, it is truncated.
The engine returns an empty cell if
Issue or Maturity is not a valid date
Rate 0
Par 1000
The Issue date and the Maturity date should be included within single quotations in
the expression for the expression to be considered as a valid expression.
Example
This example displays the expression built using the Accrintm function for a note with
the following terms:
March 22, 2001, issue date
June 20, 2003, maturity date
10.0 percent coupon
$1,000 par value
Frequency is semiannual
Basis is Actual/365
The accrued interest at maturity is defined as:
Accrintm <Par=1000, Basis=3>
(3/22/2001,6/20/2001,0.1){~+}
Usage notes
If an argument is not an integer, it is truncated.
The Settlement date and the Maturity date should be included within single
quotations in the expression for the expression to be considered as a valid expression.
Usage notes
If an argument is not an integer, it is truncated.
The Settlement date and the Maturity date should be included within single
quotations in the expression for the expression to be considered as a valid expression.
Settlement is the settlement date. This is the date, after issue, on which the
security is traded.
Maturityis the maturity date. This is the date on which the security expires.
Frequency is the number of coupon payments per year. The valid values are 1, 2,
and 4 where annual payments =1, semiannual payments =2, and quarterly payments
=4.
Basis is a parameter that indicates the time-count basis to be used. The default
value for Basis is 0, which is typically used by American agencies and assumes 30-
day months and 360-day years (30/360). Possible values for this parameter are listed
in the following table.
1 Assumes actual number of days in each month, actual number of days in each
(actual/actual) year.
2 (actual/360) Assumes actual number of days in each month, 360 days in each year.
3 (actual/365) Assumes actual number of days in each month, 365 days in each year.
4 (30/360) Used by European agencies, assumes the same values as 0 for American
institutions.
Usage notes
The number of days between milestones is computed depending on the chosen day
basis
Coupon functions are defined against the maturity day, depending on frequency
The Settlement date and the Maturity date should be included within single
quotations in the expression for the expression to be considered as a valid expression
Usage notes
The number of days between milestones is computed depending on the chosen day
basis
Coupon functions are defined against the maturity day, depending on frequency
The Settlement date and the Maturity date should be included within single
quotations in the expression for the expression to be considered as a valid expression
Usage notes
If an argument is not an integer, it is truncated.
The engine returns an empty cell if
Settlement or Maturity is not a valid date.
Frequency is a number other than 1, 2, or 4.
Settlement Maturity.
The Settlement date and the Maturity date should be included within single
quotations in the expression for the expression to be considered as a valid expression.
Usage notes
If an argument is not an integer, it is truncated.
The engine returns an empty cell if
Settlement or Maturity is not a valid date.
Frequency is a number other than 1, 2, or 4.
Settlement Maturity.
The Settlement date and the Maturity date should be included within single
quotations in the expression for the expression to be considered as a valid expression.
Usage notes
If an argument is not an integer, it is truncated.
The engine returns an empty cell if:
Settlement or Maturityis not a valid date.
Frequencyis a number other than 1, 2, or 4.
Settlement Maturity.
The Settlement date and the Maturity date should be included within single
quotations in the expression for the expression to be considered as a valid expression.
Usage notes
Usage notes
The number of days between milestones is computed depending on the chosen day
basis.
Coupon functions are defined against the maturity day, depending on frequency.
The Settlement date and the Maturity date should be included within single
quotations in the expression for the expression to be considered as a valid expression.
Usage notes
The number of days between milestones is computed depending on the chosen day
basis.
Coupon functions are defined against the maturity day, depending on frequency.
The Settlement date and the Maturity date should be included within single
quotations in the expression for the expression to be considered as a valid expression.
Usage notes
For annual payments on a four-year loan at an annual interest rate of 12%, Rate
= 12%; Nper = 4.
If Nper, Start, End, or Type is not an integer, it is truncated.
The engine returns an empty cell if
Rate 0, Nper 0, or Pv 0
Start< 1 or End < 1
Start > End
Type 0
Example
A home mortgage loan has the following terms:
Interest rate: 9.00 percent per annum (rate = 9.00% 12 = 0.0075)
Term: 30 years (nper = 30 12 = 360)
Present value: $125,000
The total principal paid in the second year of payments (periods 13 through 24) is defined
as follows:
CUMPRINC(0.0075,360,125000,13,24) equals -934.1071
The principal paid in a single payment in the first month is defined as follows:
CUMPRINC(0.0075,360,125000,1,1) equals -68.27827
Where:
Usage notes
All arguments must be positive values.
The double-declining balance method computes depreciation at an accelerated rate:
depreciation is highest during the first period and decreases with each succeeding
period.
Syntax
Disc <Basis> (Settlement, Maturity, Price, Redemption)
Where:
Settlement is the settlement date. This is the date, after issue, on which the
security is traded.
Maturity is the maturity date. This is the date on which the security expires.
Price is the price per $100 of face value.
Redemption is the redemption value per $100 of face value.
Basis is a parameter that indicates the time-count basis to be used. The default
value for Basis is 0, which is typically used by American agencies and assumes 30-
day months and 360-day years (30/360). Possible values for this parameter are listed
in the following table.
4 (30/60) Used by European agencies, assumes the same values as 0 for American
institutions.
Expression
Where:
Bis the number of days in a year (see Basis)
DSM is the number of days between settlement and maturity
Usage notes
If Settlement or Maturity is not an integer, it is truncated.
The engine returns an empty cell if
Settlement or Maturity is not a valid date.
Price 0 or Redemption 0.
Settlement Maturity.
The Settlement date and the Maturity date should be included within single
quotations in the expression for the expression to be considered as a valid expression.
Expression
Where:
B is the number of days in a year (see Basis)
DSM is the number of days between settlement and maturity
Usage notes
If Settlement or Maturity is not an integer, it is truncated.
The engine returns an empty cell if
Settlement or Maturity is not a valid date.
Price 0 or Redemption 0.
Settlement Maturity.
The Settlement date and the Maturity date should be included within single
quotations in the expression for the expression to be considered as a valid expression.
Where:
price is the dollar value to be converted
fraction is the fraction denominator value as an integer
Duration
Returns the Macauley duration for an assumed par value of $100. Duration is the
weighted average of the present value of the cash flows and is used as a measure of a
bond prices response to changes in yield. Bonds with higher durations face higher risk
from changes in interest rates.
Syntax
Duration <Basis> (Settlement, Maturity, CouponRate,
YieldRate, Frequency)
Where:
Settlement is the settlement date. This is the date, after issue, on which the
security is traded.
Maturity is the maturity date. This is the date on which the security expires.
CouponRate is the annual interest rate of the coupon.
YieldRateis the annual yield.
Frequency is the number of coupon payments per year. The valid values are 1, 2,
and 4 where annual payments =1, semiannual payments =2, and quarterly payments
=4.
Basis is a parameter that indicates the time-count basis to be used. The default
value for Basis is 0, which is typically used by American agencies and assumes 30-
day months and 360-day years (30/360). Possible values for this parameter are listed
in the following table.
Expression
Where:
DSC is the number of days from settlement to next coupon date
E is the number of days in settlements coupon period
N is the number of coupons from settlement to maturity
Usage notes
The Settlement date and the Maturity date should be included within single quotations in
the expression for the expression to be considered as a valid expression.
Usage notes
If Npery is not an integer, it is truncated.
The engine returns an empty cell if
Either argument is nonnumeric.
NominalRate 0.
Npery <= 1.
Fv (future value)
Returns the future value of an investment based on periodic, constant payments and a
constant interest rate. The future value is equal to the present value plus the amount of
accumulated interest that would be earned. This can be applied to future payments, with
interest calculated for each payment.
Syntax
Fv <Type> (Rate, Nper, Pmt, Pv)
Where:
Rate is the interest rate per period.
Nper is the total number of payment periods.
Pmt is the (fixed) amount paid each period. This typically includes principal and
interest, but no other fees or taxes.
Pv is the present value (lump-sum amount) of future payments. If no value is
provided, it is assumed to be 0 (zero).
Type is a parameter that indicates when payments are due.
Usage notes
In all cases, disbursements, such as deposits, are represented by negative numbers;
funds received, such as dividends, are represented by positive numbers.
Use the Fvschedule function for payments made with a variable or adjustable interest
rate.
Usage notes
If Argument is nonnumeric, the engine returns an empty cell.
Use the Fv function for payments made with a constant interest rate.
Usage notes
If Argument is nonnumeric, the engine returns an empty cell.
Use the Fv function for payments made with a constant interest rate.
Expression
Where:
Redemption is the amount actually received for the security
Investment is the amount invested in the security
B is the number of days in a year, depending on year basis
DIM is the number of days from settlement to maturity
Usage notes
The Settlement date and the Maturity date should be included within single quotations in
the expression for the expression to be considered as a valid expression.
Expression
Where:
Redemption is the amount actually received for the security
Investment is the amount invested in the security
B is the number of days in a year, depending on year basis
DIM is the number of days from settlement to maturity
Usage notes
The Settlement date and the Maturity date should be included within single quotations in
the expression for the expression to be considered as a valid expression.
FactID is a parameter that forces a calculation to take place on a fact table that
contains the selected fact.
Guess is a parameter that indicates an estimate assumed to be close to the result
sought. The default value is 0.1, which can be thought of as representing an
expected internal rate of return of 10 percent.
Method is a parameter that determines the algorithm used to calculate the IRR
function. You can use the following values:
0 (default): The IRR function uses the secant method to determine the internal
rate of return. This is the recommended method as it can adjust the initial guess
as required to return a result.
1: The IRR function uses Newtons method to determine the internal rate of
return. This method can return results similar to those returned for internal rate
of return functions that are supplied with Microsoft Excel.
Precision is a parameter that determines how close the evaluation of a potential
solution must be to zero to be considered valid.
Argument is a fact or metric representing a list of numbers for which the internal
rate of return is sought.
SortBy is a parameter that defines the order of calculation. For more information
see BreakBy and SortBy parameters, page 33.
Usage notes
The list of values must contain at least one positive entry and one negative entry.
Payments, whether positive or negative, must be entered in the desired sequence, as
this is the order in which entries are interpreted for calculation.
Frequency is the number of coupon payments per year. The valid values are 1, 2,
and 4 where annual payments =1, semiannual payments =2, and quarterly payments
=4.
Basis is a parameter that indicates the time-count basis used. The default value for
Basis is 0, which is typically used by American agencies and assumes 30-day
months and 360-day years (30/360). Possible values for this parameter are listed in
the following table.
4 (30/60) Used by European agencies, assumes the same values as 0 for American
institutions.
Expression
Where:
yld is the security annual yield
frequency is the number of coupon payments per year
Usage notes
If Settlement, Maturity, or Frequency is not an integer, it is truncated.
The engine returns an empty cell if:
Either Settlement or Maturity is not a valid date.
CouponRate < 0.
YieldRate < 0.
Frequency is a number other than 1, 2, or 4.
Settlement Maturity.
The Settlement date and the Maturity date should be included within single
quotations in the expression for the expression to be considered as a valid expression.
Usage notes
If Argument does not contain at least one positive entry (income) and one negative
entry (payments), the engine returns an empty cell.
In calculating the return for this function, the order in which entries are provided is
assumed to be the order in which funds flow; it is important, therefore, that
payments and income be entered in the correct sequence.
Usage notes
If Npery is not an integer, it is truncated.
The engine returns an empty cell if
Either argument is nonnumeric.
EffectiveRate 0.
Npery < 1.
Where:
FactID is a parameter that forces a calculation to take place on a fact table that
contains the selected fact.
SortBy is a parameter that defines the order of calculation. For more information
see BreakBy and SortBy parameters, page 33.
Argument is a fact or metric representing a list of values containing either payment
or income figures.
Rateis the discount rate for the length of a period.
Expression
Where:
nis the number ofentries in Values.
Usage notes
All entries in Values must be equally spaced in time, and occur at the end of each
period.
The order of the entries in Values is assumed to be the order in which funds flow;
payment and income entries must, therefore, be provided in the correct sequence.
Investment begins one period before the date on which the first entry in Values
occurs, and ends with the last entry in that array.
If the first entry in Values occurs at the beginning of a period, it must be added to
the result of the function.
The primary differences between this function and the Present Value (PV) function
are that
PV allows fund flow to occur either at the beginning or at the end of a period.
PV fund-flow occurrences must be constant across the life of the investment.
Where:
Settlement is the settlement date. This is the date, after issue, on which the
security is traded.
Maturity is the date of maturity. This is the date on which the security expires.
Issue is the issue date.
FirstCoupon is the first-coupon date.
CouponRate is the annual interest rate of the coupon.
YieldRate is the annual yield.
Redemption is the redemption value per $100 of face value.
Frequency is the number of coupon payments per year. The valid values are 1, 2,
and 4 where annual payments =1, semiannual payments =2, and quarterly payments
=4.
Basis is a parameter that indicates the time-count basis used. The default value for
Basis is 0, which is typically used by American agencies and assumes 30-day
months and 360-day years (30/360). Possible values for this parameter are listed in
the following table.
1 (actual/actual) Assumes actual number of days in each month, actual number of days in each
year.
2 (actual/360) Assumes actual number of days in each month, 360 days in each year.
3 (actual/365) Assumes actual number of days in each month, 365 days in each year.
4 (30/60) Used by European agencies, assumes the same values as 0 for American
institutions.
Expression
There are two expressions for this function:
Odd Short First Coupon: for securities with a short first period
Odd Long First Coupon: for securities with a long first period
Odd Short First Coupon
Where:
A is the number of days from beginning of coupon period to settlement date (accrued
days)
DSC is the number of days from settlement to next coupon date
DFC is the number of days from the beginning of odd first coupon to first coupon
date
E is the number of days in coupon period
N is the number of coupons payable between settlement date and redemption date; if
this number contains a fraction, it is raised to the next whole number
Odd Long First Coupon
Where:
Ai is the number of days from beginning of the ith quasi-coupon period within odd
period
DCi is the Number of days from date to first quasi-coupon (i=1) or number of days
in quasi-coupons (i=2,..., i=NC)
DSC is the Number of days from settlement to next coupon date
E is the Number of days in coupon period
N is the Number of coupons payable between the first real coupon date and
redemption date; if this number contains a fraction, it is raised to the next whole
number
NC is the Number of quasi-coupon periods that fit in odd period; if this number
contains a fraction it is raised to the next whole number
NLi is the Normal length in days of the full ith quasi-coupon period within odd
period
Nq is the Number of whole quasi-coupon periods between settlement date and first
coupon
Usage notes
The Settlement date and the Maturity date should be included within single quotations in
the expression for the expression to be considered as a valid expression.
Expression
There are two expressions for this function:
Odd Short First Coupon: for securities with a short first period
Odd Long First Coupon: for securities with a long first period
Where:
A is the number of days from beginning of coupon period to settlement date (accrued
days)
DSC is the number of days from settlement to next coupon date
DFC is the number of days from the beginning of odd first coupon to first coupon
date
E is the number of days in coupon period
N is the number of coupons payable between settlement date and redemption date; if
this number contains a fraction, it is raised to the next whole number
Odd Long First Coupon
Where:
Ai is the number of days from beginning of the ith quasi-coupon period within odd
period
DCi is the Number of days from date to first quasi-coupon (i=1) or number of days
in quasi-coupons (i=2,..., i=NC)
DSC is the Number of days from settlement to next coupon date
E is the Number of days in coupon period
N is the Number of coupons payable between the first real coupon date and
redemption date; if this number contains a fraction, it is raised to the next whole
number
NC is the Number of quasi-coupon periods that fit in odd period; if this number
contains a fraction it is raised to the next whole number
NLi is the Normal length in days of the full ith quasi-coupon period within odd
period
Nq is the Number of whole quasi-coupon periods between settlement date and first
coupon
Usage notes
The Settlement date and the Maturity date should be included within single quotations in
the expression for the expression to be considered as a valid expression.
Usage notes
If Settlement, Maturity, Issue, or FirstCoupon is not an integer, it is truncated.
The engine returns an empty cell if:
Expression
Where:
Ai is the Number of accrued days for the ith quasi-coupon period within odd period
counting forward from last interest date before redemption
DCiis the Number of days counted in each ith quasi-coupon period as delimited by
the length of the actual coupon period
NC is the Number of quasi-coupon periods that fit in odd period; if this number
contains a fraction, it is raised to the next whole number
NLi is the Normal length in days of the ith quasi-coupon period within odd coupon
period
DSCi is the Number of days from settlement (or beginning of quasi-coupon period)
to next quasi coupon within odd period (or to maturity date) for each ith quasi-
coupon period.
Usage notes
The Settlement date and the Maturity date should be included within single quotations in
the expression for the expression to be considered as a valid expression.
Frequency is the number of payments per year. The valid values are 1, 2, and 4
where annual payments =1, semiannual payments =2, and quarterly payments =4.
Basis is a parameter that indicates the time-count basis to be used. The default
value for Basis is 0, which is typically used by American agencies and assumes 30-
day months and 360-day years (30/360). Possible values for this parameter are listed
in the following table.
4 (30/60) Used by European agencies, assumes the same values as 0 for American
institutions.
Expression
Where:
Ai is the number of accrued days for the ith, or last, quasi-coupon period within odd
period counting forward from last interest date before redemption.
DCi is the number of days counted in the ith, or last, quasi-coupon period as
delimited by the length of the actual coupon period.
NC is the number of quasi-coupon periods that fit in odd period; if this number
contains a fraction, it is raised to the next whole number.
NLiis the normal length in days of the ith, or last, quasi-coupon period within odd
coupon period.
Usage notes
The date arguments should be included within single quotations for the expression to be
considered as a valid expression.
Pmt (payment)
Returns the payment cost on a loan, based on constant payments and a constant interest
rate.
Syntax
Pmt <FV, Type> (Rate, Nper, PV)
Where:
FV a parameter that indicates the future value of the loan. It is the balance to be
attained once all payments are made.
Type is parameter that indicates when payment is due.
Rate is the interest rate.
Nper is the number of payments.
PV is the present value of the loan, also referred to as principal. This is the current
value of a set of future payments.
Usage notes
Values returned by this function include principal and interest; they do not include
taxes, reserve payments, or ancillary fees.
Units must be used consistently when calculating payment. For example:
To calculate monthly payments on a four-year loan at 12% annual interest, Rate
should be 12%/12, Nper should be 4 12.
To calculate annual payments on the same loan, Rate should be 12%, Nper
should be 4.
This function can also be used to determine payments on annuities other than loans.
Where:
i is the period desired
Expression
Where:
DSC is the number of days from settlement to next coupon date
E is the number of days in the coupon period in which the settlement date falls
N is the number of coupons payable between the settlement date and the redemption
date
A is the number of days from the beginning of the coupon period to settlement date
Usage notes
If Settlement, Maturity, or Frequency is not an integer, it is truncated.
The engine returns an empty cell if:
Settlement or Maturity is not a valid date
CouponRate < 0 or YieldRate < 0
Redemption 0
Frequency has a value other than 1, 2, or 4
Settlement Maturity
The Settlement date and the Maturity date should be included within single
quotations in the expression for the expression to be considered as a valid expression.
Expression
Where:
B is the number of days in a year (see Basis)
DSM is the number of days from settlement to maturity
Usage notes
If Settlement or Maturity is not an integer, it is truncated.
The engine returns an empty cell if:
Settlement or Maturity is not a valid date.
DiscRate 0 or Redemption 0.
Settlement Maturity.
The Settlement date and the Maturity date should be included within single
quotations in the expression for the expression to be considered as a valid expression.
Expression
Where:
B is the number of days in a year (see Basis)
DSM is the number of days from settlement to maturity
Usage notes
If Settlement or Maturity is not an integer, it is truncated.
The engine returns an empty cell if:
Settlement or Maturity is not a valid date.
DiscRate 0 or Redemption 0.
Settlement Maturity.
The Settlement date and the Maturity date should be included within single
quotations in the expression for the expression to be considered as a valid expression.
Expression
Where:
B is the number of days in a year (see Basis)
DSM is the number of days from settlement to maturity
DIM is the number of days from issue to maturity
A is the number of days from issue to settlement
Usage notes
If Settlement, Maturity, or Issue is not an integer, it is truncated.
The engine returns an empty cell if
Settlement, Maturity, or Issue is not a valid date.
Rate < 0 or Yield < 0.
Settlement Maturity.
The Settlement date, the Maturity date, and the Issue date should be included within
single quotations in the expression for the expression to be considered as a valid
expression.
Expression
Where:
B is the number of days in a year (see Basis)
DSM is the number of days from settlement to maturity
DIM is the number of days from issue to maturity
A is the number of days from issue to settlement
Usage notes
If Settlement, Maturity, or Issue is not an integer, it is truncated.
The engine returns an empty cell if
Settlement, Maturity, or Issue is not a valid date.
Rate < 0 or Yield < 0.
Settlement Maturity.
The Settlement date, the Maturity date, and the Issue date should be included within
single quotations in the expression for the expression to be considered as a valid
expression.
Pv (present value)
Returns the present value of an investment.
Syntax
Pv <Type> (Rate, Nper, Pmt, FV)
Where:
Type is a value that indicates when payment is due.
Rate is the interest rate.
Nper is the number of payments.
Pmt is the periodic payment for an annuity.
FV is the future value of the loan.
Expression
If rate = 0
Else
PV is the present value of the annuity. It is the total amount that a series of future
payments is worth today.
Usage notes
For this function, consistency in the units used is necessary:
Assuming monthly payments on a four-year loan at 12% annual interest, Nperiod
should be 4 12.
Assuming annual payments on a four-year loan at 12% annual interest, Nperiod
should be 4.
Expression
Where:
B is the number of days in a year (see Basis)
DIM is the number of days between settlement and maturity
Usage notes
If Settlement or Maturity is not an integer, it is truncated.
The engine returns an empty cell if
Settlement or Maturityis not a valid date.
Investment0.
Discount0.
Maturity Settlement.
The Settlement date and the Maturity date should be included within single
quotations in the expression for the expression to be considered as a valid expression.
Expression
Where:
B is the number of days in a year (see Basis)
DIM is the number of days between settlement and maturity
Usage notes
If Settlement or Maturity is not an integer, it is truncated.
The engine returns an empty cell if
Settlement or Maturity is not a valid date.
Investment 0.
Discount 0.
Maturity Settlement.
The Settlement date and the Maturity date should be included within single
quotations in the expression for the expression to be considered as a valid expression.
Where:
DSM is the number of days between settlement and maturity on 360-day basis.
Usage notes
The Settlement date and the Maturity date should be included within single quotations in
the expression for the expression to be considered as a valid expression.
Where:
DSM is the number of days from settlement to maturity.
This excludes any maturity date that is more than one calendar year past Settlement.
Usage notes
If Settlement or Maturity is not an integer, it is truncated.
The engine returns an empty cell if:
Either Settlement or Maturity is not a valid date.
Discount0.
Settlement > Maturity.
Maturity is more than one year after Settlement.
The Settlement date and the Maturity date should be included within single
quotations in the expression for the expression to be considered as a valid expression.
Where:
DSM is the number of days from settlement to maturity.
This excludes any maturity date that is more than one calendar year past Settlement.
Usage notes
If Settlement or Maturity is not an integer, it is truncated.
The engine returns an empty cell if:
Either Settlement or Maturity is not a valid date.
Price 0.
Settlement > Maturity.
Maturity is more than one year after Settlement.
The Settlement date and the Maturity date should be included within single
quotations in the expression for the expression to be considered as a valid expression.
The XIRR function uses the secant method to determine the internal rate of return,
which adjusts the initial guess as required to return a result. The final result must be
within 0.000001 percent to be considered valid.
Payments, whether positive or negative, must be entered in the desired sequence, as
this is the order in which entries are interpreted for calculation.
Example
You have an investment where payments are made at irregular intervals. This payment
and payment date information is included in MicroStrategy and displayed on the simple
report shown below:
Since the dates are not at regular intervals such as monthly or quarterly, you cannot use
the IRR function to determine the internal rate of return. Instead, you can use the XIRR
function, which also evaluates the date of each payment to determine an internal rate of
return. A new metric is added to the report which uses the following definition:
XIRR(Payment, Date){}
The new report now includes this information, as shown below:
The internal rate of return considering the payments and the dates of those payments is
21.93. Notice that while there is a single value for XIRR, it is displayed on every row. One
way to simplify the display of this information is to include this data on a dashboard. You
can include the XIRR result in a text field along with additional visualizations of the data,
as shown below.
Where:
n is the number of entries in payments.
di is the ith payment date and d1 is the first payment date.
Usage notes
The order of the entries in Payments is assumed to be the order in which funds
flow; payment and income entries must, therefore, be provided in the correct
sequence.
Example
You have an investment where payments are made at irregular intervals. This payment
and payment date information is included in MicroStrategy and displayed on the simple
report shown below:
Since the dates are not at regular intervals such as monthly or quarterly, you cannot use
the NPV function to determine the net present value. Instead, you can use the XNPV
function, which also evaluates the date of each payment to determine a net present
value. A new metric is added to the report, which uses the following definition that
includes a rate of 20%:
XNPV(Payment, Date, 0.2){}
The new report now includes this information, as shown below:
The net present value considering the payments, the dates of those payments, and a rate
of 20% is $20,379. Notice that while there is a single value for XNPV, it is displayed on
every row. One way to simplify the display of this information is to include this data on a
dashboard. You can include the XNPV result in a text field along with additional
visualizations of the data, as shown below.
Yield
Returns the yield on a security that pays periodic interest.
Syntax
Yield <Basis> (Settlement, Maturity, CouponRate, Price,
Redemption, Frequency)
Where:
Settlementis the settlement date. This is the date on which the security is
purchased.
Maturity is the maturity date. This is the date on which the security expires.
CouponRate is the annual interest rate.
Price is the price per $100 of face value.
Redemption is the redemption value per $100 of face value.
Frequency is the number of payments per year. The valid values are 1, 2, and 4
where annual payments =1, semiannual payments =2, and quarterly payments =4.
Basis is a parameter that indicates the time-count basis to be used. The default
value for Basis is 0, which is typically used by American agencies and assumes 30-
day months and 360-day years (30/360). Other possible values for this parameter are
as follows.
Expression
If there is one period (or less) untilRedemption, this function is calculated as follows.
Where:
A is the number of days from the beginning of the period to Settlement
DSR is the number of days from Settlement to Redemption
E is the number of days in a period
If there is more than one period until Redemption, this function is calculated
through iteration, and is based on the calculation for the PRICE function. See also
Appendix , Price (price per $100 face value).
Usage notes
If Settlement, Maturity, or Frequency is not an integer, it is truncated.
The engine returns an empty cell if:
Either Settlement or Maturity is not a valid date.
Price 0 or Redemption0.
Frequency is a number other than 1, 2, or 4.
Settlement > Maturity.
The Settlement date and the Maturity date should be included within single
quotations in the expression for the expression to be considered as a valid expression.
Usage notes
If Settlement or Maturity is not an integer, it is truncated.
The engine returns an empty cell if:
Either Settlement or Maturity is not a valid date.
Price0 or Redemption0.
Maturity Settlement.
The Settlement date and the Maturity date should be included within single
quotations in the expression for the expression to be considered as a valid expression.
Usage notes
If Settlement, Maturity, or Issue is not an integer, it is truncated.
The engine returns an empty cell if:
Rate< 0
Price 0
Settlement Maturity
The Settlement date and the Maturity date should be included within single
quotations in the expression for the expression to be considered as a valid expression.
Mathematical functions
The category of Mathematical functions contains more complex math functions than the
simple operators found in the Basic functions. This category includes exponential,
logarithmic, and trigonometric functions. These functions are calculated by either the
MicroStrategy Analytical Engine or the database. Those not supported by the database
are automatically computed by the Analytical Engine.
756.25, 315, 145, 980.35, 75, 1250.78, 560. For another example of using the Abs
function, see Example 1: Transformed fact, page 23.
For more information on the hyperbolic sine function, see Sinh (sine, hyperbolic), page
332.
Syntax
Asinh(Argument)
Where:
Argument is a metric representing a list of real numbers.
Combine (combination)
The number of possible combinations for a given number of items selected as a group
from a set.
Syntax
Combine(Number, Number_Chosen)
Where:
Numberis the number of items in a set.
Number_Chosen is the number of items to be included in each combination.
Expression
In the expression that follows, Number = n; Number_Chosen = k,
Where:
Usage notes
In combination calculations, the internal order of the items selected does not affect
the return. This differs from the case of a permutation, in which the order of the
items selected does affect the return. Permutation is a statistical function.
If an argument is not an integer, it is truncated.
This function returns an error value if:
Either argument is nonnumeric
n< 0
k<0
nk
Cos (cosine)
This function takes the value of an angle in radians and returns the cosine of the angle as
a number between -1 and 1.
In a given right triangle containing an angle A, there are three sides: the side opposite to
A, the side adjacent to A, and the side opposite to the right angle (hypotenuse). The
cosine of A is the ratio of the lengths of the adjacent side over the hypotenuse.
To convert degrees to radians, multiply by /180. This is a single-value function.
Syntax
Cos(Argument)
Where:
Argument is a metric representing a list of real numbers. The values are the angles, in
radians, for which the value of the cosine is sought. To convert the result from radians to
degrees, multiply by 180/.
Function/Result Calculation
Degrees(2.27) = 130
Degrees(/2) = 90
Exp (exponent)
Returns the value e raised to the power of the number given.e is a mathematical constant
equal to 2.71828182845904. Expis the inverse of Ln, the natural logarithm of a number.
This is a single-value function.
For more information on the natural logarithm function, see Ln (logarithm, natural),
page 325.
Syntax
Exp(Argument)
Where:
Argument is a metric representing a list of real numbers. The values are the power to
which e is raised
Example
This simple example illustrates the results of using the Exp function. The variable
e=2.71828182845904
Function/Result Calculation
Exp (2) = X = e2 ;
7.38905609893062
2.71828182845904 2.71828182845904 =
7.38905609893062
Factorial (factorial)
Returns the factorial of a positive integer. The factorial of an integer N is equal to the
product of all integers from 1 to N. For example, the factorial of 5 is 1 2 3 4 5, or
120.
This is a single-value function.
Syntax
Factorial(Argument)
Where:
Argument is a metric representing a list of positive integers.
Usage notes
If a number is not an integer or is negative, the function returns a NULL.
Example
These simple examples illustrate the results of using the Factorial function.
Function/Result Calculation
123456789=
362880
Floor(Argument)
Where:
Argument is a metric representing a list of real numbers.
Example
These simple examples illustrate how the Floor function acts on positive and negative
numbers, and how the results compare to the use of the Ceiling function.
Int (integer)
Returns the integer part of a number rounded down to the nearest integer. This is a
single-value function.
Syntax
Int(Argument)
Where:
Argument is a metric representing a list of real numbers.
Usage notes
The expression [Argument - INT(Argument)] can be used to return the
decimal part of a non-integer.
Results from Int and Trunc differ only when the values are less than 0.
Example
These simple examples illustrate how the Int function acts on positive and negative
numbers, and how the results differ from the Trunc function when the numbers are
negative.
Ln (logarithm, natural)
Returns the natural logarithm of a given number.This is a single-value function. Ln is the
inverse of the Exp function.
For more information on the Exponent function, see Exp (exponent), page 322.
Syntax
Ln(Argument)
Where:
Argument is a metric representing a list of positive real numbers.
Example
This simple example illustrates the results of the Ln function. The variable
e=2.71828182845904.
Function/Result Calculation
Log (logarithm)
Returns the logarithm of a given number in a specified base. This is a single-value
function.
Syntax
Log(Argument, Base)
Where:
Argument is a metric representing a list of positive real numbers.
Base is the base of the logarithm.
Example
This simple example illustrates the results of the Log function.
Function/Result Calculation
Function/Result Calculation
Mod (modulus)
Returns the remainder of a number when divided by a another number. The result has
the same sign as the dividend. This is a single-value function.
Syntax
Mod (Argument, Divisor)
Where:
Argument is a metric representing a list of real numbers.
Divisor is the number used to divide the value(s) of Argument.
Usage notes
The function returns a NULL if Divisor = 0.
Use the Quotient function to return only the integral part of the result.
Example
These simple examples illustrate the results of using the Mod function.
Function/Result Calculation
Function/Result Calculation
Power
Returns the value of an input number raised to a given power. This is a single-value
function.
Syntax
Power(Argument, Power)
Where:
Argument is a metric representing a list of base numbers. All real numbers are valid.
Power is the exponent to which Argument is raised.
Usage notes
If Argument is a negative number and Power is an even number, the result is positive;
however, if Argument is negative and Power is an odd number, the result is negative.
Example
These simple examples illustrate the results of using the Power function.
Function/Result Calculation
Power(5, 2) = 25 5 5 = 25
Power(-5, 2) = 25 -5 -5 = 25
Power(4, 3) = 64 4 4 4 = 64
Power(20,4) = 20 20 20 20 = 160000
160000
Quotient
Returns the integer result of dividing two numbers. This function discards the
remainder. This is a single-value function.
Syntax
Quotient(numerator, denominator)
Where:
Numerator is a metric representing a list of real numbers to be used as the
dividend.
Denominatoris a metric representing a list of real numbers to be used as the
divisor.
Usage notes
Use the Mod function (Mod (modulus), page 326) to retrieve only the remainder.
Example
These simple examples illustrate the results of using the Quotient function.
Function/Result Calculation
Function/Result Calculation
Radians(130) = 2.27
Random numbers are used often in statistical analysis. A common practice is to apply a
random percentage to another value. To do this, you can use the Randbetween function
to return a number between 0 and 1. This can be achieved with the following syntax:
Randbetween(0, 1)
This returns a real number value between zero and one. This can be used in an
expression to multiply against another value, which would return a random percentage of
that value. For example, you can return a random percentage of revenue by creating a
metric with the following definition:
(Sum(Revenue) {~+} * Randbetween(0, 1))
When using a metric with this definition on a report the same random percentage is
applied to all revenue values on a report.
In the definition provided below, the metric Revenue is used in the Randbetween
calculation. By including the revenue data as part of the calculation of Randbetween, a
different random number is generated for each row of revenue data on a report.
Randbetween(0, Revenue)
These two metrics are created as Random Revenue 1 and Random Revenue 2
respectively, and displayed on the same report shown below:
Notice that the metric Random Revenue 2, which includes the revenue data as part of
the Randbetween calculation, is using a different percentage for each row of revenue
data. However, the metric Random Revenue 1 which uses a simple definition of the
Randbetween calculation as Randbetween(0,1) uses the same random percentage to
modify all rows of Revenue data.
Sin (sine)
This function takes the value of an angle in radians and returns the sine of the angle as a
number between -1 and 1.
In a given right triangle containing an angle A, there are three sides: the side opposite to
A, the side adjacent to A, and the side opposite to the right angle (hypotenuse). The sine
of A is the ratio of the lengths of the opposite side over the hypotenuse.
To convert degrees to radians, multiply by /180. This is a single-value function.
Syntax
Sin(Argument)
Where:
Argument is a metric representing a list of values. The values are angles, in radians, for
which the sine is sought. Multiplying the argument by /180 converts an angle from
degrees to radians.
Sqrt(25) = 5
Sqrt(169) = 13
Tan (tangent)
This function takes the value of an angle in radians and returns the tangent of the angle.
In a given right triangle containing an angle A, there are three sides: the side opposite to
A, the side adjacent to A, and the side opposite to the right angle (hypotenuse). The
tangent of A is the ratio of the lengths of the opposite side over the adjacent side.
To convert degrees to radians, multiply by /180. This is a single-value function.
Syntax
Tan(Argument)
Where:
Argument is a metric representing a list of real numbers.
Trunc (truncate)
Returns the integer component of a given number. The function removes the fractional
part of a real number so that only the integer part remains. The fractional part is
removed without rounding the number up or down. This is a single-value function.
Syntax
Trunc(Argument)
Where:
Argument is a metric representing a list of real numbers.
Usage notes
Results from Trunc and Int differ only when the values are less than 0.
Example
This simple example illustrates how the Trunc function acts on positive and negative
numbers, and how it differs from the Int function.
Statistical functions
The statistical functions include a wide range of functions designed to provide you with
the tools to perform statistical analysis on your data.
BetaDistribution
Returns the cumulative Beta distribution of the variables alpha and beta, where the
probability density function is given by
Where:
This function is used to study percentage variations for an item across population
samples (for example, how much of a day people spend watching television).
Syntax
BetaDistribution < Lower Bound, Upper Bound > (x, alpha,
beta)
Where:
x is the value between Lower Bound (a) and Upper Bound (b) at which the
function is evaluated.
alpha and beta are distribution parameters.
alpha =
beta =
Lower Bound is an optional lower bound of the interval of x.
Upper Bound is an optional upper bound of the interval of x.
Usage notes
The following are invalid conditions:
x, alpha, or beta is nonnumeric.
alpha 0 or beta 0.
x < Lower Bound or x > Upper Bound.
Lower Bound = Upper Bound.
BinomialDistribution
Returns either the binomial probability or the cumulative binomial probability of
variables n and p. This function is used in cases in which:
There is a fixed number of tests
Each test can only result in either success or failure (binary)
Tests are independent of all other tests
The probability of success is constant, for example, to calculate the probability that
two out of the next three babies will be male
Syntax
BinomialDistribution <Cumulative> (x, n, p)
Where:
x is the number of successes.
n is the number of tests.
p is the number indicating the probability of a success in each trial.
Cumulative is a logical value that determines the form of the function.
If Cumulative=0, it computes the Cumulative Binomial probability.
If Cumulative=1, it computes the Binomial probability.
Expression
Usage notes
If x or n is not an integer, it is truncated.
ChiSquareDistribution
Returns the right-tailed chi-squared distribution of the degrees of freedom, where the
probability density function is given by
Where:
is the degree of freedom
is the gamma function
The chi-squared distribution is associated with a chi-squared test. A chi-squared test is
used to compare observed values against expected ones. It determines the validity of a
hypothesis, such as the prediction that the next generation of a certain plant hybrid will
exhibit a specific combination of colors.
Syntax
ChiSquareDistribution(x, df)
Where:
x is a non-negative decimal value at which the distribution is evaluated.
df is an integer greater than or equal to one (>=1) indicating the number of degrees
of freedom for the distribution.
Usage notes
If df is not an integer, it is truncated
The following are invalid conditions:
Either argument is nonnumeric
x < 0
df < 1
Usage notes
Ifsize is not an integer, it is truncated.
The following are invalid conditions:
One of the arguments is nonnumeric.
alpha < 0 or alpha > 1
stdev < 0
size < 1
Example
For an example of the Confidence function, see Confidence level example, page 77.
Correlation
A correlation of two values describes the degree to which the values are related or
associated. Values that are closely related with either a positive or negative correlation
will have a correlation close to 1 or -1 respectively, while values that are not correlated at
all will have a correlation close to 0.
To determine the correlation of two values while applying a weight to the comparisons,
see WeightedCorr (weighted correlation), page 197.
Syntax
Correlation <FactID> (Argument1, Argument2)
Where:
FactID is a parameter that forces a calculation to take place on a fact table that
contains the selected fact.
Argument1 and Argument2 are lists of values represented by facts or metrics.
Usage notes
The correlation coefficient is measured on a scale that varies from + 1 through 0 to -
1. So only a value between -1 and 1 is returned.
Complete correlation between two variables is expressed by either + 1 or -1. When
one variable increases as the other increases, the correlation is positive; when one
decreases as the other increases, the correlation is negative. Complete absence of
correlation is represented by 0.
If an array or reference argument contains text, logical values, or empty cells, those
values are ignored; however, cells with the value zero are included.
If Argument1 and Argument2 have a different number of data points, Correlation
returns an error.
If either Argument1 or Argument2 is empty, or if the standard deviation of their
values equals zero, Correlation returns an error.
Covariance
Covariance is used to examine the relationship between two data sets. For instance,
the covariance could be used to examine whether an increase in income is related to
higher education levels. A covariance greater or less than zero indicate a relationship,
while a value of zero indicates no relationship.
To determine the covariance of two values while applying a weight to the comparisons,
see WeightedCov (weighted covariance), page 199.
Syntax
Covariance <FactID> (Argument1, Argument2)
Where:
Argument1 and Argument2 are facts or metrics representing lists of values.
FactID is a parameter that forces a calculation to take place on a fact table that
contains the selected fact.
Expression
In the expression that follows:
Argument1 = X
Argument2= Y
Where:
= average value of x
= average value of y
Usage notes
The following are invalid conditions:
Argument1 and Argument2 do not contain the same number of data points.
Either value set is empty.
ExponentialDistribution
Returns either the probability density or the cumulative distribution of a random
variable. This function is used to model the time between events. For example, it can be
used to estimate the probability that an automatic-teller machine will take no more than
one minute to deliver requested cash.
Syntax
ExponentialDistribution <Cumulative> (x, lambda)
Where:
Cumulative is a logical value that determines the form of the function:
If Cumulative=0 (default), it returns the cumulative distribution.
If Cumulative=1, it returns the probability density.
x is the value of the function.
lambda is the value of the parameter.
Expression
For probability density:
Usage notes
The following are invalid conditions:
Either x or lambda is nonnumeric.
x<0.
lambda 0.
Usage notes
The following are invalid conditions:
x is nonnumeric.
x -1 or x 1.
Where:
x is the value at which the function is evaluated.
Expression
Where:
Fis a random variable that has an F distribution.
Usage notes
If df1 or df2 is not an integer, it is truncated.
df2 < 1
Forecast
The Forecast function uses data recorded for certain time periods to calculate and
display the expected value of data for an unknown time period. This is most commonly
used to predict future metric values based on historical data. For example, based on
revenue data for three years, you want to predict what your Revenue will be for the
coming year.
This function uses a linear equation to predict future values. Therefore, it is best suited to
predict values that increase or decrease in a linear trend. For example, if your profits are
increasing by $10,000 each year, this is a scenario that is well suited for a prediction
based on a linear equation.
For a function that predicts values in a similar way for data that is increasing or
decreasing exponentially, see Growth, page 348.
Syntax
Forecast <FactID>(FutureTime, KnownData1,...,KnownDataN,
KnownTimeIntervals1,...,KnownTimeIntervalN)
Where:
FutureTime is the point in time for which to predict the data. This is commonly
defined as an integer. For example, to predict values for the year 2009, you would
enter the value 2009 for FutureTime (this assumes your year data is defined with
IDs that match the year).
KnownData1,...,KnownDataN are separate scalar values that provide the data to
use to predict a future value for. While you can use Forecast to enter these values
manually, it is more common to use ForecastV which can use a metric to enter a
list of values, as described in ForecastV (forecast, vector input), page 344.
KnownTimeIntervals1,...,KnownTimeIntervalN are separate scalar values
that provide the time intervals for which data is known. While you can use
Forecast to enter these values manually, it is more common to use ForecastV
which can use an attribute to enter a list of time intervals, as described in ForecastV
(forecast, vector input), page 344.
FactID is a parameter that forces a calculation to take place on a fact table that
contains the selected fact.
Example
As described in the syntax requirements, you can use Forecast to enter values and time
intervals manually. However, it is more common to use ForecastV to use metrics and
attributes to enter this information, as described in ForecastV (forecast, vector input),
page 344.
You can use ForecastV to predict values for any point in time, including dates
that have known data. However, this type of function is meant for predicting
future, unknown values.
This function uses a linear equation to predict future values. Therefore, it is best suited to
predict values that are increasing or decreasing in a linear trend. For example, if your
profits are increasing by $10,000 each year, this is a scenario that is well suited for a
prediction based on a linear equation.
For a function that predicts values in a similar way for data that is increasing or
decreasing exponentially, see GrowthV (growth, vector input), page 348.
Syntax
ForecastV <FactID>(FutureTime, KnownData,
KnownTimeIntervals)
Where:
FutureTime is the point in time for which to predict the data. This is commonly
defined as an integer. For example, to predict values for the year 2009, you would
enter the value 2009 for FutureTime (this assumes your year data is defined with
IDs that match the year).
KnownData is an object representing a list of values. This list of values is the known
data to use to predict a future value for. KnownData is commonly used for metrics
that represent data such as revenue, profit, and so on.
Since the ForecastV function allows you to enter a list of time intervals, it can account
for time intervals that you have no data for. For example, consider the same report in a
scenario in which there was no data available for the year 2006. The ForecastV
function can still use the two available years to predict the revenue for 2008.
FTest
Returns the P-value of an F-test on the variances of two sets of data. It tests that the
variances in the two sets are not significantly different. For example, given the test scores
from public and private schools, this function enables you to determine whether diversity
levels between the two school types are significantly different.Decision Reality: H0 is
correctReality: H1 is correctAccept H0No problemType 1 errorReject H0Type 2 errorNo
problemDefinitionP-value = Pr[Reject H0| H0 is correct]P-value is basically a probability
of making a Type 2 error.FTest returns the p-value for the hypothesis test in the
following form:H0: (Argument1) / (Argument2) = RatioH1: (Argument1) /
(Argument2) < Ratio (Type = -1) (Argument1) / (Argument2) Ratio (Type
= 0: two-sided test) (Argument1) / (Argument2) > Ratio (Type = 1)
(Argument1) / (Argument2) Ratio (Type = 2: one-sided test)SyntaxFTest
<Hypothesis type, Ratio> (Argument1, Argument2)Usage notesThe
following are invalid conditions:Argument1 and Argument2 contain a different
number of data points.The variance of either data set is zero.
Definition
P-value = Pr[Reject H0| H0 is correct]
FTest returns the p-value for the hypothesis test in the following form:
H0:
H1:
Syntax
FTest <Hypothesis type, Ratio> (Argument1, Argument2)
Usage notes
The following are invalid conditions:
Argument1 and Argument2 contain a different number of data points.
GammaDistribution
Returns either the cumulative Gamma distribution or the probability density of a random
variable. This function is used in queueing analysis to study variables that may have a
skewed distribution.
Syntax
GammaDistribution <Cumulative> (x, Alpha, Beta)
Where:
x is the value at which you want to evaluate the distribution.
Alpha is a distribution parameter.
Beta is a distribution parameter.
Cumulative is a logical value that determines the form of the function:
If Cumulative=0 (default), it returns the cumulative distribution.
If Cumulative=1, it returns the probability density.
Expression
Usage notes
When alpha > 0, this function is also known as the Erlang distribution.
The following are invalid conditions:
Either alpha or beta is nonnumeric.
Either alpha 0 or beta 0.
x < 0.
Growth
The Growth function uses data recorded for certain time intervals to calculate and
display the expected value of data for an unknown time period. This is most commonly
used to predict future metric values based on historical data. For example, based on
revenue data for three years, you can predict what your Revenue will be for the coming
year.
This function uses an exponential equation to predict future values. Therefore, it is best
suited to predict values that increase or decrease in an exponential trend. For example, if
your profits are increasing by 4 percent each year, this is a scenario that is well suited for
a prediction based on an exponential equation.
For a function that predicts values in a similar way for data that is increasing or
decreasing with a linear trend, see Forecast, page 343 or Trend, page 369.
Syntax
Growth <FactID>
(KnownData1,...,KnownDataN, FutureTimeOffset)
Where:
KnownData1,...,KnownDataN are separate scalar values that provide the data to
use to predict a future value for. While you can use Growth to enter these values
manually, it is more common to use GrowthV which can use a metric to enter a list
of values, as described in GrowthV (growth, vector input), page 348.
FutureTimeOffset is the point in time after the final time interval available for
which to predict the data. This is commonly defined as an integer. For example, to
predict values for the year 2009 when the last available data you have is for 2007,
you would enter the value of 2 for FutureTimeOffset.
FactID is a parameter that forces a calculation to take place on a fact table that
contains the selected fact.
Example
As described in the syntax requirements, you can use Growth to enter values manually.
However, it is more common to use GrowthV to use metrics and attributes to enter this
information, as described in GrowthV (growth, vector input), page 348.
You can use GrowthV to predict values for any point in time, including dates that
have known data. However, this type of function is meant for predicting future,
unknown values.
This function uses an exponential equation to predict future values. Therefore, it is best
suited to predict values that increase or decrease in an exponential trend. For example, if
your profits are increasing by 15 percent each year, this is a scenario that is well suited
for a prediction based on a linear equation.
For a function that predicts values in a similar way for data that is increasing or
decreasing with a linear trend, see ForecastV (forecast, vector input), page 344 or
TrendV (trend, vector input), page 370.
Syntax
GrowthV <FactID, SortBy>(KnownData, FutureTimeOffset)
Where:
KnownData is an object representing a list of values. This list of values is the known
data to use to predict a future value for. KnownData is commonly used for metrics
that represent data such as revenue, profit, and so on.
FutureTimeOffset is the point in time after the final time interval available for
which to predict the data. This is commonly defined as an integer. For example, to
predict values for the year 2009 when the last available data you have is for 2007,
you would enter the value of 2 for FutureTimeOffset.
The GrowthV function assumes that data is available for sequential time intervals
with no missing data. If your data meets these requirements, this allows you to use a
single expression to use on reports with varying time intervals such as year, month,
quarter, and so on. For an example, see the examples described below.
FactID is a parameter that forces a calculation to take place on a fact table that
contains the selected fact.
SortBy is a parameter that defines the order of calculation. For more information,
see BreakBy and SortBy parameters, page 33.
Example
The GrowthV function is useful to display predicted future values of a metric as a
subtotal of the metric on a report.
For example, in the MicroStrategy Tutorial project a new subtotal named 2008 Growth
can be created with the following definition:
GrowthV(x, 1)
Since this is in a subtotal, the x is a placeholder for a metric. When a subtotal is applied
to a metric on a report, the placeholder inputs that metrics values.
Also, 1 is used as the offset in the time interval to predict data for the first time interval
that is not known.
After making the new custom subtotal available for the Revenue metric (see the
Advanced Reporting Guide for steps to make custom subtotals available for metrics) a
report with the attribute Year and the metric Revenue is created. When the 2008
Growth is displayed on the report, it displays the predicted value for 2008 Revenue, as
shown below:
This predicted value is different than the values predicted by the functions ForecastV
and TrendV, as described in ForecastV (forecast, vector input), page 344 and TrendV
(trend, vector input), page 370. This difference is due to GrowthV predicting values
based on an exponential trend, and as such should be used with data that reflects such a
trend.
Homoscedastic t-tests are based on the assumption that variances between two
sample data ranges are equal [ (Argument1) = (Argument2)].
HypergeometricDistribution
Returns the probability of a given number of sample successes, given the sample size,
population successes, and population size. Use this function for problems with a finite
population, where each observation is either a success or a failure, and where each subset
of a given size is chosen with equal likelihood.
Syntax
HypergeometricDistribution(x, n, M, N)
Where:
x is the number of successes in the sample.
n is the size of the sample.
M is the number of successes in the population.
N is the population size.
Expression
Usage notes
All arguments are truncated to integers.
The following are invalid conditions:
Any argument is nonnumeric.
x < 0 or x is greater than the lesser of n or M.
x is less than the larger of 0 or (n - N + M).
n < 0 or n > N.
M < 0 or M > N.
N < 0.
Intercept
Returns the point at which a line intersects the y-axis in a graph. This function is used to
determine the value of a dependent variable Y when the value of its associated
independent variable X is 0. The point of intersection is based on a best-fit regression
line plotted through available values of X and Y.
Syntax
Intercept <FactID> (Argument1, Argument2)
Where:
Argument1 is the dependent set of observation data represented by a fact or metric.
Argument2 is the independent set of observation data represented by a fact or
metric.
FactID is a parameter that forces a calculation to take place on a fact table that
contains the selected fact.
Expression
In the expressions that follow, Argument1 = Y, Argument2 = X.
The equation for the intercept of the regression line is
Usage notes
This function results in an invalid value if Argument1 and Argument2 contain a different
number of data points.
Example
For an example using the Intercept function, see Hypothesis Testing example, page 72.
Usage notes
This function results in an invalid value if x is nonnumeric.
Where:
x is the probability associated with the F right-tailed distribution.
df1 represents the degrees of freedom of numerator values.
Usage notes
If df1 or df2 is not an integer, it is truncated.
df2 < 1
Usage notes
The following are invalid conditions:
One of the arguments is nonnumeric.
x < 0.
x > 1.
stdev < 0.
Where:
Xis a random value that follows the t-distribution.
Usage notes
If df is not an integer, it is truncated.
The following are invalid conditions:
Either probability or df is nonnumeric.
Probability < 0 or probability > 1.
df < 1.
Kurtosis
Returns the kurtosis, or relative flatness, of the values in a given set of data.Kurtosis
characterizes the relative peakedness or flatness of a distribution when compared to a
normal distribution. A positive kurtosis indicates a relatively peaked distribution, while a
negative one signifies a relatively flat distribution.
Syntax
Kurtosis <FactID> (Argument)
Where:
Argument is a set of values represented by a fact or metric.
FactID is a parameter that forces a calculation to take place on a fact table that
contains the selected fact.
Expression
In the expression that follows, s is the sample standard deviation.
LognormalDistribution
Returns the lognormal cumulative distribution of a random variable X, where the
logarithm of X is normally distributed. LognormalDistribution takes mean and
standard deviation as parameters. This function is used to analyze data that has been
logarithmically transformed.
Syntax
LognormalDistribution(x, Mean, Stdev)
Where:
x is the value at which the function is evaluated.
Mean is the mean of ln(x).
Stdev is the standard deviation of ln(x).
Expression
In the expression that follows, mean = , stdev = .
Usage notes
The following are invalid conditions:
One of the arguments is nonnumeric.
x 0.
stdev 0.
MeanTTest returns the p-value for the hypothesis test in the following form:
For H0:
(Argument) =
For H1:
NegativeBinomialDistribution
This function determines the probability that there will be F failures before the Nth
success (S) with a constant probability of success P. The negative binomial distribution is
similar to the binomial distribution, but the number of successes is fixed and the number
of trials is variable.
As in the binomial distribution, trials are assumed to be independent. For example, to
find ten individuals with excellent reflexes, knowing that the probability that a candidate
has these qualifications is 0.3, this function calculates the probability that a certain
number of unqualified candidates will be interviewed before the ten people sought are
selected.
Syntax
NegativeBinomialDistribution(F, S, P)
Where:
Usage notes
If either F or S is not an integer, it is truncated.
The following are invalid conditions:
One of the arguments is nonnumeric.
P< 0 or P> 1.
F + (S - 1) 0.
Usage notes
The following are invalid conditions:
Either mean or stdev is nonnumeric.
Stdev 0.
If mean = 0 and stdev = 1, the function returns the standard normal distribution.
Definition
P-value = Pr[Reject H0| H0 is correct]
PairedTTest returns the P-value for the hypothesis test in the following form:
H0:
Usage notes
The following are invalid conditions:
Either Argument1 or Argument2 contains one or more null values.
Argument1 and Argument2 contain a different number of data points.
Permut (permutation)
Returns the number of possible permutations for a given number of items selected as a
group from a set.In permutation calculations, the internal order of the items selected
affects the return. This differs from calculations of combinations, in which the order of
the items selected does not affect the return. Combination (Combine) is categorized as a
mathematical function.
Syntax
Permut(Number, NumberChosen)
Where:
Number is the number of items in a set.
NumberChosen is the number of items selected for permutation.
Expression
In the expression that follows, Number = n; NumberChosen = k.
Usage notes
If an argument is not an integer, it is truncated.
This function returns an error value if:
Either argument is nonnumeric.
Number < 0.
NumberChosen < 0.
Number< NumberChosen.
PoissonDistribution
Returns the Poisson distribution of a random variable. This function predicts the number
of identified events to take place over a specified period. For example, it can predict the
number of cars to arrive at a toll plaza in a one-minute interval.
Syntax
PoissonDistribution <Cumulative> (x, lambda)
Where:
x is the number of events in the prediction.
lambda is the expected numeric value of the expression.
For type = 0:
Usage notes
If x is not an integer, it is truncated.
The following are invalid conditions:
x or lambda is nonnumeric.
x < 0.
lambda 0.
Usage notes
The following are invalid conditions:
Argument1 and Argument2 have a different number of values.
Either Argument1 or Argument2 contains one or more NULL values.
Skew
Returns the skewness of a data set in a given list of values. Skewness is the degree of
asymmetry of a distribution in relation to its mean. A positive skewness indicates
asymmetry biased towards positive values, while a negative skewness indicates the
opposite.
Syntax
Skew <FactID> (Argument)
Where:
Argument is a fact or metric representing a list of values.
FactID is a parameter that forces a calculation to take place on a fact table that
contains the selected fact.
Expression
In the expression that follows, s is the sample standard deviation.
Usage notes
The following are invalid conditions:
Either Argument1 or Argument2 contains NULL values.
Argument1 and Argument2 have a different number of values.
Example
For an example using the Slope function, see Hypothesis Testing example, page 72.
Standardize
Returns a normalized value from a distribution characterized by a mean and standard
deviation.
Syntax
Standardize(x, Mean, Stdev)
Where:
x is the value you want to normalize.
Mean is the arithmetic mean of the distribution.
Stdev is the standard deviation of the distribution.
Expression
Usage notes
The following is an invalid condition:
Stdev 0
Where:
Argument is a metric representing a list of numbers.
Expression
Usage notes
This function results in an invalid value if Argument is nonnumeric.
Usage notes
If an argument value contains text, logical values, or empty cells, those values are
ignored; however, cells with the value zero are included.
It is an invalid condition for Y and X to be empty or have a different number of data
points.
TDistribution
Returns the right-tailed distribution of a random variable.This function can be used in
lieu of a table of critical values to test hypotheses on small sample sets.
Syntax
TDistribution(x, df)
Where:
x is the numeric value at which the distribution is evaluated.
df is a value that indicates the degrees of freedom of the distribution.
Expression
Where:
X is a random value that follows the t-distribution.
Usage notes
If df is not an integer, it is truncated.
The following are invalid conditions:
Either x or df is nonnumeric.
df < 1.
Trend
The Trend function uses data recorded for certain time intervals to calculate and display
the expected value of data for an unknown time period. This is most commonly used to
predict future metric values based on historical data. For example, based on revenue data
for three years, you want to predict what your Revenue will be for the coming year.
This function uses a linear equation to predict future values. Therefore, it is best suited to
predict values that increase or decrease in a linear trend. For example, if your profits are
increasing by $10,000 each year, this is a scenario that is well suited for a prediction
based on a linear equation.
For a function that predicts values in a similar way for data that is increasing or
decreasing exponentially, see GrowthV (growth, vector input), page 348.
Syntax
Trend <FactID>(KnownData1,...,KnownDataN,
FutureTimeOffset)
Where:
KnownData1,...,KnownDataN are separate scalar values that provide the data to
use to predict a future value for. While you can use Trend to enter these values
manually, it is more common to use TrendV which can use a metric to enter a list of
values, as described in TrendV (trend, vector input), page 370.
FutureTimeOffset is the point in time after the final time interval available for
which to predict the data. This is commonly defined as an integer. For example, to
predict values for the year 2009 when the last available data you have is for 2007,
you would enter the value of 2 for FutureTimeOffset.
FactID is a parameter that forces a calculation to take place on a fact table that
contains the selected fact.
Example
As described in the syntax requirements, you can use Trend to enter values manually.
However, it is more common to use TrendV to use metrics and attributes to enter this
information, as described in TrendV (trend, vector input), page 370.
You can use TrendV to predict values for any point in time, including dates that
have known data. However, this type of function is meant for predicting future,
unknown values.
This function uses a linear equation to predict future values. Therefore, it is best suited to
predict values that increase or decrease in a linear trend. For example, if your profits are
increasing by $10,000 each year, this is a scenario that is well suited for a prediction
based on a linear equation.
For a function that predicts values in a similar way for data that is increasing or
decreasing exponentially, see GrowthV (growth, vector input), page 348.
Syntax
TrendV <FactID, SortBy>(KnownData, FutureTimeOffset)
Where:
KnownData is an object representing a list of values. This list of values is the known
data to use to predict a future value for. KnownData is commonly used for metrics
that represent data such as revenue, profit, and so on.
FutureTimeOffset is the point in time after the final time interval available for
which to predict the data. This is commonly defined as an integer. For example, to
predict values for the year 2009 when the last available data you have is for 2007,
you would enter the value of 2 for FutureTimeOffset.
The TrendV function assumes that data is available for sequential time intervals with
no missing data. If your data meets these requirements, this allows you to use a
single expression to use on reports with varying time intervals such as year, month,
quarter, and so on. This is an advantage of TrendV in relation to ForecastV,
which requires you to specify a time interval such as year for each expression. For an
example, see the examples described below.
FactID is a parameter that forces a calculation to take place on a fact table that
contains the selected fact.
SortBy is a parameter that defines the order of calculation. For more information,
see BreakBy and SortBy parameters, page 33.
Example
The TrendV function is useful to display predicted future values of a metric as a subtotal
of the metric on a report.
For example, in the MicroStrategy Tutorial project a new subtotal named 2008 Trend
can be created with the following definition:
TrendV(x, 1)
Since this is in a subtotal, the x is a placeholder for a metric. When a subtotal is applied
to a metric on a report, the placeholder inputs that metrics values.
Also, 1 is used as the offset in the time interval to predict data for the first time interval
that is not known.
After making the new custom subtotal available for the Revenue metric (see the
Advanced Reporting Guide for steps to make custom subtotals available for metrics) a
report with the attribute Year and the metric Revenue is created. When the 2008 Trend
is displayed on the report, it displays the predicted value for 2008 Revenue, as shown
below:
This value is the same value predicted in the example using ForecastV, as described in
ForecastV (forecast, vector input), page 344. The advantage of using TrendV is that
since you do not have to define the attribute or other object that defines the time
interval, you can switch the time interval used by modifying the report. For example, the
report can be modified to display Quarter instead of Year, which allows the 2008 Trend
subtotal to predict the revenue for the first quarter of 2008. This is shown in the report
below.
The type of subtotal shown above could also be created using ForecastV, but it
would require you to create a separate subtotal that used the Quarter attribute to
define the time intervals.
Definition
P-value = Pr[Reject H0| H0 is correct]
VarTest returns the P-value for the hypothesis test in the following form:
H0:
(Argument) =
H1:
Syntax
VarTest <Hypothesis Type> (Argument, Hypothesis Variance)
Where:
Hypothesis Type is the parameter to set whether you are testing the probability
of the value being equal (0), less than (-1), greater than (1), or not equal to (2) the
sigma or variance.
Argument is a fact or metric representing the values you are testing.
HypothesisVariance is the variance you are testing.
Example
VarTest(M1, 1000) = 1000
For a set of values (M1), what is the probability that the variance of the value will be
equal to 1000? Note that M1 needs to have a defined dimensionality.
Usage notes
For each variance test function, two tests are performed. The first tests the probability of
the value being equal (0), and the second tests the probability of the value being less than
(-1), greater than (1), or not equal to (2) the sigma or variance. A parameter must be
specified for the second test.
WeibullDistribution
Returns either the cumulative distribution or the probability density of a random
variable. Used in reliability analysis, such as the calculation of the mean time to failure
for a given device.
Syntax
WeibullDistribution <Cumulative> (x, Alpha, Beta)
Where:
x is the numeric value at which the distribution is evaluated.
Alpha is a distribution parameter.
Beta is a distribution parameter.
Cumulative is a logical value that determines the form of the function:
If Cumulative=0 (default), it returns the cumulative distribution.
Usage notes
The following are invalid conditions:
alpha or beta is nonnumeric.
x < 0.
alpha < 0.
beta < 0.
Greatest
Last
Least
Max
Median
Min
Mode
Multiply
Product
Stdev
StdevP
Sum
Var
VarP
Date and time functions All date and time functions are supported by the
MicroStrategy Analytical Engine
Internal functions Banding
BandingC
BandingP
Case
CaseV
Null and Zero functions IsNotNull
IsNull
NullToEmpty
NullToZero
ZeroToNull
OLAP functions ExpWghMovingAvg
ExpWghRunningAvg
FirstInRange
Lag
LastInRange
Lead
MovingAvg
MovingCount
MovingDifference
MovingMax
MovingMin
MovingStdev
MovingStdevP
MovingSum
OLAPAvg
OLAPCount
OLAPMax
OLAPMin
OLAPSum
RunningAvg
RunningCount
RunningMax
RunningMin
RunningStdev
RunningStdevP
RunningSum
Rank and NTile functions NTile
NTileSize
NTileValue
NTileValueSize
Percentile
Rank
String functions Concat
ConcatBlank
InitCap
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Upper
Arithmetic operators All Arithmetic functions are supported by the
MicroStrategy Analytical Engine
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
Data mining functions All data mining functions are supported by the MicroStrategy
Analytical Engine.
Financial functions All financial functions are supported by the MicroStrategy
Analytical Engine.
Mathematical functions All mathematical functions are supported by the
MicroStrategy Analytical Engine.
Statistical functions All statistical functions are supported by the MicroStrategy
Analytical Engine.
Actian Vectorwise
The tables listed below describe the MicroStrategy function support for Actian
Vectorwise databases:
Actian Vectorwise 2.5, page 380
Actian Vectorwise 3.0, page 385
StdevP
Sum
Var
VarP
Date and time functions AddDays
AddMonths
CurrentDate
CurrentDateTime
CurrentTime
Date
DayOfMonth
DayOfWeek
DayOfYear
DaysBetween
Hour
MilliSecond
Minute
Month
MonthEndDate
MonthsBetween
MonthStartDate
Quarter
Second
Week
Year
YearEndDate
YearStartDate
Internal functions Banding
BandingC
Null and Zero functions IsNotNull
IsNull
NullToZero
ZeroToNull
Not Between
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
Data mining functions None
Financial functions None
Covariance
Intercept
RSquare
Slope
InitCap
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Upper
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
Data mining functions None
Financial functions None
Covariance
Intercept
RSquare
Slope
Aster Database
The tables listed below describe the MicroStrategy function support for Aster Databases:
Aster Database 4.6.x, page 390
Databases that a function can be evaluated on, page 379
Aster Database 5.1.x, page 399
MovingMin
MovingSum
RunningAvg
RunningCount
RunningMax
RunningMin
RunningSum
Rank and NTile functions Rank
String functions Concat
InitCap
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Upper
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
Data mining functions None
Financial functions None
Average
Avg
Count
GeoMean
Greatest
Least
Max
Min
Multiply
Stdev
StdevP
Sum
Var
VarP
MovingMin
MovingSum
RunningAvg
RunningCount
RunningMax
RunningMin
RunningSum
Rank and NTile functions Rank
String functions Concat
InitCap
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Upper
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
Data mining functions None
Financial functions None
Average
Avg
Count
GeoMean
Greatest
Least
Max
Min
Multiply
Stdev
StdevP
Sum
Var
VarP
MovingMin
MovingSum
RunningAvg
RunningCount
RunningMax
RunningMin
RunningSum
Rank and NTile functions Rank
String functions Concat
InitCap
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Upper
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
Data mining functions None
Financial functions None
Calpont InfiniDB
The tables listed below describe the MicroStrategy function support for Calpont InfiniDB
databases:
Calpont InfiniDB 2.2.x, page 405
Calpont InfiniDB 3.x, page 410
InitCap
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Upper
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
Data mining functions None
Financial functions None
InitCap
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Upper
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
Data mining functions None
Financial functions None
EXASolution
The tables listed below describe the MicroStrategy function support for EXASolution
databases:
EXASolution 4.x, page 415
EXASolution 4.x
MovingMin
MovingSum
RunningAvg
RunningCount
RunningMax
RunningMin
RunningSum
Rank and NTile functions Rank
String functions Concat
InitCap
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
Data mining functions None
Financial functions None
Greenplum
The tables listed below describe the MicroStrategy function support for Greenplum
databases:
Greenplum 4.x, page 420
Greenplum 4.x
InitCap
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Upper
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
Data mining functions None
Financial functions None
Hadoop Hive
The tables listed below describe the MicroStrategy function support for Hadoop Hive
databases:
Hadoop Hive, page 425
Hadoop Hive
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
HP Vertica
The tables listed below describe the MicroStrategy function support for HP Vertica
databases:
HP Vertica 5.1
MovingStdev
MovingSum
OLAPAvg
OLAPCount
OLAPMax
OLAPMin
OLAPRank
OLAPSum
RunningAvg
RunningCount
RunningMax
RunningMin
RunningStdev
RunningStdevP
RunningSum
Rank and NTile functions Rank
String functions Concat
ConcatBlank
InitCap
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Upper
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
HP Vertica 6.x
MovingStdev
MovingSum
OLAPAvg
OLAPCount
OLAPMax
OLAPMin
OLAPRank
OLAPSum
RunningAvg
RunningCount
RunningMax
RunningMin
RunningStdev
RunningStdevP
RunningSum
Rank and NTile functions Rank
String functions Concat
ConcatBlank
InitCap
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Upper
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
IBM DB2
The tables listed below describe the MicroStrategy function support for IBM DB2
databases:
DB2 V9.5 for Linux, UNIX, and Windows, page 439
MovingCount
MovingMax
MovingMin
MovingStdev
MovingStdevP
MovingSum
OLAPAvg
OLAPCount
OLAPMax
OLAPMin
OLAPRank
OLAPSum
RunningAvg
RunningCount
RunningMax
RunningMin
RunningStdev
RunningStdevP
RunningSum
Rank and NTile functions Rank
String functions Concat
ConcatBlank
InitCap
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Upper
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
Covariance
Intercept
RSquare
Slope
MovingCount
MovingMax
MovingMin
MovingStdev
MovingStdevP
MovingSum
OLAPAvg
OLAPCount
OLAPMax
OLAPMin
OLAPRank
OLAPSum
RunningAvg
RunningCount
RunningMax
RunningMin
RunningStdev
RunningStdevP
RunningSum
Rank and NTile functions Rank
String functions Concat
ConcatBlank
InitCap
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Upper
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
Covariance
Intercept
RSquare
Slope
MovingCount
MovingMax
MovingMin
MovingStdev
MovingStdevP
MovingSum
OLAPAvg
OLAPCount
OLAPMax
OLAPMin
OLAPRank
OLAPSum
RunningAvg
RunningCount
RunningMax
RunningMin
RunningStdev
RunningStdevP
RunningSum
Rank and NTile functions Rank
String functions Concat
ConcatBlank
InitCap
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Upper
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
Covariance
Intercept
RSquare
Slope
MovingCount
MovingMax
MovingMin
MovingStdev
MovingStdevP
MovingSum
OLAPAvg
OLAPCount
OLAPMax
OLAPMin
OLAPRank
OLAPSum
RunningAvg
RunningCount
RunningMax
RunningMin
RunningStdev
RunningStdevP
RunningSum
Rank and NTile functions Rank
String functions Concat
ConcatBlank
InitCap
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Upper
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
Covariance
Intercept
RSquare
Slope
ConcatBlank
InitCap
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Upper
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
Data mining functions None
Financial functions None
ConcatBlank
InitCap
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Upper
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
Data mining functions None
Financial functions None
IBM Informix
The tables listed below describe the MicroStrategy function support for IBM Informix
databases:
IBM Informix IDS 11.5 and Informix Ultimate Edition 11.7, page 473
IBM Informix Ultimate Edition 12.1, page 477
IBM Informix XPS 8.x, page 481
InitCap
LeftStr
Length
Lower
LTrim
RightStr
RTrim
SubStr
Trim
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Multiply
Stdev
Sum
Var
Date and time functions AddDays
AddMonths
CurrentDate
CurrentDateTime
CurrentTime
Date
DayOfMonth
DayOfWeek
DayOfYear
DaysBetween
Hour
MilliSecond
Minute
Month
MonthEndDate
MonthsBetween
MonthStartDate
Quarter
Second
Year
YearEndDate
YearStartDate
Internal functions Banding
BandingC
Coalesce
Null and Zero functions IsNotNull
IsNull
NullToZero
ZeroToNull
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
Data mining functions None
Financial functions None
Multiply
Stdev
Sum
Var
Date and time functions AddDays
AddMonths
CurrentDate
CurrentDateTime
CurrentTime
Date
DayOfMonth
DayOfWeek
DayOfYear
DaysBetween
Hour
MilliSecond
Minute
Month
MonthEndDate
MonthsBetween
MonthStartDate
Quarter
Second
Year
YearEndDate
YearStartDate
Internal functions Banding
BandingC
Coalesce
Null and Zero functions IsNotNull
IsNull
NullToZero
ZeroToNull
IBM Netezza
The tables listed below describe the MicroStrategy function support for IBM Netezza
databases:
IBM Netezza 5.0.x, page 486
IBM Netezza 6.0.x, page 492
IBM Netezza 7.0.x, page 498
Lead
MovingAvg
MovingCount
MovingMax
MovingMin
MovingStdev
MovingStdevP
MovingSum
OLAPAvg
OLAPCount
OLAPMax
OLAPMin
OLAPRank
OLAPSum
RunningAvg
RunningCount
RunningMax
RunningMin
RunningStdev
RunningStdevP
RunningSum
Rank and NTile functions Rank
String functions Concat
ConcatBlank
InitCap
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
Data mining functions None
Financial functions None
Covariance
Fisher
Intercept
InverseFisher
Pearson
RSquare
Skew
Slope
Standardize
SteYX
Lead
MovingAvg
MovingCount
MovingMax
MovingMin
MovingStdev
MovingStdevP
MovingSum
OLAPAvg
OLAPCount
OLAPMax
OLAPMin
OLAPRank
OLAPSum
RunningAvg
RunningCount
RunningMax
RunningMin
RunningStdev
RunningStdevP
RunningSum
Rank and NTile functions Rank
String functions Concat
ConcatBlank
InitCap
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
Data mining functions None
Financial functions None
Covariance
Fisher
Intercept
InverseFisher
Kurtosis
Pearson
RSquare
Skew
Slope
Standardize
SteYX
Lead
MovingAvg
MovingCount
MovingMax
MovingMin
MovingStdev
MovingStdevP
MovingSum
OLAPAvg
OLAPCount
OLAPMax
OLAPMin
OLAPRank
OLAPSum
RunningAvg
RunningCount
RunningMax
RunningMin
RunningStdev
RunningStdevP
RunningSum
Rank and NTile functions Rank
String functions Concat
ConcatBlank
InitCap
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
Data mining functions None
Financial functions None
Covariance
Fisher
Intercept
InverseFisher
Kurtosis
Pearson
RSquare
Skew
Slope
Standardize
SteYX
MovingCount
MovingMax
MovingMin
MovingSum
OLAPAvg
OLAPCount
OLAPMax
OLAPMin
OLAPRank
OLAPSum
RunningAvg
RunningCount
RunningMax
RunningMin
RunningSum
Rank and NTile functions Rank
String functions Concat
ConcatBlank
InitCap
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Arithmetic operators -
x
+
/
U-
Infobright
The tables listed below describe the MicroStrategy function support for Infobright
databases:
Infobright 4.0.x, page 508
Infobright 4.0.x
Product
Stdev
StdevP
Sum
Var
VarP
Date and time functions AddDays
AddMonths
CurrentDate
CurrentDateTime
CurrentTime
Date
DayOfMonth
DayOfWeek
DayOfYear
DaysBetween
Hour
Minute
Month
MonthEndDate
MonthsBetween
MonthStartDate
Quarter
Second
Week
Year
YearEndDate
YearStartDate
Internal functions Banding
BandingC
Coalesce
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
Data mining functions None
Financial functions None
Kognitio
The tables listed below describe the MicroStrategy function support for Kognitio
databases:
Kognitio WX2 7.x, page 513
OLAPAvg
OLAPCount
OLAPMax
OLAPMin
OLAPRank
OLAPSum
RunningAvg
RunningCount
RunningMax
RunningMin
RunningStdevP
RunningSum
Rank and NTile functions Rank
String functions Concat
InitCap
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
Data mining functions None
Financial functions None
Maria DB
The tables listed below describe the MicroStrategy function support for Maria DB
databases:
Maria DB 5.5.x, page 518
Maria DB 5.5.x
InitCap
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Upper
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
Data mining functions None
Financial functions None
Microsoft Access
The tables listed below describe the MicroStrategy function support for Microsoft Access
databases:
Microsoft Access 2000, 2002, or 2003, page 523
InitCap
LeftStr
Length
Lower
Position
RightStr
SubStr
Trim
Upper
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Stdev
StdevP
Sum
Var
VarP
Date and time functions AddDays
AddMonths
CurrentDate
CurrentDateTime
CurrentTime
Date
DayOfMonth
DayOfWeek
DayOfYear
DaysBetween
Hour
Millisecond
Minute
Month
MonthEndDate
MonthsBetween
MonthStartDate
Quarter
Second
Year
YearEndDate
YearStartDate
Internal functions Banding
BandingC
Coalesce
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
Data mining functions None
Financial functions None
ConcatBlank
InitCap
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Upper
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
Data mining functions None
Financial functions None
ConcatBlank
InitCap
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Upper
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
Data mining functions None
Financial functions None
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
Data mining functions None
Financial functions None
GeoMean
Max
Min
Multiply
Stdev
StdevP
Sum
Var
VarP
Date and time functions AddDays
AddMonths
CurrentDate
CurrentDateTime
CurrentTime
Date
DayOfMonth
DayOfWeek
DayOfYear
DaysBetween
Hour
MilliSecond
Minute
Month
MonthEndDate
MonthsBetween
MonthStartDate
Quarter
Second
Week
Year
YearEndDate
YearStartDate
Internal functions Banding
BandingC
Coalesce
Null and Zero functions IsNotNull
IsNull
NullToZero
ZeroToNull
OLAP functions Lag
LastInRange
Lead
MovingAvg
MovingCount
MovingMax
MovingMin
MovingStdev
MovingStdevP
MovingSum
OLAPAvg
OLAPCount
OLAPMax
OLAPMin
OLAPRank
OLAPSum
RunningAvg
RunningCount
RunningMax
RunningMin
RunningStdev
RunningStdevP
RunningSum
Rank and NTile functions Rank
String functions Concat
ConcatBlank
InitCap
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Avg
Count
GeoMean
Max
Min
Multiply
Stdev
StdevP
Sum
Var
VarP
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
Data mining functions None
Financial functions None
GeoMean
Max
Min
Multiply
Stdev
StdevP
Sum
Var
VarP
Date and time functions AddDays
AddMonths
CurrentDate
CurrentDateTime
CurrentTime
Date
DayOfMonth
DayOfWeek
DayOfYear
DaysBetween
Hour
MilliSecond
Minute
Month
MonthEndDate
MonthsBetween
MonthStartDate
Quarter
Second
Week
Year
YearEndDate
YearStartDate
Internal functions Banding
BandingC
Coalesce
Null and Zero functions IsNotNull
IsNull
NullToZero
ZeroToNull
OLAP functions OLAPRank
Rank and NTile functions Rank
String functions Concat
ConcatBlank
InitCap
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Upper
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
Data mining functions None
Financial functions None
MySQL
The tables listed below describe the MicroStrategy function support for MySQL
databases:
MySQL 5.x, page 560
MySQL 5.x
InitCap
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Upper
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
Data mining functions None
Financial functions None
Oracle
The tables listed below describe the MicroStrategy function support for Oracle databases:
Oracle 10g, page 565
Oracle 10g
MovingAvg
MovingCount
MovingMax
MovingMin
MovingStdev
MovingStdevP
MovingSum
OLAPAvg
OLAPCount
OLAPMax
OLAPMin
OLAPRank
OLAPSum
RunningAvg
RunningCount
RunningMax
RunningMin
RunningStdev
RunningStdevP
RunningSum
Rank and NTile functions Rank
String functions Concat
ConcatBlank
InitCap
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
Oracle 10gR2
Var
VarP
Date and time functions AddDays
AddMonths
CurrentDate
CurrentDateTime
CurrentTime
Date
DayOfMonth
DayOfWeek
DayOfYear
DaysBetween
Hour
Minute
Month
MonthEndDate
MonthsBetween
MonthStartDate
Quarter
Second
Week
Year
YearEndDate
YearStartDate
Internal functions Banding
BandingC
Coalesce
Null and Zero functions IsNotNull
IsNull
NullToZero
ZeroToNull
OLAP functions FirstInRange
Lag
LastInRange
Lead
MovingAvg
MovingCount
MovingMax
MovingMin
MovingStdev
MovingStdevP
MovingSum
OLAPAvg
OLAPCount
OLAPMax
OLAPMin
OLAPRank
OLAPSum
RunningAvg
RunningCount
RunningMax
RunningMin
RunningStdev
RunningStdevP
RunningSum
Rank and NTile functions Rank
String functions Concat
ConcatBlank
InitCap
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
Data mining functions None
Financial functions None
Fisher
Intercept
InverseFisher
Kurtosis
Pearson
RSquare
Skew
Slope
Standardize
SteYX
Oracle 11g
MovingAvg
MovingCount
MovingMax
MovingMin
MovingStdev
MovingStdevP
MovingSum
OLAPAvg
OLAPCount
OLAPMax
OLAPMin
OLAPRank
OLAPSum
RunningAvg
RunningCount
RunningMax
RunningMin
RunningStdev
RunningStdevP
RunningSum
Rank and NTile functions Rank
String functions Concat
ConcatBlank
InitCap
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
Oracle 11g R2
Var
VarP
Date and time functions AddDays
AddMonths
CurrentDate
CurrentDateTime
CurrentTime
Date
DayOfMonth
DayOfWeek
DayOfYear
DaysBetween
Hour
Minute
Month
MonthEndDate
MonthsBetween
MonthStartDate
Quarter
Second
Week
Year
YearEndDate
YearStartDate
Internal functions Banding
BandingC
Coalesce
Null and Zero functions IsNotNull
IsNull
NullToZero
ZeroToNull
OLAP functions FirstInRange
Lag
LastInRange
Lead
MovingAvg
MovingCount
MovingMax
MovingMin
MovingStdev
MovingStdevP
MovingSum
OLAPAvg
OLAPCount
OLAPMax
OLAPMin
OLAPRank
OLAPSum
RunningAvg
RunningCount
RunningMax
RunningMin
RunningStdev
RunningStdevP
RunningSum
Rank and NTile functions Rank
String functions Concat
ConcatBlank
InitCap
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
Data mining functions None
Financial functions None
Fisher
Intercept
InverseFisher
Kurtosis
Pearson
RSquare
Skew
Slope
Standardize
SteYX
Oracle 12c
MovingAvg
MovingCount
MovingMax
MovingMin
MovingStdev
MovingStdevP
MovingSum
OLAPAvg
OLAPCount
OLAPMax
OLAPMin
OLAPRank
OLAPSum
RunningAvg
RunningCount
RunningMax
RunningMin
RunningStdev
RunningStdevP
RunningSum
Rank and NTile functions Rank
String functions Concat
ConcatBlank
InitCap
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
Actian Matrix
The tables listed below describe the MicroStrategy function support for Actian Matrix
databases:
Multiply
Product
Sum
VarP
Date and time functions AddDays
AddMonths
CurrentDate
CurrentDateTime
CurrentTime
Date
DayOfMonth
DaysBetween
Hour
MilliSecond
Minute
Month
MonthEndDate
MonthsBetween
MonthStartDate
Quarter
Second
Week
Year
YearEndDate
YearStartDate
Internal functions Banding
BandingC
Coalesce
Null and Zero functions IsNotNull
IsNull
NullToZero
ZeroToNull
OLAP functions FirstInRange
Lag
LastInRange
Lead
MovingAvg
MovingCount
MovingMax
MovingMin
MovingSum
OLAPAvg
OLAPCount
OLAPMax
OLAPMin
OLAPRank
OLAPSum
RunningAvg
RunningCount
RunningMax
RunningMin
RunningSum
Rank and NTile functions Rank
String functions Concat
ConcatBlank
InitCap
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
MovingMax
MovingMin
MovingSum
OLAPAvg
OLAPCount
OLAPMax
OLAPMin
OLAPRank
OLAPSum
RunningAvg
RunningCount
RunningMax
RunningMin
RunningSum
Rank and NTile functions Rank
String functions Concat
ConcatBlank
InitCap
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
Data mining functions None
Financial functions None
InverseFisher
Kurtosis
RSquare
Slope
Standardize
MovingMax
MovingMin
MovingSum
OLAPAvg
OLAPCount
OLAPMax
OLAPMin
OLAPRank
OLAPSum
RunningAvg
RunningCount
RunningMax
RunningMin
RunningSum
Rank and NTile functions Rank
String functions Concat
ConcatBlank
InitCap
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
Data mining functions None
Financial functions None
InverseFisher
Kurtosis
RSquare
Slope
Standardize
PostgreSQL
The tables listed below describe the MicroStrategy function support for PostgreSQL
databases:
PostgreSQL 8.4, page 607
PostgreSQL 9.x, page 612
PostgreSQL 8.4
Function type Functions that can be evaluated on the database
PostgreSQL 9.x
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
Data mining functions None
Financial functions None
Salesforce.com
The tables listed below describe the MicroStrategy function support for Salesforce.com
data sources:
Salesforce.com, page 617
Salesforce.com
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
Data mining functions None
Financial functions None
SAND CDBMS
The tables listed below describe the MicroStrategy function support for SAND CDBMS
databases:
SAND CDBMS 6.1, page 621
SAND CDBMS 7.1, page 625
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Upper
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Average
Avg
Count
GeoMean
Max
Median
Min
Multiply
Product
Stdev
Sum
Var
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Upper
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
NotIn
NotLike
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
NotIn
NotLike
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
Sybase
The tables listed below describe the MicroStrategy function support for SAP Sybase
databases:
SAP Sybase ASE 15.x, page 639
SAP Sybase IQ 15.2, page 643
SAP Sybase IQ 15.3, page 648
SAP Sybase IQ 15.4, page 653
SAP Sybase IQ 16.0, page 658
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Max
Median
Min
Multiply
Stdev
Sum
Var
VarP
Date and time functions AddDays
AddMonths
CurrentDate
CurrentDateTime
CurrentTime
Date
DayOfMonth
DayOfWeek
DayOfYear
DaysBetween
Hour
MilliSecond
Minute
Month
MonthEndDate
MonthsBetween
MonthStartDate
Quarter
Second
Week
Year
YearEndDate
YearStartDate
Internal functions Banding
BandingC
Coalesce
Null and Zero functions IsNotNull
IsNull
NullToZero
ZeroToNull
OLAP functions FirstInRange
Lag
LastInRange
Lead
MovingAvg
MovingCount
MovingMax
MovingMin
MovingStdev
MovingSum
OLAPAvg
OLAPCount
OLAPMax
OLAPMin
OLAPRank
OLAPSum
RunningAvg
RunningCount
RunningMax
RunningMin
RunningStdev
RunningSum
Rank and NTile functions Rank
String functions Concat
ConcatBlank
InitCap
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
GeoMean
Max
Median
Min
Multiply
Stdev
Sum
Var
VarP
Date and time functions AddDays
AddMonths
CurrentDate
CurrentDateTime
CurrentTime
Date
DayOfMonth
DayOfWeek
DayOfYear
DaysBetween
Hour
MilliSecond
Minute
Month
MonthEndDate
MonthsBetween
MonthStartDate
Quarter
Second
Week
Year
YearEndDate
YearStartDate
Internal functions Banding
BandingC
Coalesce
Null and Zero functions IsNotNull
IsNull
NullToZero
ZeroToNull
OLAP functions FirstInRange
Lag
LastInRange
Lead
MovingAvg
MovingCount
MovingMax
MovingMin
MovingStdev
MovingSum
OLAPAvg
OLAPCount
OLAPMax
OLAPMin
OLAPRank
OLAPSum
RunningAvg
RunningCount
RunningMax
RunningMin
RunningStdev
RunningSum
Rank and NTile functions Rank
String functions Concat
ConcatBlank
InitCap
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
GeoMean
Max
Median
Min
Multiply
Stdev
Sum
Var
VarP
Date and time functions AddDays
AddMonths
CurrentDate
CurrentDateTime
CurrentTime
Date
DayOfMonth
DayOfWeek
DayOfYear
DaysBetween
Hour
MilliSecond
Minute
Month
MonthEndDate
MonthsBetween
MonthStartDate
Quarter
Second
Week
Year
YearEndDate
YearStartDate
Internal functions Banding
BandingC
Coalesce
Null and Zero functions IsNotNull
IsNull
NullToZero
ZeroToNull
OLAP functions FirstInRange
Lag
LastInRange
Lead
MovingAvg
MovingCount
MovingMax
MovingMin
MovingStdev
MovingSum
OLAPAvg
OLAPCount
OLAPMax
OLAPMin
OLAPRank
OLAPSum
RunningAvg
RunningCount
RunningMax
RunningMin
RunningStdev
RunningSum
Rank and NTile functions Rank
String functions Concat
ConcatBlank
InitCap
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
GeoMean
Max
Median
Min
Multiply
Stdev
Sum
Var
VarP
Date and time functions AddDays
AddMonths
CurrentDate
CurrentDateTime
CurrentTime
Date
DayOfMonth
DayOfWeek
DayOfYear
DaysBetween
Hour
MilliSecond
Minute
Month
MonthEndDate
MonthsBetween
MonthStartDate
Quarter
Second
Week
Year
YearEndDate
YearStartDate
Internal functions Banding
BandingC
Coalesce
Null and Zero functions IsNotNull
IsNull
NullToZero
ZeroToNull
OLAP functions FirstInRange
Lag
LastInRange
Lead
MovingAvg
MovingCount
MovingMax
MovingMin
MovingStdev
MovingSum
OLAPAvg
OLAPCount
OLAPMax
OLAPMin
OLAPRank
OLAPSum
RunningAvg
RunningCount
RunningMax
RunningMin
RunningStdev
RunningSum
Rank and NTile functions Rank
String functions Concat
ConcatBlank
InitCap
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Teradata
The tables listed below describe the MicroStrategy function support for Teradata
databases:
Teradata 12, page 664
Teradata 13, page 669
Teradata 13.10, page 674
Teradata 14.0, page 679
Teradata 14.10, page 684
Teradata 12
MovingMin
MovingStdev
MovingSum
OLAPAvg
OLAPCount
OLAPMax
OLAPMin
OLAPRank
OLAPSum
RunningAvg
RunningCount
RunningMax
RunningMin
RunningStdev
RunningStdevP
RunningSum
Rank and NTile functions Rank
String functions Concat
ConcatBlank
InitCap
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
Covariance
Fisher
Intercept
InverseFisher
Kurtosis
Pearson
RSquare
Skew
Slope
Standardize
SteYX
Teradata 13
MovingMin
MovingStdev
MovingSum
OLAPAvg
OLAPCount
OLAPMax
OLAPMin
OLAPRank
OLAPSum
RunningAvg
RunningCount
RunningMax
RunningMin
RunningStdev
RunningStdevP
RunningSum
Rank and NTile functions Rank
String functions Concat
ConcatBlank
InitCap
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
Covariance
Fisher
Intercept
InverseFisher
Kurtosis
Pearson
RSquare
Skew
Slope
Standardize
SteYX
Teradata 13.10
MovingMin
MovingStdev
MovingSum
OLAPAvg
OLAPCount
OLAPMax
OLAPMin
OLAPRank
OLAPSum
RunningAvg
RunningCount
RunningMax
RunningMin
RunningStdev
RunningStdevP
RunningSum
Rank and NTile functions Rank
String functions Concat
ConcatBlank
InitCap
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
Covariance
Fisher
Intercept
InverseFisher
Kurtosis
Pearson
RSquare
Skew
Slope
Standardize
SteYX
Teradata 14.0
MovingCount
MovingMax
MovingMin
MovingStdev
MovingSum
OLAPAvg
OLAPCount
OLAPMax
OLAPMin
OLAPRank
OLAPSum
RunningAvg
RunningCount
RunningMax
RunningMin
RunningStdev
RunningStdevP
RunningSum
Rank and NTile functions Rank
String functions Concat
ConcatBlank
InitCap
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
Teradata 14.10
MovingCount
MovingMax
MovingMin
MovingStdev
MovingSum
OLAPAvg
OLAPCount
OLAPMax
OLAPMin
OLAPRank
OLAPSum
RunningAvg
RunningCount
RunningMax
RunningMin
RunningStdev
RunningStdevP
RunningSum
Rank and NTile functions Rank
String functions Concat
ConcatBlank
InitCap
LeftStr
Length
Lower
LTrim
Position
RightStr
RTrim
SubStr
Trim
Arithmetic operators -
x
+
/
U-
Comparison operators <
<=
<>
=
>
>=
Begins With
Between
Contains
Ends With
In
Like
Not Begins With
Not Between
Not Contains
Not Ends With
Not In
Not Like
Comparison operators for rank *<=
*<>
*=
*>=
*Between
Not*Between
Logical operators AND
IF
Not
Or
account
Creates a relationship between access privileges and user login credentials.
Account permissions are based on granted roles, and each role has specific
privileges. See also: application administrator, application designer, subscription
administrator, system administrator.
Activation Code
A code used to activate MicroStrategy Intelligence Server after installation. This
code is sent to an email address provided during activation.
ad hoc query
A SQL query dynamically constructed by desktop tools and whose results are not
known before it is sent to the server. The user is asking a new question that has
not been answered by an existing report.
address
Set of information that tells Narrowcast Server how to send services to a
particular subscriber. Each address can be associated with one and only one
login/user. Each address is defined to use a specific device. See also: device.
address display
A name that is displayed by receiving systems. For email delivery, the address
display is used to identify the email address. For example,
johnsmith@microstrategy-tutorial.demo might be displayed as Smith, John by
the receiving email client.
address ID
An ID value that identifies individual addresses. Each address can be subscribed
to a subscription set multiple times.
administration object
Narrowcast Server components that control the processing of Narrowcast
messages, providing the means to acquire, format, and transmit messages to
recipients. These objects are created and configured by the system administrator.
administrator
A user who installs and monitors software and user configurations, maintains
the state of the software, and administers the MicroStrategy servers in the
platform. An administrator also defines users, assigns user login accounts and
user privileges, and analyzes the performance of the system.
aggregate data
Information or facts added together or "aggregated" to form summaries of
information considered as a whole.
aggregate function
A numeric function that acts on a column of data and produces a single result.
Examples include SUM, COUNT, MAX, MIN, and AVG.
aggregate table
A fact table that stores data that has been aggregated along one or more
dimensions.
analyst
A user who analyzes business data by accessing reports, performing drilling, and
otherwise manipulating reports and documents to see required business data. An
analyst receives useful data from information devices like smart phones and
email without necessarily understanding how such information is derived or
delivered.
analytical application
In MicroStrategy, a software application designed to provide predefined reports
and other analytics based on a predefined metadata repository, for various
industries to gain insight into their business data. The application is not fixed to a
specific physical schema, giving it the flexibility to be ported to a company's
existing data warehouse.
Analytical Engine
A component of the MicroStrategy Intelligence Server that performs all
advanced analytical functions. The Analytical Engine evaluates functions not
supported by the data warehouse RDBMS and it cross-tabulates reports.
analytics
Predefined tools that allow analysis within the Analysis Module's functional
areas. Analytics include reports (graph, grid, and so on), scorecards, dashboards,
and so on.
analytics library
The collection of reports and related objects in the MicroStrategy metadata
repository. Library objects include reports, metrics, filters, and prompts. Library
objects are defined based on attributes and facts (objects in the logical data
model.)
application administrator
Narrowcast Administrator user role. This role is designed for a Narrowcast
Administrator console user who performs some of the same tasks as the
application designer but has the ability to modify application objects created by
any Narrowcast Administrator account. This role is intended for quality
managers, development managers, configuration managers, and other users
requiring full access to all application objects. See also: application designer.
application designer
A Narrowcast Administrator user role. This role is designed for a Narrowcast
Administrator console user who develops and tests services, which include
documents, publications, schedules, and subscription sets. Configures and
manages Subscription Portals that allow end users to subscribe to a variety of
Narrowcast services via the Web. Configures data sources, content, and portal
layout. Publishes services and device types, and selects default devices for
Subscription Portals. Specifies information source properties and default site
preferences. Installs, configures, and administers the development environment.
Administers subscribers and subscriptions for development and testing purposes.
See also: application administrator.
application object
MicroStrategy object used to provide analysis of and insight into relevant data.
Application objects are developed in MicroStrategy Developer and they are the
building blocks for reports and documents. Application objects include these
object types: report, document, template, filter, metric, custom group,
consolidation, prompt.
attachment
Any file that is included in an email message. Attachments can originate from
outside Narrowcast Server (that is, any pre-existing file can be sent as part of a
service) or can be created by Narrowcast Server (that is, Narrowcast Server can
create an Excel attachment on the fly).
attribute
A data level defined by the system architect and associated with one or more
columns in a data warehouse lookup table. Attributes include data classifications
like Region, Order, Customer, Age, Item, City, and Year. They provide a means
for aggregating and filtering at a given level.
attribute element
A value of any of the attribute forms of an attribute. For example, New York and
Dallas are elements of the attribute City; January, February, and March are
elements of the attribute Month.
attribute form
One of several columns associated with an attribute that are different aspects of
the same thing. Every attribute supports its own collection of forms.
attrition rate
The number of lost employees divided by the number of employees in a given
time period.
authentication object
Object used by an information source that specifies who the user is and the
security context within which that user will interact with that information
source. Contains the security information required to make a connection or
perform task execution. Depending on the information source module, it should
contain information such as the user login name and password. For a
MicroStrategy Information Source, the object is a MicroStrategy user. See also:
personalization object.
autostyle
A set of predefined formatting that can be easily applied to many reports in
either MicroStrategy Developer or MicroStrategy Web. Autostyles are a good way
to apply a corporate look and feel to reports.
axes (axis)
(1) A vector along which data is displayed. There are three axesRow, Column,
and Page. When a user defines a template for a report, he places template units
attributes, dimensions, metrics, consolidations, and custom groupsalong each
axis. (2) One part of a multi-part graphical diagram. Many SDAM reports display
data on more than one graphical axis, such as the Quotation Activity Summary
report and the Quarterly Conversion Summary report.
banding
A method of organizing values according to a set of descriptive or meaningful
data ranges called buckets. Banding is also used for display purposes, where every
other row is a different color and the two colors alternate. Compare:
consolidation.
base table
A fact table that stores data at the lowest level of dimensionality.
block
A logical display element used to control the display of large reports in the
limited page and slide dimensions of Microsoft Word and PowerPoint. A block
may consist of multiple fetches. Blocks are defined by Microsoft Office product-
specific configuration settings.
break by
An attribute or hierarchy where calculations for an OLAP function restart. To
break by an attribute or hierarchy means to restart calculations that use OLAP,
or Relative, functions when the analytical engine reaches the next instance of
the specified attribute or hierarchy. Examples of OLAP functions include
RunningStdevP, Rank, NTile, and various expressions that calculate percent
values. To break by an attribute or hierarchy in an expression, you must set the
BreakBy parameter.
cache
A special data store holding recently accessed information for quick future
access. This is normally done for frequently requested reports, whose execution
is faster because they need not run against the database. Results from the data
warehouse are stored separately and can be used by new job requests that require
the same data. In the MicroStrategy environment, when a user runs a report for
the first time, the job is submitted to the database for processing. However, if the
results of that report are cached, the results can be returned immediately without
having to wait for the database to process the job the next time the report is run.
caching
A special data storage method in which recently accessed values are stored for
quick future access. Caching is used primarily to improve report execution
performance.
calculated expression
A metric obtained dynamically, directly from metrics on a document dataset, by
using at least one of the metrics in the document. Calculated expressions allow
you to use simple arithmetic operators (+, -, *, /) to combine metrics from
different datasets in the document. See also: Derived metric.
catalog
A table that contains the names of all non-temporary tables in a data warehouse.
characteristic attribute
An attribute that is a parent of a child attribute, but not part of the "main"
hierarchy associated with the child attribute. For example, consider a hierarchy
consisting of Year, Month, Day. Day of Week is a parent of Day, and a
characteristic attribute.
child attribute
The lower-level attribute in an attribute relationship. See also: parent attribute or
relationship.
clustering
A way of using machine resources to provide an efficient and robust processing
environment for a Narrowcast Server system. A cluster consists of two or more
machines, each machine running at least one Narrowcast Server component.
These components are: MicroStrategy Logging Server, distribution manager
(DM), execution engine (EE).
column
(1) A one-dimensional vertical array of values in a table. (2) The set of fields of a
given name and datatype in all rows of a given table. (3) MicroStrategy object in
the schema layer that can represent one or more physical table columns or no
columns.
component
A computing unit that provides a specific piece of the Narrowcast Server
functionality and interacts with other components. Examples are the Narrowcast
Administrator, execution engine, distribution manager, MicroStrategy Logging
Server, Object Repository, and Subscription Book Repository.
compound metric
A metric that cannot have a level placed on the entire metric, although it can be
set separately on each of the components.
conditional formatting
A method used to format specified controls in a document depending on
predefined criteria. It allows certain properties of controls, including sections, to
be controlled by data-driven conditions.
conditional metric
A metric containing filter criteria in its definition.
conditionality
Conditionality of a metric enables you to associate an existing filter object with
the metric so that only data that meets the filter conditions is included in the
calculation.
configuration objects
A MicroStrategy object appearing in the system layer and usable across multiple
projects. Configuration objects include (among others) these object types: users,
database instances, database logins, schedules.
connection string
Stores the information required to connect to a database server. A connection
string usually includes a DSN and the user ID and password required to log in to
the database server. This information varies depending on the particular database
server.
console user
A user who works with the Narrowcast Administrator console, managing
subscriptions, developing services, and administering the system, in contrast to
an end user. See also: end user.
consolidation
An object that can be placed on a template and is made up of an ordered
collection of elements called consolidation elements. Each element is a grouping
of attribute elements that accommodates inter-row arithmetic operations.
Compare: custom group.
content
The information in services, including all reports, miscellaneous text, and file
attachments that are accessible to the user. Content is dynamic in the sense that
personalization, error handling conditions, and device settings all influence the
overall content output and format of each service.
control
Any item in the documents Layout area that you can select. This can be a text
field, line, rectangle, image, panel stack, selector, Grid/Graph, or HTML
container. These different kinds of controls are referred to as control types. See
also: Grid/Graph, HTML container, Panel stack, Selector, Text field.
control default
A set of options that can be set for each type of control and each section in a
document. You can set the defaults according to the control that is currently
selected; afterward, its format is applied to any object of the same type that you
create in the document.
custom group
An object that can be placed on a template and is made up of an ordered
collection of elements called custom group elements. Each element contains its
own set of filtering qualifications.
custom SQL
Additional SQL code independently created by the user for execution against the
data warehouse. MicroStrategy provides tools to write custom SQL, including
Freeform SQL and Query Builder.
dashboard
An interactive, visually intuitive display of data. A dashboard can summarize key
business indicators (KPIs) to provide a status check. Users can change how they
view the dashboard's data using interactive features, such as selectors, grouping,
widgets, and visualizations. Users can explore their data via multiple paths, using
text, data filtering, and layers of organization. See also: Visual Insight dashboard,
Dashboard-style document.
dashboard-style document
A visually intuitive display of data that summarizes key business indicators for a
quick status check. A special type of document, dashboard-style documents
usually provide interactive features that let users change how they view the
dashboard-style documents data.
Data Explorer
A portion of the interface used to browse through data contained in the
warehouse. Users can navigate through hierarchies of attributes that are defined
by the administrator to find the data they need.
data field
Dynamic text that is populated from a dataset with data that originated in the
data warehouse (or an Intelligence Server cache). A data field is only a reference
to the metric, attribute, consolidation, or custom group on a report. Data fields
are contained in text field controls on a document. See also: Auto text code, Text
field.
data mart
A database, usually smaller than a data warehouse, designed to help managers
make strategic decisions about their business by focusing on a specific subject or
department.
data modeling
A method used to define and analyze data requirements needed to support the
business functions of an enterprise. These data requirements are recorded as a
conceptual data model with associated data definitions. Data modeling defines
the relationships between data elements and data structures.
data source
A data source is any file, system, or storage location which stores data that is to
be used in MicroStrategy for query, reporting, and analysis. A data warehouse
can be thought of as one type of data source, which refers more specifically to
using a database as your data source. Other data sources include text files, Excel
files, and MDX cube sources such as SAP BW, Microsoft Analysis Services,
Oracle Essbase, and IBM Cognos TM1.
data warehouse
A database, typically very large, containing the historical data of an enterprise.
Used for decision support or business intelligence, it organizes data and allows
coordinated updates and loads.
database connection
Stores all database-specific connection information such as DSN, driver mode
and SQL execution mode as well as connection caching information.
database instance
(1) Database server software running on a particular machine. Though it is
technically possible to have more than one instance running on a machine, there
is usually only one instance per machine. (2) The MicroStrategy object that
represents a logical definition of a data warehouse. It stores all information
necessary for MicroStrategy to access the data warehouse for a particular project.
database login
The login ID and password that MicroStrategy Intelligence Server uses to log in
to a particular database on behalf of a user. See also: login ID.
dataset
A MicroStrategy report used to define the data available on a Report Services
document.
Datasets
(1) A pane in the Document Editor that shows all objects (grouped by datasets)
that can be used in the document. (2) All objects that can be used in the
document as supplied by the datasets. Dataset objects are attributes,
consolidations, custom groups, and metrics.
decile(deciling)
The method by which a group is broken up into ten groups of equal elements.
The first decile consists of the top ten percent; the second, the 11th to 20th
percent; the third, the 21st to 30th percent; and so on. demographics,
demographic data. Data that locates, identifies, and describes a population and its
properties; for example, data describing the age groups of people living in certain
geographical areas or income categories. Other dimensions of demographic data
include race, religion, political preference, spending preferences, and family size.
derived attribute
An attribute calculated from a mathematical operation on columns in a
warehouse table. For example, Age can be calculated from the expression
[Current DateBirth Date]. See also: attribute.
derived metric
A metric based on data already available in a report. It is calculated by the
Intelligence Server, not in the database. Use a derived metric to perform
calculations on report data after it has been returned from the database.
description column
Optional columns that contain text descriptions of attribute elements.
device
MicroStrategy object that represents message-receiving technology employed by
end users, such as a mobile phone or tablet. The device object specifies how a
publication should be formatted and transmitted to a specific device type. For
example, an Outlook 98 Device might specify that the first document in the
publication must be plain text and no longer than 128 characters. It might also
specify that the second document could be either plain text or HTML, and if it is
HTML, image references can be embedded. A device includes specifications for
both formatting and transmission. Devices are used in the definition of addresses
to specify what information transmitter will be used to transmit content to those
addresses and how that content should be formatted and packaged. See also:
address, content, information transmitter, administration object.
device ID
Numeric ID value that indicates the delivery method and device that a recipient
prefers. Devices are specified for subscriptions in dynamic subscription sets by
providing the device ID for each recipient. Device IDs are found under the
properties for each device within Narrowcast Administrator. For example, one
subscription might specify Outlook 2000, while another recipient might specify a
mobile device. One subscriber then only receives email content formatted for
Outlook while the other subscriber only receives mobile device content
formatted for this phone.
dimension
An element or factor making up a complete entity or variable (a quantity that
may assume any one of a set of values).
directory server
A directory service provider running on a particular machine. Directory servers
are often part of email servers, and stores user names, addresses, and
authentication information. Unlike the Subscription Book, however, they are
neither intended nor well-suited to store and retrieve subscriptions. Directory
servers usually enable client connections through the lightweight directory
access protocol (LDAP), and are often used for centralized user authentication
across many systems. See also: Subscription Book, Lightweight Directory Access
Protocol (LDAP).
display locale
Controls which object names are shown in Narrowcast Administrator. Since
objects can have multiple names to support end users in more than one
language, one name must be chosen for display in Narrowcast Administrator.
The display locale serves this role. The locale selected for this purpose should be
the one that the Narrowcast Administrator needs to use most frequently when
defining objects. See also: locale, execution locale, selection locale, system locale,
user locale.
distribution set
A schedule and subscription set pair, created during service definition. Specifies
when and to whom Narrowcast Server will send a service. See also: schedule,
subscription set.
document
A display representing data coming from one or more reports, as well as
positioning and formatting information. A Report Services document is used to
format data from multiple reports in a single display of presentation quality.
document (Narrowcast)
A Narrowcast document contains the static information from the document
template and the dynamic content from document elements, and is ready to be
transmitted by Narrowcast Server. Each document has a specific type, such as
HTML, plain text, Excel, or derived from an imported file.
document element
Part of a Narrowcast document containing dynamic content that is generated
when that document is executed as part of a service. Consists of at least one
information object, plus error-handling instructions. Might include an XSL
stylesheet selection, depending on the type of information object chosen.
document formatter
Transforms the raw data of the information objects and the structure of the
Narrowcast document templates into a complete, formatted Narrowcast
document. The operations of document formatters include such tasks as XSL
processing and transformation, XML merging, character replacement, and string
padding. Formatting rules might account for device characteristics, locale
definition, and other recipient-specific formatting control information.
document template
Provides the structure and layout for a Narrowcast document. For example, an
Excel document template includes the basic workbook structure, any predefined
macros, and static worksheet content.
drill
A method of obtaining supplementary information after a report has been
executed. The new data is retrieved by re-querying the Intelligent Cube or
database at a different attribute or fact level.
dynamic content
Document content that is dynamically retrieved at service execution time and
that can be personalized for each message recipient. Dynamic content is created
using content information objects. This content changes depending on the
results returned by the information object and can return different results for
different subscribers. For example, a weekly report returns different information
from week to the next, and each subscriber might request different content in
his report. Examples include a MicroStrategy report, a Web query, a SQL query,
or content from an external system. See also: static content.
editor
A dialog used to create and edit MicroStrategy Objects. There is a Filter Editor,
Template Editor, Attribute Editor, Metric Editor, Report Editor, and so on.
end user
A subscriber, the person receiving messages from Narrowcast Server service, in
contrast to a console user. See also: console user.
entry level
The lowest level set of attributes at which a fact is available for analysis.
ETL
Short for extraction, transformation, and loading. (1) The process used to
populate a data warehouse from disparate existing database systems. (2) Third-
party software used to facilitate such a process.
execution locale
Determines how content is generated for the users who receive it. When a
document is created, the application designer can specify that the document
should be executed in a specific execution locale. The definition of the locale
then controls how information should be gathered, formatted, packaged and
delivered for this document. For example, an application designer might define a
French and a German locale to gather information in the appropriate languages.
If one of these locales is chosen as the execution locale for a document, all
dynamic content in this document is retrieved using the corresponding language.
See also: locale, display locale, selection locale, system locale, user locale.
expression
Formulas built from functions, attributes, facts, metrics, and consolidations that
can be used to define attribute forms, fact calculations, metrics, or filters.
fact
(1) A measurement value, often numeric and typically aggregatable, stored in a
data warehouse. (2) A schema object representing a column in a data warehouse
table and containing basic or aggregated numbersusually prices, or sales in
dollars, or inventory quantities in counts. See also: metric.
fact table
A database table containing numeric data that may be aggregated along one or
more dimensions. Fact tables may contain atomic or summarized data. Compare:
base table.
fetch
The amount of report data retrieved from one call to MicroStrategy Web
Services. Fetches are used to control the amount of network traffic between
MicroStrategy Office and MicroStrategy Web Services and the amount of
memory used by MicroStrategy Intelligence Server. When you execute a report
or document into a Microsoft product, the Execution Status dialog box displays
the progress of each fetch. Fetch size is controlled by Microsoft Office product-
specific configuration settings. Maximum fetch size is governed by an
Intelligence Server setting in MicroStrategy Developer.
filter
A MicroStrategy object that specifies the conditions that the data must meet to
be included in the report results. Using a filter on a report narrows the data to
consider only the information that is relevant to answer your business question,
since a report queries the database against all the data stored in the data
warehouse. A filter is composed of at least one qualification, which is the actual
condition that must be met for the data to be included on a report. Multiple
qualifications in a single filter are combined using logical operators. Examples
include "Region = Northeast" or "Revenue > $1 million". A filter is normally
implemented in the SQL WHERE clause.
Flash-enabled document
A Report Services document in which Flash Mode is selected as an available
display mode in the Document Properties dialog box.
flattened
A report display type in which the results of a report are displayed with all
attributes and metrics flattened side-by-side on one axis. Also, any subtotals
within the report are not displayed. It is convenient to execute your report or
HTML document in this display type if you intend to use Excels drop-down lists
to filter, hide/show data, and more.
folder
A MicroStrategy object used for grouping and storing in a single place a set of
objects that are similar, such as filters, templates, and reports.
folder list
A portion of the interface that lists all the folders found in the project in a
hierarchical fashion. It helps a user to visualize and browse through a
MicroStrategy project.
form
One of several columns that are different representations of the same thing, as
ID, Name, Long Description, Abbreviation.
function plug-in
Allows user-defined functions to be used by the MicroStrategy Analytical Engine.
governing parameters
Designed to keep the execution profile of a system within acceptable limits.
Protects the system from overconsumption of resources such as memory, disk
space, network capacity, and CPU cycles.
graph
A graphical image display of data. Sometimes referred to as a chart. See also
report.
graph analytic
An analytic showing data as points, lines, or bars, arranged according to axes
based on the chosen metrics. Although not all analytics can be displayed in every
graph type available, many analytics can be viewed in several ways. Choices for
graph display include bars, lines, area graphs, and three-dimensional graphs.
graph view
Report viewing mode that displays results as a graphical chart.
grid
A spreadsheet-style two-dimensional display of data. See also report.
grid analytic
An analytic consisting of rows and columns. Each row or column has a heading,
and each heading represents a prompt from the analytic. Grid analytics can be
modified easily, by drilling, moving columns, converting columns to rows,
sorting, and using page-by to display subsets of the analytic data as separate
pages.
grid view
Report viewing mode that displays result data in a tabular format.
Grid/Graph
A control placed in a document that displays information in the same way a
MicroStrategy report does.
grouping
A way to create a hierarchical structure for a document.
hierarchy
A set of attributes defining a meaningful path for element browsing or drilling.
The order of the attributes is typicallythough not alwaysdefined such that a
higher attribute has a one-to-many relationship with its child attributes.
hint
A comment that passes instructions to a database optimizer about choosing an
execution plan for a given SQL statement. In MicroStrategy, a hint can be
defined in VLDB properties to appear within a MicroStrategy-issued SQL
statement.
History List
A folder where users can retrieve the results of previously executed or scheduled
reports and documents.
HTML container
A control that either displays real-time information from the web or displays
formatted HTML.
HTML document
(1) A compound report displaying multiple grids and graphs. (2) The
MicroStrategy object that supports such a report.
ID column
A column that contains attribute element identification codes. All attributes must
have an ID column.
imported file
A file imported from outside of Narrowcast Server and stored in its original
format. For example, a text file contains only plain text and an HTML file
contains only HTML. Storing information in the file format preserves the
integrity of the original data since files cannot be modified with Narrowcast
Server. Files cannot be directly included in publications; they must first be
associated with imported documents, which serve as containers to allow them to
be attached to publications. Imported files can also be used as stylesheets or
templates for documents.
incremental fetch
A feature that returns a large set of information, such as subscriptions, to the
console in numerous small pieces as those pieces are needed. This ensures that
network traffic and client processing is kept to a minimum.
information object
Application object containing a set of instructions that specify how to get data
from a particular type of information source. Defined by using an information
source module, it is set up when a service is built and executed when the service
that uses it is run. Plays one of three roles: content, subscription, or
segmentation. See also: information object role, information object type,
information source,information source module (ISM).
information source
Contains information about how to connect to a specific source of content using
an information source module. The Delivery Engine requests and acquires
information from information sources. An information source uses
personalization objects for personalization. See also: information source module
(ISM), personalization object.
the arrangement of these documents. Also, the ITM provides a user interface for
defining device characteristics. Those characteristics are stored in the Object
Repository and retrieved by the information transmission module to control
packaging and delivery. See also: device, document (Narrowcast), information
transmitter, publication.
information transmitter
Administration object that delivers formatted content, in the form of
publications, to end user devices. An information transmitter might serve the
purpose of sending email via SMTP or mobile device messages using an SMS
gateway. In general, an information transmitter supports one type of
transmission technology, such as SMTP, FTP, HTTP, or ODBC, but this is not a
requirement. Information transmitters depend on information transmission
modules. See also: device, document (Narrowcast), information transmission
module (ITM), publication.
Intelligent Cube
A copy of the report data saved in memory and used for manipulation of the view
definition. This division allows multiple reports with different views to share a
common data definition.
join
A SQL operation that combines data from multiple tables into a single result
table.
Layout area
The middle panel of the Document Editor in which you place data or other
controls to determine the appearance of the document when it is viewed as a
PDF.
level
(1) In a data warehouse, facts are said to be stored at a particular level defined by
the attribute IDs present in the fact table. For example, if a fact table has a Date
column, an Item_ID column, and a fact column, that fact is stored at the
Date/Item level. (2) With regard to metric calculation, the level is the level of
calculation for the metric.
link
A connection from a document to another document or a report. A link lets an
analyst execute another document or report (the target) from a document (the
source), and to pass parameters to answer any prompts that are in the target.
load balancing
A strategy aimed at achieving even distribution of MicroStrategy Web Universal
user sessions across MicroStrategy Intelligence Servers. MicroStrategy achieves
four-tier load balancing by incorporating load balancers into MicroStrategy Web
Universal.
locale
Specifies what regional characteristics to apply to data and formatting, including
number format, date format, time format, and character sets. Your system might
support multiple locales. See also: display locale, execution locale, selection
locale, system locale, user locale.
Locale ID
Numeric ID value used to indicate the locale that a recipient prefers. Locales are
specified for subscriptions in dynamic subscription sets by providing the Locale
ID. Locale IDs are found under the properties for each locale within Narrowcast
Administrator. For example, one subscription might specify French, while
another recipient might specify German. One subscriber then only receives
French content while the other subscriber only receives German content.
login ID
Login identifier, typically supplied with a password.
lookup table
A database table used to uniquely identify attribute elements. They typically
consist of descriptions of dimensions. Lookup tables are usually joined to fact
tables to group the numeric facts in the fact table by dimensional attributes in
the lookup tables.
managed object
A schema object unrelated to the project schema, which is created by the system
and stored in a separate system folder. Managed objects are used to map data to
attributes, metrics, hierarchies and other schema objects for Freeform SQL,
Query Builder, and MDX cube reports.
manual fetch
A type of incremental report result fetching in which you are asked to confirm
each fetch. For example, when you execute a report, you are prompted to
confirm that each fetch, or section of report results, is displayed.
many-to-many relationship
An attribute relationship in which multiple elements of a parent attribute can
relate to multiple elements of a child attribute, and vice versa.
many-to-one relationship
An attribute relationship in which (1) multiple elements of a parent attribute
relate to only one element of a child attribute, and (2) every element of the child
attribute can relate to multiple elements of the parent.
MDX cube
An MDX cube is a collection or set of data retrieved from an MDX cube source,
which is imported into MicroStrategy and mapped to various objects to allow
query, reporting, and analysis on the data.
metadata
A repository whose data associates the tables and columns of a data warehouse
with user-defined attributes and facts to enable the mapping of the business
view, terms, and needs to the underlying database structure. Metadata can reside
on the same server as the data warehouse or on a different database server. It
can even be held in a different RDBMS.
metric
(1) A business calculation defined by an expression built with functions, facts,
attributes, or other metrics. For example: Sum(dollar_sales) or [Sales] - [Cost].
(2) The MicroStrategy object that contains the metric definition. It represents a
business measure or key performance indicator. See also: fact.
multidimensional analysis
A form of analysis of the data in a data warehouse that includes many
relationships, each representing a dimension. For example, a retail analysis may
seek to understand the relationships among sales by region, by quarter, by
demographic distribution (income, education level, gender), and by product.
Multidimensional analysis provides results for these complex relationships.
multipart MIME
Part of the MIME specification, which includes more than one body part in a
body section within a MIME message. This is typically used to enable the
inclusion of separate text and HTML message bodies, embedded images, and
other body parts within an email message. See also: multipurpose Internet mail
extensions (MIME).
object
Conceptually, an object is the highest grouping level of information about one
concept, used by the user to achieve the goal of specified data analysis. More
concretely, an object is any item that can be selected and manipulated, including
folders, reports, facts, metrics, and so on.
object template
A MicroStrategy object that allows you to start with a predefined structure when
creating a new object. You can use object templates for many MicroStrategy
objects, including metrics, documents, reports, and report templates.
ODBC driver
Software interface to an ODBC service provider. See also: open database
connectivity (ODBC).
one-to-many relationship
An attribute relationship in which every element of a parent attribute can relate
to multiple elements of a child attribute, while every element of the child
attribute relates to only one element of the parent. The one-to-many attribute
relationship is the most common in data models.
one-to-one relationship
An attribute relationship in which every element of the parent attribute relates to
exactly one element of the child attribute, and vice versa.
outline mode
Report viewing mode that creates indented, collapsible groupings of related
elements to make reports neater and easier to read.
page
An amount of data that is analogous to a page in a page-by report. Each page of a
page-by report represents one combination of elements from each attribute on
the page-by axis. For example, one page may contain data related to 2006 as well
as the Southeast region. A report with no attributes on the page-by axis is
considered to have one page. When you execute a report or document into a
Microsoft product, the Execution Status dialog box displays the progress of each
page.
page-by
Segmenting data in a grid report by placing available attributes, consolidations,
and metrics on a third axis called the Page axis. Since a grid is two-dimensional,
only a slice of the cube can be seen at any one time. The slice is characterized by
the choice of elements on the Page axis. By varying the selection of elements, the
user can page through the cube.
panel
A way of grouping data in a document so that users can navigate subsets of data
as if the subsets were pages in a smaller document. Each page, or layer of data,
is a panel; a group of panels is called a panel stack.
panel stack
The holder for a collection of panels, or layers of data, in a document. A user can
navigate or flip through the panels in a panel stack; only one panel is displayed at
a time.
parent attribute
The higher-level attribute in an attribute relationship with one or more children.
See also: child attribute or relationship.
partition
A relational database table broken down into smaller component tables. This can
be done at the database level or at the application level. See the MicroStrategy
System Administration Guide for more information.
partition mapping
The division of large logical tables into smaller physical tables based on a
definable data level, such as month or department. Partitions minimize the
number of tables and records within a table that must be read to satisfy queries
issued against the warehouse. By distributing usage across multiple tables,
partitions improve the speed and efficiency of database queries.
persistence
A default behavior in MicroStrategy Office ensuring that every report and
document you run in an Excel workbook, PowerPoint presentation, or Word
document retains a link to MicroStrategy Intelligence Server. This ensures that
you and other users can refresh the reports and documents to retrieve the latest
data from the data warehouse or other data sources. Every report or document
executed also contains properties that are persisted; these properties determine
how the report or document is displayed and can be modified by users once it is
refreshed.
personalization
The process that allows each subscriber to receive data that has been filtered and
formatted specifically for him. Narrowcast Server uses locale, subscription, and
personalization objects to personalize services. See also: locale, personalization
object, subscription.
personalization object
An object handled by information sources for personalization. The three types
are: authentication, preference and security. The combination of the
authentication, preference, and security objects control the data that is returned
by an information object. See also:authentication object, information object,
information source, preference object, question object, security object.
personalization set
A combination of locale, authentication, security, and preference objects to
achieve personalized information, or information filtered and formatted
specifically for a subscriber.
physical address
The address location used to locate recipients and deliver messages. For email
delivery, this is a standard SMTP address in the form recipient@domain.xxx. No
physical address is required for delivery to the Subscription Portal. The physical
address required by other information transmitters depends on the individual
information transmitter.
PIN
The personal identification number required by some delivery methods. A PIN is
not used for email, mobile device, or Subscription Portal delivery. The use of a
PIN by other information transmitters depends on the individual information
transmitter.
plug-in
An additional processing component integrated with MicroStrategy products.
For example, advanced statistical and financial functions can be added as
additional processing components.
plugin
An application that can easily be installed and executed by the MicroStrategy
Intelligence Server in one of several identical interfaces. For example, advanced
statistical and financial functions can be added as additional processing
components.
port number
The port number is how a server process identifies itself on the machine on
which it is running. For example, when the Intelligence Server machine receives
a network call from a client (Developer, Web Universal, Narrowcast Server,
Command Manager, and so on), it knows to forward those calls to the
Intelligence Server port number that is specified in the call.
portability
The ability of an analytical application to be integrated into an existing data
warehouse. To port the Analysis Module, you map the module to the physical
schema of an existing data warehouse.
portal
A site that offers a centralized access point for finding and managing
information via a variety of different services. It offers a broad array of resources
and services, such as email, discussion forums, search engines, and other online
services. A portal is accessible through the use of a web browser. See also:
Subscription Portal.
preference object
Type of personalization object that uses the answers to question objects to
specify the information that the user wants. At run-time, the preference object is
applied to information objects to personalize them. Preferences are usually
controlled by the user, but can be set by the subscription administrator. For an
Information Source, preference objects are prompt answers. See also:
personalization object, question object.
prefix
A prefix is stored in the project metadata associated with a table or tables and is
used by the Engine to generate SQL. Also, the Catalog Server uses it to obtain
table sample values and row counts. In most cases, it should match the name
space field since it is used to qualify on a specific table belonging to a certain
owner or name space. Prefixes can be defined and modified from the Warehouse
Catalog interface.
preview fetch
A type of incremental report result fetching in which you can see a preview of
the report data as it runs. You specify how many rows of the report you want to
preview at a time, and fetching automatically stops after one fetch.
primary key
In a relational database, the set of columns required to uniquely identify a record
in a table.
privilege
Assigned to users, a privilege defines the functionality available to a user, for
example, which objects a given user can create and which applications and
editors he can use.
process
An executing application comprising one or more threads. Processes use
temporary private address spaces and control operating system resources such as
files, dynamic memory allocations, pipes, and synchronization objects.
production metadata
The repository you create during the configuration portion of the installation
process, and which works with your data warehouse and serves as your working
metadata repository.
productivity analysis
A process that measures company productivity and identifies ways to increase it.
project
(1) The highest-level intersection of a data warehouse, metadata repository, and
user community, containing reports, filters, metrics, and functions. (2) An object
containing the definition of a project, as defined in [1]. The project object is
specified when requesting the establishment of a session.
project designer
The user category of one who creates projects and all of the schema objects
(facts, attributes, hierarchies) for a project. A project designer is thoroughly
familiar with the data model and schema object editors.
project source
Defines a connection to the metadata database and is used by various
MicroStrategy components to access projects. A direct project source is a two-
tier connection directly to a metadata repository. A server project source is a
three-tier connection to a MicroStrategy Intelligence Server. One project source
can contain many projects and the administration tools found at the project
source level are used to monitor and administer all projects in the project source.
prompt
MicroStrategy object in the report definition that is incomplete by design. The
user is asked during the resolution phase of report execution to provide an
answer that completes the information. A typical example with a filter is
choosing a specific attribute on which to qualify.
Property List
The list of settings used to specify the appearance or any other characteristic of a
control on a document.
publication
An ordered collection of documents that completely defines the content of a
service for a specific set of devices. Each publication is used for exactly one locale
and one information transmission module. A publication specifies: An
information transmitter, At least one device or A set of documents. See also:
device, document (Narrowcast), information transmitter.
qualification
The actual condition that must be met for data to be included on a report.
Examples include Region = Northeast or Revenue > $1 million.
Qualifications are used in filters and custom groups. You can create multiple
qualifications for a single filter or custom group, and then set how to combine
the qualifications using the logical operators AND, AND NOT, OR, and OR NOT.
query
A request for data from a database or data warehouse. A report is a database
query.
Query Engine
The MicroStrategy component responsible for submitting SQL code to the
database.
question object
Type of personalization object that specifies the questions to ask the user to
determine the users preferences. Answers are used as preference objects. For a
Quick Grid
A report display type in MicroStrategy Office in which the report is run as a CSV
and bulk-loaded into Excel in one fetch. Although this results in a fast report
execution time, formatting from the report definition, such as fonts, colors, and
thresholds is not applied. You can apply formatting to Quick Grids using
Microsoft Excels AutoFormats.
ranking
A type of OLAP function that returns the rank of a value in a group of values.
Rows with equal values with respect to the ordering are assigned the same rank.
relate table
A table containing the ID columns of two or more attributes, thus defining
associations between them.
relationship
An association specifying the nature of the connection between one attribute
(the parent) and one or more other attributes (the children). See also: child
attribute or parent attribute.
report
The central focus of any decision support investigation, a report allows users to
query for data, analyze that data, and then present it in a visually pleasing
manner.
report designer
The user category of one who creates all application objects such as grid and
graph reports, filters, templates, documents, consolidations, and custom groups.
The report designer understands all of the business intelligence capabilities of the
system.
report resolution
The process of filling placeholders such as prompts with information determined
at run time.
report template
A MicroStrategy object that allows you to define the layout of general categories
of information in a report. In a report template, you specify the information that
you want to retrieve from your data source, and the way that you want the data
to be displayed in Grid view. A report template does not include filter
information. Report templates are often referred to as just as templates.
retention(employee)
The process of maintaining or securing employee loyalty to minimize loss of key
talent.
role
A feature of the security subsystem that defines which objects a given user can
create and which operations he can perform. The different Narrowcast Server
roles are: System administrator (who manages the entire system), Application
administrator (who administers application objects only), Application designer
(who develops application objects only and cannot modify objects owned by
other users), Subscription administrator (who manages the Subscription Book),
Portal administrator (who configures and manages Subscription Portals).
schedule
Sets the time or frequency that a service is executed. A schedule represents a
recurrence pattern, not a fixed date. It is defined relative to time zones to
account for daylight savings, date boundaries, and other time zone-specific
issues. To allow subscribers globally to receive services at specific local times, a
service can contain more than one schedule.
schema
(1) The set of tables in a data warehouse associated with a logical data model. The
attribute and fact columns in those tables are considered part of the schema
itself. (2) The layout or structure of a database system. In relational databases,
the schema defines the tables, the fields in each table, and the relationships
between fields and tables.
schema object
MicroStrategy object created, usually by a project designer, that relates the
information in the logical data model and physical warehouse schema to the
MicroStrategy environment. These objects are developed in MicroStrategy
Architect, which can be accessed from MicroStrategy Developer. Schema objects
directly reflect the warehouse structure and include attributes, facts, functions,
hierarchies, operators, partition mappings, tables, and transformations.
scorecard
A type of tally sheet displaying a company's performance using key performance
indicators (KPIs) that gauge how well a company progresses in areas such as
finance, customer service, and product availability and distribution. See also KPI
(key performance indicator).
security filter
A qualification associated with a user that is applied to all queries executed by
that user.
security object
Type of personalization object that specifies what information the user should
have access to. Security filtering criteria applied to an information source during
security role
In a MicroStrategy security model, the set of privileges that a user can have.
segment
A group of subscriptions within a subscription set. Subscription sets are divided
into multiple pieces, or segments, so that the work required to execute a service
for all subscriptions can be distributed across multiple systems to allow parallel
work processing. The size of the segment is part of the service definition and
controls the work packages that are sent to each execution engine.
segmentation
The task of dividing the subscriptions within a subscription set into equal-sized
groups or segments. Segmentation ensures that all subscription information
objects and content information objects return only information for
subscriptions in the current segment. Subscription sets are always segmented
using the subscription ID, and the boundaries of segments are specified as
subscription ID values. For the MicroStrategy Information Source, segmentation
can be performed automatically by Narrowcast Server, or the application
designer can control how the subscription set is segmented and how subscription
information objects and content information objects constrain the information
they return.
segmentation prompt
A prompt that controls the information returned in a report used as a content
information object or subscription information object. Segmentation can be
performed automatically by Narrowcast Server, or prompts can be added to
content information objects and subscription information objects manually. This
process limits the number of subscriptions and content pages returned to only
provide information for subscriptions in the current segment.
selection locale
Determines which users should receive which content. When a user is created,
the subscription administrator (using Narrowcast Administrator) or the user
(using the Subscription Portal) selects a locale for which the user will receive
content. When a publication is created, the application designer chooses a
selection locale that determines which users receive the content in a publication.
If a user chooses Locale A, the application designer must choose Locale A as the
selection locale for a publication for the user to receive this publication. See also:
locale, display locale, execution locale, system locale, user locale.
selector
A type of control in a document that allows a user to: Flip through the panels in
a panel stack, to see different predefined layers of data, or pages, in the same
document. Display different attribute elements or metrics in a Grid/Graph.
SequeLink
Third-party (non-MicroStrategy) software that configures and manages data
access across multiple data stores, operating systems, and deployment options.
SequeLink machine
The machine where SequeLink is installed. This machine can be independent
from the rest of the Subscription Portal.
SequeLink services
SequeLink creates two NT services: SLAgent 54, which is the Administrator, and
SLSocket54, which is the Server.
server definition
A MicroStrategy object stored in the metadata containing information about the
configuration of an Intelligence Server.
server instance
The combination of an Intelligence Server running with a particular server
definition.
service
An object that provides all the information needed for the Delivery Engine to
correctly generate messages. That information includes the delivery conditions,
content, personalization rules, and subscriptions for sending messages for a
particular purpose. For example, one service delivers a daily message containing a
stock portfolio update, while another delivers alerts to mobile devices when the
value of a stock changes significantly. A service comprises at least one schedule-
subscription pair and a set of publications.
service designer
Narrowcast Administrator user role. This role is for a Narrowcast Administrator
console user who develops and tests services, which include documents,
publications, schedules, and subscription sets. Configures and manages
Subscription Portals that allow end users to subscribe to a variety of Narrowcast
services via the web. Configures data sources, content, and portal layout.
Publishes services and device types, and selects default devices for Subscription
Portals. Specifies information source properties and default site preferences.
Installs, configures, and administers the development environment. Administers
subscribers and subscriptions for development and testing purposes. See also:
application administrator.
service queue
In Narrowcast Administrator, a visual display of upcoming services to be
processed.
simple metric
A type of metric that can stand alone or be used as a building block for
compound metrics. Simple metrics always contain at least one aggregate
function, such as sum or average, applied to a fact, attribute, or another metric.
The entire metric can only contain one level.
slice
One page of content in a multi-page report. Narrowcast Server divides a single
multi-page report into multiple individual pages of content that are used as
personalized content for individual subscriptions. slicing attribute. A slicing
attribute is the attribute used to divide multi-page reports executed using
personalized page execution mode into multiple individual pages of content. The
first attribute on the page axis is used as the slicing attribute.
smart fetch
A type of report result fetching in which fetching continues until completion or
you cancel the operation. This is the default fetch method used in MicroStrategy
Office.
sort
Arranging data according to some characteristic of the data itself (alphabetical
descending, numeric ascending, and so forth). See also: drill, page-by, subtotal.
sort by
The order of the return values of an expression in relation to the order of the
value or metadata object given. A sort by includes whether to sort in ascending
or descending order, and which metadata object to sort by. Sort by may also be
SQL Engine
The MicroStrategy Intelligence Server component that in report execution
converts report requests into SQL to be used for a database query.
static content
Document content that is contained directly in the document and does not
change from one service execution to the next. It cannot be personalized for
different subscribers. Examples include an HTML template, a static URL, and so
on. Compare with: dynamic content.
subscriber
A person who receives content from at least one service. Each individual who
receives messages from Narrowcast Server has a login that provides password-
controlled access to subscription and user preference information for the
individual and his addresses. Subscribing at least one of these addresses to a
particular service allows the individual to receive messages.
subscription
An enrollment in a service; a subscription is composed of one user and one
address. subscription administrator Narrowcast Administrator user role.This role
is designed for a console user who manages the Subscription Book, including
users, addresses, and subscription sets. Also installs, configures, and administers
the Subscription Book Module.
Subscription Book
Contains all users, addresses, and subscription sets. Stored in the Subscription
Book Repository. See also: subscription set.
Subscription ID
The ID value used by Narrowcast Server to segment subscription sets. It is also
called Segmentation ID. This value is required for dynamic subscription sets.
subscription information
All information related to an individual subscription. This information allows
Narrowcast Server to deliver services to individual recipients in the desired
manner.
Subscription Portal
A feature of Narrowcast Server that allows end users to subscribe to Narrowcast
Server services offered through a web-based portal. This enables end users to
experience personalized and proactive interactions, based on user-defined
permissions and preferences. See also: portal.
subscription set
A collection of addresses that can be subscribed to a service. Subscription sets are
either static or dynamic. A static subscription set is an application object that
retrieves subscription information from the Subscription Book Repository.
Useful when the set of end user addresses that should receive a service does not
change. A dynamic subscription set is an application object containing at least
one piece of subscription information retrieved from an information object
instead of from the Subscription Book Repository. Useful for changing or alert-
driven subscription sets. Dynamic subscription sets can acquire some or all of
their information from the information object. The rest of the subscription
information is acquired from the Subscription Book Repository. See also:
subscription set object.
Subscription Set ID
A numeric value used to identify each subscription set.
subtotal
A totaling operation performed for a portion of a result set. See also: drill and
page-by.
summary metric
A shortcut to a subtotal, or a subtotal metric allowing explicit aggregation in
documents. A summary metric allows you to select the function to use to
calculate the subtotal.
system administrator
Narrowcast Administrator user role. This role is designed for a console user who
performs the following tasks: Installs and configures the information delivery
platform, Migrates system objects and application objects, Monitors, analyzes,
and tunes the system to ensure the smooth and balanced operation of the
decision support or business intelligence environment, Performs troubleshooting
and error recovery.
system developer
Narrowcast Administrator user role. This role is designed for a Narrowcast
Server user who employs the SDK and embeds Narrowcast Server technology
into another product or application.
system locale
A language in which all objects are guaranteed to have a name. Since objects can
have names in several locales (languages), it is necessary to have one locale
where a name always exists for all objects. The system locale serves this role,
because the system locale cannot be deleted. See also: locale, display locale,
execution locale, selection locale, user locale, text container See: document
(Narrowcast).
table
The primary physical component of a data warehouse, logically consisting of
columns of data of varying types.
template
A MicroStrategy object that serves as a base on which you can build other objects
of the same type. You can create a template for almost any kind of MicroStrategy
object, such as filters or reports. Also see: Object template and Report template.
text field
A type of control in a document that displays text in the document. These
different types of text content are: Static text, which does not change and serves
as a label. Dynamic text, which is populated by the document or dataset. There
are two types of dynamic text: Data field, which is populated from a dataset with
data that originated in the data warehouse (or an Intelligence Server cache). A
data field is only a reference to an object on a report. Auto text code, which is
populated by the document or dataset, consisting of their settings rather than
data from the data warehouse. A combination of any or all of the above types in
one text field. See also: Data field, Auto text code.
threshold
Used to create conditional formatting for metric values. For example, a threshold
triggers the report that, if dollar sales is greater than $200, format that cell to
have a blue background with bold type.
transformation
A schema object that encapsulates a business rule used to compare results of
different time periods. Transformations are used in the definition of a metric to
alter the behavior of that metric.
user hierarchy
Named sets of attributes and their relationships, arranged in specific sequences
for a logical business organization. They are user-defined and do not need to
follow the logical model.
user ID
A numeric value used to identify individual users.
user information
The collection of information, including first name, last name, address, zip code,
and other personal information, that changes from one subscriber to the next.
user locale
Defines which content the user receives. This is set up by either the subscription
administrator via Narrowcast Administrator or by the user via Subscription
Portal. The user locale must match the selection locale. See also:locale, display
locale, selection locale, system locale.
view filter
The set of criteria that restricts the report data that is currently being viewed. It
may include filtering conditions based on any of the objects on the report.
widget
A type of control that presents data in a visual and interactive way; an interactive
Flash-only graph that dynamically updates when a new set of data is selected.
Some types include Gauge, Heat Map, and Stacked Area widgets.
A ApplyAgg 135
Abs 317 example 135
Accrint 261 ApplyComparison 135
Accrintm 264 example 28, 31, 136
Acos 318 in filter 31
Acosh 318 ApplyLogic 136
Add 94 example 136
analytical engine 57 ApplyOLAP 136
And 255 example 137
Apply functions 22, 27 ApplySimple 137
ApplyAgg 135 example 30, 137
ApplyComparison 135 argument 38
ApplyComparison in filter 31 prompts 38
ApplyLogic 136 arithmetic operator 241
ApplyOLAP 136 Divide 242
ApplySimple 137 Minus 241
example 28, 31, 136-137 Plus 242
syntax 134 Times 242
using extra arguments in 134 Unary Minus 243
Asin 318
Pv 303 processing 57
Rate 303 using prompts 38
Received 304 function plug-in 69
Sln 306 function type 22
Syd 306 Apply function 27
Tbilleq 306 Apply functions
Tbillprice 307 example 28
Tbillyield 308 comparison function 26
Vdb 308 group-value function 24
XIRR 309 OLAP function 25
XNPV 312 single-value function 22-23
Yield 314 Fv 281
Yielddisc 315 Fvschedule 281
Yieldmat 316
G
First 99
GammaDistribution 347
first occurrence 233
GeoMean 100
FirstInRange 155
Greater 245
FiscalMonth 124
Greater Equal 245
FiscalQuarter 125
Greater Equal Enhanced 253
FiscalWeek 125
Greatest 101
FiscalYear 126
Growth 348
Fisher 342
GrowthV 348
Floor 324
Forecast 343 H
ForecastV 344 HeteroscedasticTTest 350-351
formula, metric 40 hierarchy 25
formula. See compound metric. 40 HomoscedasticTTest 350-351
FTest 346 Hour 127
function HypergeometricDistribution 351
basics of 21
I
parameters 32
If 146, 255
In 247 K
InitCap 227, 237 Kurtosis 358
initial capitalization 227, 237
L
Input Metric Formula dialog box 46
Lag 157
Insert Function Wizard 55
Last 102
Int 324
last occurrence 228
Intercept 352
LastInRange 161
internal functions
LastPosition 228
ApplyAgg 135
Lead 162
ApplyComparison 135
LeftStr 229
ApplyLogic 136
Length 229
ApplyOLAP 136
Less Equal 244
ApplySimple 137
Less Equal Enhanced 252
BandingC 140
Less Than 243
BandingP 142
Like 248
Case 145
Ln 325
Intrate 282
Log 325
InverseBetaDistribution 353
Log10 326
InverseChiDistribution 354
logical operator 255
InverseFDistribution 355
And 255
InverseFisher 354
If 146, 255
InverseGammaDistribution 355
Not 256
InverseLognormalDistribution 356
Or 256
InverseNormDistribution 357
LognormalDistribution 359
InverseNormSDistribution 357
Lower 230
InverseTDistribution 358
LTrim 231
Ipmt 284
IRR 284 M
IsNotNull 148 Match 231, 236
IsNull 148
W
Week 131