MicroStrategy Functions Reference
MicroStrategy Functions Reference
MicroStrategy Functions Reference
Re f e r e n ce
Version 2021
M i cr o St r at egy 2021
Oct o b er 2023
Copyright © 2023 by MicroStrategy Incorporated. All rights reserved.
Trademark Information
The following are either trademarks or registered trademarks of MicroStrategy Incorporated or its affiliates in the United States and certain other
countries:
Dossier, Enterprise Semantic Graph, Expert.Now, Hyper.Now, HyperIntelligence, HyperMobile, HyperVision, HyperWeb, Intelligent Enterprise,
MicroStrategy, MicroStrategy 2019, MicroStrategy 2020, MicroStrategy 2021, MicroStrategy Analyst Pass, MicroStrategy Architect, MicroStrategy
Architect Pass, MicroStrategy Badge, MicroStrategy Cloud, MicroStrategy Cloud Intelligence, MicroStrategy Command Manager, MicroStrategy
Communicator, MicroStrategy Consulting, MicroStrategy Desktop, MicroStrategy Developer, MicroStrategy Distribution Services, MicroStrategy
Education, MicroStrategy Embedded Intelligence, MicroStrategy Enterprise Manager, MicroStrategy Federated Analytics, MicroStrategy Geospatial
Services, MicroStrategy Identity, MicroStrategy Identity Manager, MicroStrategy Identity Server, MicroStrategy Insights, MicroStrategy Integrity
Manager, MicroStrategy Intelligence Server, MicroStrategy Library, MicroStrategy Mobile, MicroStrategy Narrowcast Server, MicroStrategy ONE,
MicroStrategy Object Manager, MicroStrategy Office, MicroStrategy OLAP Services, MicroStrategy Parallel Relational In-Memory Engine (MicroStrategy
PRIME), MicroStrategy R Integration, MicroStrategy Report Services, MicroStrategy SDK, MicroStrategy System Manager, MicroStrategy Transaction
Services, MicroStrategy Usher, MicroStrategy Web, MicroStrategy Workstation, MicroStrategy World, Usher, and Zero-Click Intelligence.
The following design marks are either trademarks or registered trademarks of MicroStrategy Incorporated or its affiliates in the United States and certain
other countries:
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.
CON TEN TS
1. Understanding Functions in MicroStrategy 5
3. Operators 319
U N D ERSTAN D IN G
FUN CTION S IN
M ICRO STRATEGY
l Month + 5
l Sum(Revenue)
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.
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
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.
• Attribute form
• Arithmetic
operators • Consolidation
( –, +, /, *)
• Custom group
• Abs
Single-value • Fact
• Round
• Metric
• Ln
• Subtotal
• Cos
• Transformation
• Avg
• Metric
Group-value • Count
• Subtotal
• Sum
• Rank
OLAP Metric
• MovingMin
• NTile
• And
Logical Filter
• Or
• Between
Comparison Filter
• ApplyComparison
• Attribute form
• ApplySimple • Consolidation
• ApplyLogic • Metric
• ApplyComparison • Transformation
• Filter
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
Advanced Reporting Help.
Function Types
MicroStrategy functions are classified into the following types:
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.
Where
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.
In this example, the group-value function Avg is applied to both the Revenue
and Cost facts in your data warehouse. First, MicroStrategy uses the list of
values for the two input variables Revenue and Cost to generate, using the
Avg function twice, two new variables each containing a single value. The
two resulting variables are stored as intermediate results. Next, the single-
value function "-" (subtraction) is applied by MicroStrategy to subtract one
intermediate result from the other, resulting in a single value for the metric.
For more information on the Abs and Avg functions, see Abs (Absolute
Value), page 416 and Avg (Average), page 117.
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 27). 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 27.)
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 134.
An OLAP function takes multiple elements from a list and returns a new list
of elements. Unlike group-value functions, though, the number of elements
in the input list and the number of elements in the output list remains the
same. Unlike single-value functions, the computation depends upon the
conditions set by the BreakBy parameter that defines when the calculation
restarts and the SortBy parameter that defines how the list of values is
sorted (see Common Parameters, page 27).
OLAP functions include Rank, all the functions with Moving as the prefix of
the name (for example, MovingDifference, MovingMin, MovingStdev,
and so on), all the functions with Running as the prefix (for example,
RunningAvg, RunningCount, RunningSum, and so on), and all the NTile
functions (such as NTile, NTileSize, NTileValue, and
NTileValueSize). ApplyOLAP also belongs to the OLAP category.
OLAP functions are only used in the creation of metrics. The following is an
example.
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.
In this example, the filter limits the states in your yearly income report to
those with accrued revenue greater than $500,000.
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.
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%.
functions, while necessary, must be used with care, since they always
bypass MicroStrategy's parsers and validators.
There are five predefined Apply functions that can be used to replace
regular or predefined functions of the same type. The functions are as
follows:
In this example, a table in your data warehouse contains the columns Item,
Effec Date, and Term Date (as well as Revenue), as shown below:
Leather
06/15/2007 06/22/2007 750
Shoes
Winter
12/01/2007 12/15/2007 2200
Boots
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 does not have a built-in function to accomplish your
task. If an appropriate MicroStrategy function existed, you would have used
it instead of an RDBMS function, because the latter does not offer the
validating features that MicroStrategy does. (To use Apply functions, you
must know the syntax of the corresponding function or operation in the
RDBMS you are using.)
To test the date prompt, use a custom expression to pass three values to the
database for comparison: the value prompt Test Date, the attribute Effec
Date, and the attribute Term Date. All three of these values are passed to
the database using placeholders in the form of #n, where n is a positive
integer that increases by 1 for each successive item being passed, starting
with 0. The first value passed is referred to as #0, the second is #1, the third
#2, and so on. The Custom expression in the Advanced Qualification pane of
the Filter Editor depicted below shows the syntax needed for this example:
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:
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.
l The datepart function extracts a specified part of a given date. The first
datepart function extracts the year (as directed by yy) from the ID
attribute form of the Hire Date attribute. The ID attribute form—as opposed
to the DESC or any other attribute form—is specified by @ID.
l The placeholder, #0, stands for the argument [Hire Date]@ID that is
passed to your RDBMS. (Apply functions use your database's
computational capabilities instead of those of MicroStrategy.)
l The second datepart function extracts the year (as instructed by yy)
from the current, or system, date. The system date is obtained via the
RDBMS function getdate().
l Your RDBMS extracts the year from both the Hire Date and the system
date, with MicroStrategy passing information to it. The container that
hands the necessary function to your RDBMS is an Apply function,
ApplySimple. In other words, ApplySimple acts as an interface between
you and the database, and when the RDBMS returns both year values,
they are compared with the = operator. If the year of a particular Hire Date
element is the same as the year of the system date, the custom expression
statement evaluates as true and that Hire Date attribute element is
returned in the result set of your report. If the year of a particular Hire Date
element is different than the year of the system date, the custom
expression statement evaluates as false, and that Hire Date attribute
element is filtered out of the report.
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.
You need a list of customers who live in the same city as one of your call
centers. While it is possible to generate this report with a custom expression
that does not use an Apply function, this example uses an ApplyComparison
function to demonstrate Apply functionality within the custom expression.
(For steps to create this report without the use of an Apply function, see the
Attribute-to-attribute qualifications section of the Advanced Filters chapter
of the Advanced Reporting Guide.)
The custom expression used here evaluates whether one attribute is exactly
the same as another:
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.
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
29.
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:
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:
l Chapter 3, Operators
Common Parameters
There are three common Parameter settings for a function object:
l Fact ID: forces the calculation to take place on a fact table containing the
Fact_ID.
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.
For example, in the report shown below the Rank by Value metric ranks
the revenue values. The Rank function for this metric uses a BreakBy
of the Customer Region attribute, which means the rank calculation is
restarted for each customer region. This ensures that the revenue is
ranked by customer region, rather than ranking all of the revenues
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 55).
For example, an inventory report lists the on-hand supply for each day. The
report subtotals are the last day's 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.
l Insert Function Wizard: This interface is used to help guide you in the
initial inclusion of a function in an expression for a MicroStrategy object.
The Insert Function Wizard can be used to build a function and add it to an
expression for metrics, attributes, facts, subtotals, and transformations.
For more information, see Adding Functions to Expressions with the Insert
Function Wizard, page 57.
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 35 below that discusses the
different types of expressions in MicroStrategy.
3. Use the Next and Back buttons to step through the pages of the Insert
Function Wizard. Each page allows you to modify different function
parameters.
The pages that you see depend on the function that you select.
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 57).
In this metric, you modify the default parameter setting to Distinct=True and
retrieve a count of only the unique Orders.
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.
l 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.
l 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.
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.
?[Prompt Name]
The Prompt Name is the name of the prompt object. For example, you can
have the following definition:
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 347) 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
353) 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.
l Metric expressions
l Consolidation expressions
l Fact expressions
l Filter expressions
l Subtotal expressions
l Transformation expressions
l Derived elements
l 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.
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 Help.
you can further define filtering and grouping involved in the metric. All
metrics, by default, calculate at the report level.
l 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.
The following three types of functions can be used to build simple and
compound metrics:
l Single-value functions
l Group-value functions
l 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 14).
Exam ple 1: Sim ple Metric with Dim ensionality at the Report Level
Avg(Revenue) {~+}
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.
Exam ple 2: Sim ple Metric with Dim ensionality at Year Level
Sum(Cost) {~ +,year +}
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.
You can also create metrics in Command Manager. For more information on
this method, see the Advanced Reporting Help.
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 > Metric. The
New Metric dialog box is displayed.
3. Choose a Metric template and click OK. The Metric Editor displays.
l 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.
l
Click (Insert Function) in the Definition pane. The Insert Function
wizard opens.
l Enter 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.
3. In the pane below, select the function to use to calculate data in the
metric. You can narrow the list of functions displayed in the pane by
doing one of the following:
l To search for the function by name, type the function's name in the
search field.
5. Click Save. For additional steps to define metrics using Web, see the
MicroStrategy Web Help .
You create derived metrics based on objects already present in the report.
l Using Developer, from the Insert menu in the Report Editor, select
New Metric. Or, right-click above a metric heading in the Report
Grid, point to Insert > New Metric. The Input Metric Formula dialog
box is displayed.
l Using MicroStrategy Web from the Data menu in the Report Editor,
select Insert New Metric. The Metric Editor is displayed.
l Simple
l Implicit
l Derived
l Heterogeneous
For more information on these types of attribute forms, see the Advanced
Reporting Help.
Example 1: Subtraction ( - )
(Year(CurrentDate()) - Year([HIRE_DATE]))
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 customer's 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.
l 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 customer's first name, middle name,
and last name.
Fo r a N ew At t r i b u t e
1. From the MicroStrategy Developer File menu, point to New > Attribute.
The Attribute Editor opens three dialog boxes, if the cascading dialog
l
Click (Insert Function) in the Definition pane. The Insert Function
wizard opens.
l Enter the function name and all required expression syntax directly in
the Enter your formula here box.
Fo r an Exi st i n g At t r i b u t e
1. To access the editor, select the attribute in the folder list, object
browser, or report view and right-click and select Edit.
2. Select an attribute form and click Modify. The Modify Attribute Form
dialog box displays.
4. The Modify Attribute Form Expression dialog displays with the selected
expression loaded.
l
Click (Insert Function) in the Definition pane. The Insert Function
wizard opens.
l Enter/edit the function name and all required expression syntax in the
Enter your formula here box.
You must drag and drop attributes into the Enter your expression here
box. Only the operators can be typed directly in the box.
l Attribute qualification
l Set qualification
l A report
l A filter
l Banding
l Advanced qualification
l Logical functions
l Comparison functions
Example 1: Subtraction ( - )
([Unit_Profit] - [Unit_Cost]) > 500
Example 2: And
([Units Sold] > 500) and ([Unit Profit] > 1000)
3. Enter a name for the new element and double-click Add Qualification.
l
Click (Insert Function) in the Definition pane. The Insert Function
wizard opens.
l Enter 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.
l Implicit
l Derived
l Heterogeneous
For more information on facts and fact structure, see the MicroStrategy
Project Design Guide.
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.
2. The Expression page is where the expression is built. The functions are
accessed in one of the following ways:
l
Click (Insert Function) in the Definition pane. The Insert Function
wizard opens.
l Type the function name and all required expression syntax directly in the
Enter your formula here box.
Fo r an Exi st i n g Fact
l
Click (Insert Function) in the Definition pane. The Insert Function
wizard opens.
l Enter 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 Help .
l Logical operators
l Comparison operators
This example uses a simple comparison operator to create a filter to limit the
display of profit to values greater than $5,000.
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)
1. In the MicroStrategy Developer File menu, point to New > Filter. The
Filter Editor 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:
l 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.
l
Click (Insert Function) in the Definition pane. The Insert Function
Wizard opens.
l Enter 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.
For more information on subtotals and the procedures for creating and
applying them, see the Reports chapter of the Advanced Reporting Help 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:
l 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.
l
Click (Insert Function) in the Definition pane. The Insert Function
wizard opens.
l Enter 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).
2. Select the attribute on which to base the transformation and click OK.
The Expression Editor opens.
l
Click (Insert Function) in the Definition pane. The Insert Function
wizard opens.
l Enter 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
3. Enter the values or names of the arguments you want to add or browse
for the arguments:
l Click (the Browse button). The Open dialog box opens, which is a
Select the argument on which the function acts. Click Open to select
the argument and return to the Insert Function Wizard.
7. Click Finish. The expression built through the Insert Function Wizard
displays in the appropriate editor.
Parameter values are displayed only if you have set your view to Show
Function Parameters and have modified a parameter from its default
setting.
l SQL Engine: Generates the SQL and associated logic for functions
performed by the database, and communicates with the Analytical Engine
as necessary.
l Query Engine: Sends the SQL generated by the SQL Engine to the data
warehouse for execution.
l Analytical Engine: Extends the capability of the system beyond what the
RDBMS provides. For example, it performs complex calculations on a
result set returned from the data warehouse, such as statistical and
financial functions, subtotal calculations on the result set, metric
calculations that are not or cannot be performed using SQL, such as
complex functions, and so on.
While this extends the capabilities of the RDBMS that you are using,
calculations that require the Analytical Engine can require additional
system resources and processing time. To determine if a function is
supported by your RDBMS or will be evaluated by the Analytical Engine,
review the function support listed in Appendix A, MicroStrategy and
Database Support for Functions.
If the database can perform the calculation, the SQL Engine sends the
instructions to the database; otherwise, the Analytical Engine processes
the task.
The following subsections explore through examples of how the various uses
of functions result in different SQL syntax. All of these examples use the
functions in the context of metrics.
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.
Consider a simple report, Report 1A, where the attribute Region is placed on
the row axis and a simple metric defined as M1A=Sum(Revenue){~} is on
the column axis. This report shows the sales for each region. The database,
in this case Microsoft Access, supports the function Sum. The following SQL
is generated:
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:
l It uses the result set (that is held in memory) to compute the metric,
namely AvgDev([TOTAL_ DOLLAR_SALES]){~} for each region.
Exam ple 2: Sum (Revenue) {~, Country} vs. AvgDev(Revenue) {~, Country}
Now use the same report template as in Example 1, but add a dimensionality
to each metric for comparison. Use Sum(Revenue){~,Country} for
Report 2A and AvgDev(Revenue){~,Country} for Report 2B. Notice that
attribute Country is a parent of Region, and the relationship is one to many.
In Report 2A, the Sum function is supported by the database; in Report 2B,
the AvgDev function is supported by Intelligence Server. The SQL generated
for both reports is as follows:
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.
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 following example describes this type of usage and displays the SQL
that is generated.
l M3A = Sum(Ln(Revenue)){~+}
l M3B = Sum(Trunc(Revenue)){~+}
Put M3A with Region on the template. The database, in this case, SQL
Server 2000, supports the function Ln. The following SQL is generated:
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.
The examples below use a compound metric and a metric that transforms a
fact in the same report. The examples illustrate the SQL generated when the
function is supported by the database and the Intelligence Server,
respectively.
l M4A = Ln(Sum(Revenue){~})
l M4B = Trunc(Sum(Revenue){~})
Put metric M3A, from the previous example, and metric M4A together with
attribute Region on the template. The database, in this case SQL Server
2000, supports the Ln function. The following SQL is generated:
group by a13.REGION_ID
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:
l Window size
l BreakBy
l SortBy
l NULL handling
l Tie handling
There are two examples for each subsection, comparing the SQL syntax
when the database performs the OLAP function calculations with the one
when the Intelligence Server performs the computation.
Now, put the attributes Category and Item on the Row axis and the above
metrics on the Column axis. Run this report with an empty filter against a
database that does not support OLAP functions (in this case Microsoft
Access), the following SQL is generated:
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
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:
l Sort by Objects: This type of sorting can use either attributes or metrics.
The following examples demonstrate the differences in processing when
an attribute or metric is used.
Then add the attributes Customer Region and Customer, and the metric OM2
to the template.
For a database that does not support OLAP functions (in this case Microsoft
Access), the following SQL is generated:
LU_CUST_CITY a14,
LU_CUST_STATE a15,
LU_CUST_REGION a16
where a11.ORDER_ID = a12.ORDER_ID and
a12.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 a15.CUST_REGION_ID,
a16.CUST_REGION_NAME,
a12.CUSTOMER_ID,
a13.CUST_LAST_NAME,
a13.CUST_FIRST_NAME,
a13.CUST_CITY_ID
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.
Then add attributes Customer Region and Customer, and metric OM3 to the
template. The OLAP metric OM3 is sorted by Customer Last Name and then
by the metric [M1A].
For databases that do not support OLAP functions (in this case Microsoft
Access), the following SQL is generated:
It is not known whether databases use the same sort algorithm; therefore,
the Intelligence Server and database computation of OLAP functions can
produce different results whenever there is a tie on the data.
l Creating: creates the Microsoft Visual C++ project, which is used to build
a library containing your algorithms.
l Executing: creates new metrics that use the algorithms and using those
metrics in a MicroStrategy report.
l Single-value functions
l Group-value functions
l OLAP functions
l Numeric
l Date
l String
l Byte
l Short
l Long
l Float
l Double
l String (BSTR)
l Bool
l Date
l FORECAST<n>(numeric_vector1) = numeric1
l Aggregate function with a numeric vector as an input argument and a numeric scalar
as an output argument.
l 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)
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.
l CUSTOMNUMBERFORMAT(numeric1) = string1
l Simple function with numeric scalar as input argument and string scalar as output
argument.
l No parameters.
1. From the Start button, select Programs > Microsoft Visual Studio >
Microsoft Visual C++.
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.
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.
This is a simple metric that contains the nested group-value functions Sum
and Avg.
Next, create a report that uses this metric, placing the Call Center attribute
on the row axis and the Year attribute on the column axis. A report with this
definition is shown below.
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:
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.
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.
1 123456 123456
N 123456 123456
1 123456 123456
N 123456 123456
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:
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:
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:
Create a report with the two metrics shown above (for p-value) and the
attribute Call Center. The Hypothesis Testing report is shown below.
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.
l Pass0 and Pass1 are issued by Intelligence Server to compute the metric
Daily Sales (last year). The Intelligence Server prepares the temporary
table with Call Center and Day as its key. Then, it retrieves last year's
sales using the transformation Last Year's.
l Pass2 and Pass3 are issued to compute the metric Daily Sales (current
year). Attributes Call Center and Day are used as keys to the temporary
table. This pass is similar to Pass0 and Pass1 with the key difference
being that the metric does not have a transformation.
l In Pass4 and Pass5, the Intelligence Server computes the p-value for each
call center, using the HeteroscedasticTTest and the HomoscedasticTTest
functions.
l The remaining passes perform final report preparation and drop the
temporary tables.
The ORDER_FACT table contains all orders received. Assume that the sales
order amount is normally distributed with a certain mean and standard
deviation. Based on the assumption of normal distribution and a confidence
level of 99%, you can define valuable customers as those who have a
spending average above an upper bound of sales orders.
1. You must know the average sales order from all orders in the ORDER_
FACT table. This is the arithmetic mean of the normal distribution. You
can get this value using the Avg function. The metric to compute the
average of sales orders from the ORDER_FACT table can be defined as:
Since Day, Employee, and Order are the highest attributes that are
parents of the keys in the ORDER_FACT table, include them as the level
of aggregation to make sure that the ORDER_FACT table is used. Also,
the average must be calculated over all sales order amounts, so you
must set the group-by on the level attributes to none. This ensures that
the metric does not group by any of these attributes.
2. You must know the standard deviation of sales orders from all orders.
This number is the standard deviation of the normal distribution. You
can get this value using the StDevP function (see StDevP (Standard
Deviation of a Population), page 140).
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+}
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])
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:
a11.[ORDER_DATE] AS DAY_DATE,
a11.[CUSTOMER_ID] AS CUSTOMER_ID0,
(a11.[QTY_SOLD] * (a11.[UNIT_PRICE] - a11.[DISCOUNT]))
AS WJXBFS1
from [ORDER_DETAIL] a11
Pass3 - Execution Duration: 0:00:00.10
create table ZZTW4A12VECMD001 (
CUSTOMER_ID LONG,
WJXBFS1 DOUBLE)
Pass4 - Execution Duration: 0:00:00.00
[Analytical SQL calculated by the Analytical Engine:
select CUSTOMER_ID0,
(ISNULL(avg(WJXBFS1), 0) + Confidence(0.01,
StdevP(WJXBFS1), count(WJXBFS1)))
from [previous pass]
]
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
l Pass0 and Pass1 compute the average sales per customer (Average Sales
metric) and put the results in a temporary table.
l Pass2 retrieves ORDER_DETAIL data, puts the data into memory, and uses
the data to compute M01, M02, and M03.
l 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.
l Pass5 inserts the results of the calculations into the temporary table.
l Pass6 and Pass7 use the earlier two temporary tables to qualify on
valuable customers based on the definition.
l Pass8 displays the report with attributes Customer and Customer Region.
l The remaining passes perform additional report preparation and drop the
temporary tables.
Assume a normal distribution of sales orders is still valid, but the cut-off
value is for each Customer Region. This means you must compare the
average spending of each customer against the average spending of the
Customer Region to which the customer belongs. To allow for more
variation, take the average value from the current year data, but use sample
standard deviations for all available years. Use a confidence level of 95%.
Valuable customers are defined as those customers who have total spending
above the cut-off value. The cut-off value is calculated using the filters and
metrics defined below:
1. The filter used to limit the calculation of average sales orders to only
the data for the current year is defined as follows:
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.
WJXBFS1 DOUBLE)
Pass3 - Execution Duration: 0:00:02.18
insert into ZZT36UF785VMD001
select a14.[CUST_REGION_ID] AS CUST_REGION_ID,
avg((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,
[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)
sum((a11.[QTY_SOLD] * (a11.[UNIT_PRICE] -
a11.[DISCOUNT]))) AS WJXBFS1
from [ORDER_DETAIL] a11,
[ZZTSMWZF9SRMQ003] pa12
where a11.[CUSTOMER_ID] = pa12.[CUSTOMER_ID]
group by a11.[ORDER_DATE],
a11.[CUSTOMER_ID]
Pass12 - Execution Duration: 0:00:00.00
create table ZZTQFB0EMCJMB005 (
CUSTOMER_ID LONG,
WJXBFS1 TIMESTAMP)
Pass13 - Execution Duration: 0:00:00.59
insert into ZZTQFB0EMCJMB005
select pc11.[CUSTOMER_ID] AS CUSTOMER_ID,
max(pc11.[DAY_DATE]) AS WJXBFS1
from [ZZTRX7EEWHNNB004] pc11
group by pc11.[CUSTOMER_ID]
Pass14 - Execution Duration: 0:00:00.78
select distinct pa11.[CUSTOMER_ID] AS CUSTOMER_ID,
a13.[CUST_LAST_NAME] AS CUST_LAST_NAME,
a13.[CUST_FIRST_NAME] AS CUST_FIRST_NAME,
a15.[CUST_REGION_ID] AS CUST_REGION_ID,
a16.[CUST_REGION_NAME] AS CUST_REGION_NAME0,
pa11.[WJXBFS1] AS WJXBFS1
from [ZZTRX7EEWHNNB004] pa11,
[ZZTQFB0EMCJMB005] pa12,
[LU_CUSTOMER] a13,
[LU_CUST_CITY] a14,
[LU_CUST_STATE] a15,
[LU_CUST_REGION] a16
where pa11.[CUSTOMER_ID] = pa12.[CUSTOMER_ID] and
pa11.[DAY_DATE] = pa12.[WJXBFS1] and
pa11.[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]
Pass15 - Execution Duration: 0:00:00.00
l Pass4, Pass5, Pass6, and Pass7 compute (1.96 * M08). The group-value
function for M08, StDev, is not supported by the database (Microsoft
Access) so it is calculated by Intelligence Server.
l Pass8 and Pass9 obtain the list of valuable customers, evaluating the filter
condition F03.
l Pass10, Pass11, Pass12, and Pass13 compute the Last Order Sales
metric.
l How much is the 25th and 75th percentile of customer spending in each
customer region?
To answer the questions above, you must create a set of simple metrics
based on other metrics. These metrics are defined using nested group-value
functions.
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:
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
l The first two passes of SQL (Pass0 and Pass1) prepare and calculate the
values used in other metrics.
l 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.
l 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
To plot a sales line for the expected future sales data, apply linear
extrapolation techniques to the historical data. Linear extrapolation involves
the assumption that the trend of past data will continue in a linear fashion.
The slope and Y-intercept values are calculated based on historical data,
and the same slope and Y-intercept are applied to extend the data into the
future.
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+}
3. The metric that calculates the slope of the line produced by the
Revenue {Year} metric is defined as follows:
4. The metric that calculates the Y-intercept of the line produced by the
Revenue {Year} metric is defined as follows:
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:
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.
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
where pa11.[CATEGORY_ID] = pa12.[CATEGORY_ID] and
pa11.[CATEGORY_ID] = a13.[CATEGORY_ID]
Pass16 - Execution Duration: 0:00:00.00
[Populate Report Data]
Pass17 - Execution Duration: 0:00:00.00
drop table ZZT16JMSID1MD000
Pass18 - Execution Duration: 0:00:00.00
drop table ZZT3M2QSNWDMD001
Pass19 - Execution Duration: 0:00:00.00
drop table ZZTDMBESMXPOJ002
Pass20 - Execution Duration: 0:00:00.00
drop table ZZT9MCAB4STOD003
Pass21 - Execution Duration: 0:00:00.00
drop table ZZTMYCAAR65MD004
l The remaining passes prepare the report and drop the temporary tables.
The standard functions in this chapter range from simple operations like Sum
and Product to internal functions that allow you to define your own metrics,
facts, and filters. Taken as a set, they provide a powerful toolset for
performing common mathematical calculations, grouping data, examining
correlation, validating data, and formatting report information for display.
l Usage notes describing any error conditions, invalid data types, or key
information to know before using the function (if applicable)
l The report examples in this section use objects and data found in the
MicroStrategy Tutorial.
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 144), 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 322) instead of the Add function.
Syntax
Where
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 117), 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
Where:
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.
Syntax
Avg<Distinct, FactID
Where:
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 12 and Example 2: Compound Metric, page 13, as well as
Example 1: Average, page 14.
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:
You can also define how the condition is evaluated by clicking Condition
advanced options:
l 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.
l 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:
l 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.
l 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.
l 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
Where:
l 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.
l 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.
Example
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:
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:
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:
This function takes the product of a set of values of size N and returns the
Nth root of the result (also known as geometric mean). GeoMean is a group-
value function.
Syntax
GeoMean <FactID>(Argument)
Where:
Expression
Usage Notes
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 year's 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.
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
Where:
Example
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.
Result
List 1 List 2
List
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:
F m-1 is the total number of observations in all bars below the median bar.
Syntax
HistogramMedian([ValueList], NumberOfHistograms)
Where:
Example
This example shows a report to find the median Revenue per Customer for
each Income Bracket in the Central 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:
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:
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
Where:
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.
Result
List 1 List 2
List
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:
l 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.
l To define the level options, for each level, click the Level options icon (
).
To include only data that meets the conditions in the report filter in
the metric calculation, select Standard filtering.
To raise the level of the report filter to the level of the target, if
possible, then apply the report filter to the metric calculation, select
Absolute filtering. For example, the report filter contains the
Washington, DC, Boston, and New York call centers, but the
Revenue metric is calculated at the Region level. Because Call
Center is a child attribute of Region, the report filter's level is raised
From the to the Region level, and the report filter is treated as if it includes the
Relationship with regions that contain Washington, DC, Boston, and New York (in this
Report Filter drop- case, Mid-Atlantic and Northeast). Data from all call centers in the
down list, you can Mid-Atlantic or Northeast regions are included in the metric
define how the calculation, including call centers that are not Washington, DC,
report filter affects Boston, or New York.
the metric
calculation. To ignore any conditions in the report filter that are based on the
target attribute, as well as any parent or child attributes of the
target, select Ignore filtering. For example, if you have a regional
revenue metric on a report, any conditions based on Country,
Region, or Call Center in the report filter are ignored when
calculating the metric. However, a condition based on Year would
not be ignored, since Year is not directly related to Region.
To allow the target and group components of the level to define the
filter, select None.
To exclude the target attribute from being used to group data in the
metric, select None. Any children of the target attribute are also
excluded. This option is available for metrics calculated at a set
level, as opposed to the report level.
• To use the last value in the lookup table, select Ending lookup.
• To use the first value in the fact table, select Beginning fact.
• To use the last value in the fact table, select Ending fact.
l To define the advanced level options, such as whether to apply the metric
filter to the metric calculation, click Level advanced options:
l 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.
calculation. This options lets you determine which parts of the metric
filter are applied based on the data that has been included on the report.
This option can help you re-use the same metric in multiple reports,
eliminating the need to create and maintain multiple metrics, particularly
if the metric and filter qualifications are complex. For an example,
including an explanation of how the report SQL is affected by this option,
see the Advanced Reporting Guide. 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
Where:
Example
This example shows a dossier grid displaying the sales range of items within
a subcategory (Aisle). The Max function is used to determine the highest
sales of an item within a subcategory. The metric, Maximum Sale, is defined
as follows:
Max (Sales){~}
The metric is placed on the grid with the attributes Department and Aisle and
the metrics Sale Total and Minimum Sale. The resulting grid 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:
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 14.
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
Where:
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:
Mode
Returns the most frequently occurring value in a given list. This is a group-
value function.
Syntax
Where:
Usage Notes
Example
This example shows a report that retrieves the mode of the unit cost for
items in a subcategory. The report returns the most frequently repeated unit
cost within the various subcategories, and, in the cases of Electronics, TVs,
and Video Equipment, it returns a NULL value, because there are no
recurring unit cost values for them. The report contains the attributes
Category and Subcategory, and the metric Mode Unit Cost. A report filter
limits the categories displayed to Books and Electronics. The Mode Unit
Cost metric is defined as follows:
Mode([Unit Cost])
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 140), 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 321) rather than the Multiply function.
Syntax
Where:
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
Example
Given a value list containing the values (1,2,3,4), the product calculates as
1*2*3*4 = 24.
Syntax
Where:
Expression
Usage Notes
l When very large population samples are used, this function and the StDev
(Standard Deviation of a Sample), page 142 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
Syntax
Where:
Expression
Usage Notes
l When very large population samples are used, this function and the
StDevP (Standard Deviation of a Population), page 140function 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:
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
Where:
Example
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
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:
Syntax
VarP <FactID>(Argument)
Where:
Expression
Usage Notes
Example
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:
Syntax
Where:
Expression
Usage Notes
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.
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:
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:
For information on whether your database supports various date and time
functions, see the Appendix A, MicroStrategy and Database Support for
Functions.
Example
AddDays('2020-07-29', 4) = 2020-08-02
AddDays(TimeDate, -4/24)
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:
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
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:
For information on whether your database supports various date and time
functions, see Appendix A, MicroStrategy and Database Support for
Functions.
Example
DateDiff
DateDiff is used to calculate the length of time between two dates. A
numeric value is returned.
Syntax
Where:
l 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
l 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"
For information on whether your database supports various date and time
functions, see Appendix A, MicroStrategy and Database Support for
Functions.
Example
You can use DateDiff to create a metric or attribute form that lists the length
of time between two dates. One common way to do this is to compare the
date information you have stored to the current date. Consider a report or
dossier that includes a Day attribute with a single ID form. You can create a
metric with the following definition:
For each element of the Day attribute, the metric displays the number of
days between that date and the current date when running the report or
dossier.
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:
For information on whether your database supports various date and time
functions, see Appendix A, MicroStrategy and Database Support for
Functions.
Example
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:
For information on whether your database supports various date and time
functions, see Appendix A, MicroStrategy and Database Support for
Functions.
Example
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:
For information on whether your database supports various date and time
functions, see Appendix A, MicroStrategy and Database Support for
Functions.
Example
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:
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.
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
Syntax
FiscalMonth<firstMonth>(Date/Time)
Where:
For information on whether your database supports various date and time
functions, see Appendix A, MicroStrategy and Database Support for
Functions.
Example
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:
For information on whether your database supports various date and time
functions, see Appendix A, MicroStrategy and Database Support for
Functions.
Example
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:
For information on whether your database supports various date and time
functions, see Appendix A, MicroStrategy and Database Support for
Functions.
Example
FiscalWeek<firstWeekDay=1, firstMonth=7>(Day)
For each element of the Day attribute, the metric displays the numeric
position of the week within the fiscal year for that date. For this example,
since the fiscal year starts in July, a date of July 8, 2014 would return 2. This
is because the first fiscal week runs from July 1 st through July 5 th . Then on
July 6 th , the first Sunday of the fiscal year, the second fiscal week starts.
This week includes July 8 th , and so 2 is returned.
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:
For information on whether your database supports various date and time
functions, see Appendix A, MicroStrategy and Database Support for
Functions.
Example
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:
For information on whether your database supports various date and time
functions, see Appendix A, MicroStrategy and Database Support for
Functions.
Example
Millisecond
Returns the integer value for the millisecond of the input time.
Syntax
Millisecond(Argument)
Where:
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:
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:
For information on whether your database supports various date and time
functions, see Appendix A, MicroStrategy and Database Support for
Functions.
Example
MonthEndDate
Returns the date of the last day of the month in which a date or timestamp
occurs.
Syntax
MonthEndDate(Date/Time)
Where:
For information on whether your database supports various date and time
functions,see Appendix A, MicroStrategy and Database Support for
Functions.
Example
MonthStartDate
Returns the date of the first day of the month in which a date or timestamp
occurs.
Syntax
MonthStartDate(Date/Time)
Where:
For information on whether your database supports various date and time
functions, see Appendix A, MicroStrategy and Database Support for
Functions.
Example
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:
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:
For information on whether your database supports various date and time
functions, see Appendix A, MicroStrategy and Database Support for
Functions.
Example
QuarterStartDate
Returns the date of the first day of the quarter in which a date or timestamp
occurs.
Syntax
QuarterStartDate<firstMonth>(Date/Time)
Where:
For information on whether your database supports various date and time
functions, see Appendix A, MicroStrategy and Database Support for
Functions.
Example
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:
For information on whether your database supports various date and time
functions, see Appendix A, MicroStrategy and Database Support for
Functions.
Example
Syntax
ToDateTime<Pattern=null>(Argument)
Where:
ToDateTime<pattern="MM/dd/yyyy">(Day@ID)
To specify a pattern, you can use custom formatting symbols that conform
to the standards of the International Components for Unicode. For
information about the custom formatting standards and syntax, see
Formatting Dates and Times in the ICU Documentation.
Example
ToDateTime<pattern="MM/dd/yyyy">(Day@ID)
This example would return the data stored for the ID form of Day in a date
format that includes month, day, and year information.
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:
For information on whether your database supports various date and time
functions, see Appendix A, MicroStrategy and Database Support for
Functions.
Example
WeekStartDate
Returns the date of the first day of the week in which a date or timestamp
occurs.
Syntax
WeekStartDate<firstDay>(Date/Time)
Where:
For information on whether your database supports various date and time
functions, see Appendix A, MicroStrategy and Database Support for
Functions.
Example
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:
For information on whether your database supports various date and time
functions, see Appendix A, MicroStrategy and Database Support for
Functions.
Example
YearEndDate
Returns the date of the last day of the year in which a date or timestamp
occurs.
Syntax
YearEndDate(Date/Time)
Where:
For information on whether your database supports various date and time
functions, see Appendix A, MicroStrategy and Database Support for
Functions.
Example
YearStartDate
Returns the date of the first day of the year in which a date or timestamp
occurs.
Syntax
YearStartDate(Date/Time)
Where:
For information on whether your database supports various date and time
functions, see Appendix A, MicroStrategy and Database Support for
Functions.
Examples
Internal Functions
The following are internal function types:
To use Apply functions, you must have the Use FreeForm SQL Editor
privilege.
l The "#n" code in Apply function syntax serves as placeholders for the
MicroStrategy objects being passed to your database. The index for
referencing these objects begins with 0 and increases by 1 for each
successive object passed.
#0, #1, and so forth) exceeds the number of objects passed in that
function, MicroStrategy passes the last available object in place of the
extra reference(s).
ApplyComparison(UPPER(#0) like
'Z####%', Country@DESC)
l 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 Customer's first
name, middle name, and last name, use ID or any other single form.
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.
Syntax
ApplyAgg()
Example
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.
Syntax
ApplyComparison()
Example
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.
Syntax
ApplyLogic()
Example
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.
Syntax
ApplyOLAP()
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.
l Attribute form
For any Apply function, the attribute form in the arguments should be a
single form—not a form group. The engine ignores any definitions based
on attribute forms.
l Consolidation
l Custom group
l Fact
l Metric
l Subtotal
l Transformation
Syntax
ApplySimple()
Expression
Examples
type
Compound ApplySimple(" CASE WHEN #0 between 0 and 100000 THEN 'Low' WHEN
Metric #0 between 100001 and 200000 THEN 'Med' ELSE 'High' END ", Sum
(Revenue){~})
l ApplySimple("Datediff(YY,#0,getdate())", [BIRTH_DATE])
l ApplySimple("Months_between(sysdate,#0)", [CURRENT_DT])
l ApplySimple("Sum(#0)",[Column 1])
l 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:
l 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
Where:
l Argument is a metric.
l StartAt and StopAt are real numbers specifying the full range of the
values to be placed in bands.
Usage Notes
Values in the list that fall outside of the start and end values set in the
function syntax are assigned a band of 0 (zero) in the report interface.
Example
The following example shows how the Banding function acts on report data.
In this case the total revenue for each city is used to divide the report data
into bands:
Syntax
Where:
l Argument is a metric.
l StartAt and StopAt are real numbers specifying the full range of the
values to be placed in bands.
Usage Notes
Values that fall outside of the range indicated by the Start and Stop values
are assigned a band of 0 (zero).
Example
The following example shows how the BandingC function acts on report
data. This example uses the same set of values as the example for the
Banding function. Using the BandingC function, you can designate the
number of bands created for the range of values.
Where:
l 25 is the number of bands into which you want the values divided.
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.
Syntax
Where:
l Argument is a metric.
Example
The following example shows how the BandingP function acts on report
data. This example again uses the same data set as in the previous
examples (Banding and BandingC). Using the BandingP function, you can
designate the boundaries for each interval.
BandingP([Total Revenue],
1,20000,40000,60000,80000,100000,410000)
Where:
l All other values specify the boundaries of an interval. There are six
intervals defined as follows:
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.
Syntax
Where:
l ... represents any number of Conditions and Return Values that can be
passed through this function.
Example
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.
Syntax
Where:
l ... represents any number of Conditions and Return Values that can be
passed through this function.
Usage Notes
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
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.
Syntax
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 Help.
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.
Syntax
IsNotNull(Argument)
Where:
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.
Syntax
IsNull(Argument)
Where:
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:
Example
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:
Example
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
Example
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:
l 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.
l 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.
l 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.
within the specified window size and can restart based on an attribute
specified in the function parameters.
Syntax
Where:
l Rate is a positive real number specifying the base weight applied to each
argument value. In the calculation, exponents are sequentially applied to
the rate value. Assign a rate of less than one to give more emphasis to
more recent data; assign a rate of greater than 1 to give greater emphasis
to past data.
Expression
Where:
l k = row number
l n = number of rows
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.
EWM
Values Calculation
average
The rate of 0.5 changes the moving average to apply more significance, or
weight, to more recent data. This means that the number of Sales employees
during the first quarter (13) has less 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 larger. This is because more significance is given to
more recent data, and the recent trend is that employment is on the rise.
This is shown in the report below.
Conversely, you can modify the same ExpWghMovingAvg metric to use the
following expression:
Syntax
Where:
l Rate is a positive real number specifying the base weight applied to each
argument value. In the calculation, exponents are sequentially applied to
the rate value. Assign a rate of less than one to give more emphasis to
more recent data; assign a rate of greater than 1 to give greater emphasis
to past data.
Expression
Where:
l k = row number
l n = number of rows
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.
EWR
values calculation
average
EWR
values calculation
average
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.
Syntax
Where:
Expression
Where:
l k = row number
l y 1 = 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:
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
Where:
l 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 207).
For example, with an offset of two, row three displays data for the row two
behind it, which would be row one.
l 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.
l 0: To display a value of 0 for any entries that do not have any data due
to the offset, type 0.
l 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:
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.
l 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 453, GrowthV (Growth, Vector Input), page 459, and
TrendV (Trend, Vector Input), page 488. Additionally, you can use data
mining functions from MicroStrategy Data Mining Services to predict
future trends, as described in Data Mining Functions, page 343.
For example, a Last Year's 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.
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.
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 Year's 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.
Syntax
Where:
Expression
Where:
l k = row number
l y k = 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
Where:
l 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
200). For example, with an offset of two, row one displays data for the row
two ahead of it, which would be row three.
l 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.
l 0: To display a value of 0 for any entries that do not have any data due
to the offset, type 0.
l 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 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:
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.
Syntax
Where:
Expression
Where:
l m= window size
Example
Values MovingAverage
10 10 (10/1)
Values MovingAverage
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)
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:
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 192.
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
Where:
Expression
Where:
l m= window size
l 1 i = 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
l 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).
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
Where:
Expression
Copyright © 2023 All Rights Reserved 214
Fu n ct io n s Refer en ce
Where:
l m = window size
Example
Values MovingDifference
400
500
Syntax
Where:
Expression
Where:
l m = window size
Example
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)
Syntax
Where:
Expression
Where:
l m = window size
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)
Syntax
Where:
Expression
Where:
l y = average of metric
l m= window size
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:
Syntax
Where:
Expression
Where:
l y = average of metric
l m = window size
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:
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
Where:
Expression
Where:
l m = window size
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)
calculation, you can use OLAPAvg to include values both above and below
the current row in the calculation.
Syntax
Where:
l 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:
l Top of data set (0): The calculation starts at the top value as determined
by the BreakBy and SortBy values.
l 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.
l 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.
l 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).
l 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:
l Bottom of data set (1): The calculation stops at the bottom value as
determined by the BreakBy and SortBy values.
l 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.
l 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.
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:
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.
Syntax
Where:
l 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:
l Top of data set (0): The calculation starts at the top value as determined
by the BreakBy and SortBy values.
l 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.
l 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.
l 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).
l 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:
l Bottom of data set (1): The calculation stops at the bottom value. The
top value is determined by the BreakBy and SortBy values.
l 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.
l 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.
The function is not valid if your starting point is at a lower point than your
ending point.
Example
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).
There are a few facts about this data to take note of.
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
Where:
l 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:
l Top of data set (0): The calculation starts at the top value as determined
by the BreakBy and SortBy values.
l 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.
l 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.
l 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).
l 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:
l Bottom of data set (1): The calculation stops at the bottom value. The
top value is determined by the BreakBy and SortBy values.
l 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.
l 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.
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:
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).
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.
Syntax
Where:
l 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:
l Top of data set (0): The calculation starts at the top value as determined
by the BreakBy and SortBy values.
l 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.
l 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.
l 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).
l 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:
l Bottom of data set (1): The calculation stops at the bottom value. The
top value is determined by the BreakBy and SortBy values.
l 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.
l 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.
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:
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).
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.
l Since OLAPRank is calculated in the database, you can only use this
function if your database supports the OLAPRank function.
l 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.
Syntax
OLAPRank<BreakBy, SortBy>()
Where:
Example
To extend this analysis, you can create an OLAPRank Avg Rev per
Customer metric as defined below:
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.
Syntax
Where:
l OLAPWinStType defines the window type for the starting location of the
calculation. Select one of the following options, listed by the name of the
l Top of data set (0): The calculation starts at the top value as determined
by the BreakBy and SortBy values.
l 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.
l 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.
l 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).
l 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:
l Bottom of data set (1): The calculation stops at the bottom value. The
top value is determined by the BreakBy and SortBy values.
l 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.
l 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.
The function is not valid if your starting point is at a lower point than your
ending point.
Example
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).
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.
Syntax
RunningAvg <BreakBy,SortBy>(Argument)
Where:
Expression
Where:
l m = window size
Example
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:
Expression
Where:
1 i = 1 otherwise
Example
l 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).
Syntax
Where:
Expression
Where:
Example
This simple example illustrates how the RunningMax function moves through
a list of values comparing each value to the highest value identified so far
and returning the maximum value as it progresses. The calculation is shown
in the following table.
Values RunningMaximum
Values RunningMaximum
6 8 (8>6)
10 10 (10>8)
9 10 (10>9)
5 10 (10>5)
Syntax
Where:
Expression
Where:
Example
Values RunningMinimum
6 6 (6<8)
10 6 (6<10)
9 6 (6<9)
5 5 (5<6)
Syntax
Where:
Expression
Where:
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 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:
Syntax
RunningStDev<BreakBy,SortBy>(Argument)
Where:
Expression
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:
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
Syntax
RunningSum <BreakBy,SortBy>(Argument)
Where:
l BreakBy is the parameter that sets the attribute designating where the
calculation restarts.
l SortBy is the parameter that sets the attribute or metric by which the data
is sorted.
Expression
Example
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:
Note that the subtotaled Total Revenue is equal to the last value in the
Running Sum column for each region.
Syntax
Where:
Expression
Where:
Usage Notes
Example
l Correlation:
l Weighted Correlation:
Syntax
Where:
Expression
l
= average value of x
= average value of y
l
Usage Notes
Example
l Covariance:
l Weighted Covariance:
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.
Syntax
WeightedMean<FactID>(Argument1, Weight)
Where:
Expression
Example
The expressions for the average and weighted mean calculations are as
follows:
l Average Revenue:
Avg(Revenue){Year}
The weighted mean takes into account the weights of each revenue value.
For example, since Central's percent growth is greater than Northwest's
percent growth, and the weight in this example is the percent growth,
Central's 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 dossier. You can include the Average Revenue and
Weighted Mean Revenue results in text fields along with additional
visualizations of the data, as shown below.
Syntax
Where:
Expression
Where:
l w i : 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.
Usage Notes
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.
l Standard Deviation:
StDev(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 weighted standard deviation also takes into account the weights of each
revenue value. For example, since Connecticut's revenue is greater than
Maine's revenue, and the weight in this example is the revenue value,
Connecticut's revenue is given more significance in the weighted standard
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 dossier. You can include the standard
deviation and weighted standard deviation results in text fields along with
additional visualizations of the data, as shown below.
Pattern Functions
Sequential Pattern Matching (SPM) takes an input table, sorts it in a
specified sequence, then scans through the rows looking for a pattern
across rows, and then returns aggregate information based on the matching
rows.
PatternMatch
This function defines a transaction in terms of a Derived Attribute. One or
more attribute elements or metric values will be mapped to the same
transaction group (assign the same integer number) if matching with a given
pattern.
Syn t ax
Where:
PatternMatchCorr
This function defines a transaction in terms of a Derived Attribute. Given
attribute elements or metric values are mapped to the same transaction
group only if input1 (ValueList1) matches with a pre-defined pattern and
input2 (ValueList2) qualifies on certain conditions.
Syn t ax
Where:
transaction group (assign the same integer number). "-1" value indicates
no limitation.
l maxDiff specifies the maximum difference between the minimum and the
maximum elements within ValueList2 to be mapped to the same
transaction group (assign the same integer number). "-1" value indicates
no limitation.
PatternMatchDiff
This function defines a transaction in terms of a Derived Attribute. One or
more given attribute elements or metric values are mapped to the same
transaction group (assign the same integer number) if certain conditions
(specified by parameters: maxPairDiff, maxDiff and maxNum) are met.
Syn t ax
Where:
l maxDiff specifies the maximum difference between the first and the last
elements within the ValueList to be mapped to the same transaction group
(assigned with the same transaction number). "-1" value indicates no
limitation.
NTile functions are used to group the values in an ordered list into one of
several buckets or NTiles. Each element in the list is assigned an integer
corresponding to the bucket to which it belongs. The various NTile functions
differ in how the buckets are defined. Some functions allow you to define the
number of buckets, others allow you to define the size of the buckets, and so
on.
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.
Syntax
Where:
l BreakBy is the parameter that sets the attribute determining where the
calculation restarts.
Example
Example 1: If you define Tiles=4 for a metric that contains 20 values, the
function distributes the numbers as follows:
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
Where:
l BreakBy is the parameter that sets the attribute determining where the
calculation restarts.
Example
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:
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
Where:
l BreakBy is the parameter that sets the attribute determining where the
calculation restarts.
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:
l 5 £ x < 30 in bucket 1
l 30 £ x < 55 in bucket 2
l 55 £ x < 80 in bucket 3
l 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 reports and components used in this example are available in the
MicroStrategy Tutorial under the following folder:
MicroStrategy Tutorial\Public Objects\Reports\MicroStrate
gy Platform Capabilities\Advanced Analytics\Statistics an
d Forecasting\Histogram
You are interested in finding out how your customers are distributed based
on their contributions to sales data. This example segments customers into
10 separate groups, with each group representing the customers within a
10% increment of sales. For example, the first segment includes the
customers who spend in the lowest 10% of the sales, while the final, tenth
segment includes the customers who spend in the top 10% of the sales.
l Custom group
To create a general solution that can be used by different users, use object
prompts (see instructions below).
l Choose a base fact. This object prompt asks the user to select a fact:
Revenue, Profit, or Units Sold.
l 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:
2. To put the value in the proper buckets (tiles), create another metric
defined as:
4. Choose to show only individual items within this element since the
objective is to build a graph (histogram) for this custom group.
6. Since there is no column to perform the count, define the metric so that
the database can calculate how many attribute elements are in each
custom group element.
7. Add the Decile by Value custom group to the row axis, and the Count of
Samples metric to the column axis.
8. Execute the report with attribute Customer and fact Revenue, and the
Decile Histogram, in Grid mode, displays as follows:
l Pass0 computes the revenue for each Customer using the Sample Set
Metric.
l The next three passes (Pass1, Pass2, and Pass3) prepare the dynamic
classification of Customer for the custom group. This series of SQL passes
essentially builds a dynamic lookup table for the classification that is
requested. The column DA stands for Dynamic Attribute. The Intelligence
Server computes the NTileValue function. This is indicated by [An
Analytical SQL] in Pass3. The value is then inserted, with the new
classification, into the dynamic lookup table for the 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
Where:
l BreakBy is the parameter that sets the attribute determining where the
calculation restarts.
l 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:
Percentile
Returns the n th 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
Where:
l Percent is the decimal value of the percent for which you want to use as
a threshold.
Example
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.
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.
l You use the Rank function (see Rank , page 289) to rank values as an
integer value. For example you can rank profit for five categories from 1 to
5.
Syntax
Where:
Example
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 year's profit for a particular region based on (relative to) the profit
from the previous year.
l The Rank function (see Rank , page 289) ranks values as an integer value.
For example, you can rank profit for five categories from 1 to 5.
Syntax
Where:
different range of values than Revenue. However, using last year's profit
to rank this year's profit can provide relevant results as the profits
between last year and this year are more likely to be in the same range of
values.
l TRUE: Values from Rank that are outside of the range of values from
Argument are included in the ranking. This often results in showing
values such as 100% or 0%.
l FALSE (default): Values from Rank that are outside of the range of
values from Argument are not included in the ranking. The results are
left blank rather than showing a percentage.
Example
The definition for the Percent Rank Revenue metric in this example is:
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 quarter's 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
284.
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
Where:
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.
For Rank functions that are performed by the Analytical Engine, you have
the following options for this parameter:
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.
l -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.
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 by Percent:
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 Help.
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 326.
Syntax
BeginsWith(String, Pattern)
Where:
l String is the string that is being searched. You can use facts, metrics,
columns, or string values.
l 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.
Syntax
Char(Argument)
Where:
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)
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
Where:
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 297 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 299.
Syntax
ConcatAgg<Delimiter, FactID
Where:
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 ConcatAggBlank function can help to create attribute forms that are a
combination of multiple rows in database tables. For example, an LU_
CUSTOMER table includes a column CUST_LAST_NAME. You can create a
single attribute form that combines all the values (rows) for CUST_LAST_
NAME into a single attribute form:
ConcatAgg([CUST_LAST_NAME])
Each last name is concatenated, separating each last name with a comma
by default.
Syntax
Where:
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 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.
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 328.
Syntax
EndsWith(String, Pattern)
Where:
l String is the string that is being searched. You can use facts, metrics,
columns, or string values.
l 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
Returns 1 for prices that end in .99, such as 10.99, 11.99, and so on.
If String is an attribute form, the EndsWith function can only be used to create
attributes, not metrics. If you use an expression similar to the one below to create a
new metric, you receive an error message.
To capitalize the first letter of every word in a string, see TitleCap (Title
Capitalization), page 314.
Syntax
InitCap(Argument)
Where:
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.
Another way to use this function would be to create an attribute form that
combined the first letter of someone's first name with the person's 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:
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.
Syntax
Where:
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.
Syntax
Where:
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 LeftStr function can be used to create attribute forms that use
abbreviations. This can help reduce the length for attribute forms that may
have long descriptions.
LeftStr([CUST_FIRST_NAME], 1)
The integer value of 1 causes the LeftStr function to only display the first
character at the far left position for all inputs from the CUST_FIRST_NAME
column.
For an additional example of using the LeftStr function, see the example
section for the function InitCap (Initial Capitalization), page 299.
Syntax
Length(Argument)
Where:
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:
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 database's 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 415.
Lower may be used to help standardize the display of information and make
the information more readable.
Syntax
Lower(Argument)
Where:
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 Lower function can be used to display information in all lower case for
attribute forms. For example, an LU_CUSTOMER table includes an ADDRESS
column. You can create an attribute form to display all characters for a
customer's 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.
The LTrim function helps to remove blank spaces that 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
LTrim(Argument)
Where:
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
LTrim([ADDRESS])
Any leading blank spaces included for addresses are removed from the
display for the attribute form.
To remove both leading and trailing blank spaces, use the Trim function
(Trim, page 316).
Match
The Match function uses regular expressions to search a string for a pattern
of characters and returns any matches that are found.
Syntax
Where:
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
For example:
By default this returns the entire string that is the first match, which is 703-555-1234.
This returns the first group (the first search criteria in parentheses) from the first
occurrence, which is 703.
This returns the third group (the third search criteria in parentheses) from the second
occurrence, which is 6789.
Syntax
Where:
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
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.
Syntax
RepeatStr(String, Times)
Where:
l 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
Where:
l Find is a metric, fact, column, or string representing the text strings that
are searched for within 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.
RightStr can be used to create attribute forms that display only part of the
information available. This can be helpful when some information needs to
be hidden for security purposes, as in the credit card example below.
Syntax
Where:
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
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.
This definition would modify the display of a credit card number from 1111-
2222-3333-4444 to be displayed as XXXX-XXXX-XXXX-4444.
RTrim helps to remove 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
RTrim(Argument)
Where:
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
RTrim([ADDRESS])
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 316).
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
Where:
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:
l If you define Index as any value other than 1, a NULL value is returned.
Example
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".
This returns a NULL value, since the string is only split into three separate strings.
Syntax
Where:
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
sale for an item, you can create an attribute form to return these two digits.
The definition of such an attribute form is shown below:
SubStr(ITEM_ID, 4, 2)
The substring retrieved starts at the fourth digit and retrieves two
characters. For an item ID of 2334560897, this function returns 45.
To capitalize only the first letter of the first word in a string, see InitCap
(Initial Capitalization), page 299.
Syntax
TitleCap(Argument)
Where:
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")
TitleCap("john SMITH")
Syntax
ToNumber(Argument)
Where:
Example
ToNumber("1001")
ToNumber("1.48e12")
Syntax
ToString<Pattern=null>(Argument)
Where:
ToString<pattern="0,000.00">(Revenue)
To specify a pattern, you can use the custom numeric, date, and time
formatting symbols that are described in the Advanced Reporting Help.
Example
ToString<pattern="0,000.00">(1001)
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:
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
Trim([ADDRESS])
Any leading or trailing blank spaces included in the addresses are removed
from the display for the attribute form.
Syntax
Upper(Argument)
Where:
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
Upper([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.
O PERATORS
The operators described in this chapter are building block functions. They
provide the means to perform simple mathematical operations, compare
values, search strings, and evaluate logical conditions.
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
Revenue - Freight
This metric returns the difference between the revenue and freight charges.
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
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
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
Cost + Freight
This metric returns the sum of the cost and the freight charges.
Syntax
U-(Arg)
Where:
Example
U-(Profit)
This metric changes the sign of the profit value. If the profit value is
negative, it returns a positive value. If the profit value is positive, it returns a
negative value.
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.
Syntax
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
This condition returns TRUE only if the profit is less than the cost.
Syntax
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
This condition returns TRUE only if the profit is less than or equal to the
cost.
Syntax
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
This condition returns TRUE only if the profit is not equal to 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
Profit = Cost
Greater (>)
Returns TRUE if the first value is greater than the second value.
Syntax
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
This condition returns TRUE only if the profit is greater than the cost.
Syntax
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
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 294.
Syntax
Where:
The text pattern comparison may or may not be case sensitive depending on
the database implementation.
Example
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
Where:
Example
Contains
Returns TRUE if a text string contains a specified text pattern.
Syntax
Where:
Example
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 298.
Syntax
Where:
Example
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
Where:
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.
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:
Example
Syntax
Where:
Example
Not Between
Returns TRUE if a specified value does not lie in between two given
boundaries.
Syntax
Where:
Value, Boundary1, and Boundary2 must be of the same data type. They
can be of any data type that MicroStrategy supports.
Example
Not Contains
Returns TRUE if a text string does not contain the specified text pattern.
Syntax
Where:
Example
Syntax
Where:
Example
Not In
Returns TRUE if a given value is not in the specified list of values.
Syntax
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
Not Like
Returns TRUE if a text string does not match the specified text pattern;
otherwise, returns FALSE.
Syntax
Where:
Example
Syntax
Where:
Example
l Metric: M1
l Function: Rank
l Operator: *<=
l Value: 2
Returns TRUE for the values of M1 whose rank values are less than or equal
to 2.
Syntax
Where:
Example
l Metric: M1
l Function: Rank
l Operator: *<>
l Value: 2
Returns TRUE for the values of M1 whose rank values are not equal to 2.
Syntax
ValueList *= Condition
Where:
Example
l Metric: M1
l Function: Rank
l Operator: *=
l Value: 2
Returns TRUE for the values of M1 whose rank values are equal to 2.
Syntax
Where:
Example
l Metric: M1
l Function: Rank
l Operator: *>=
l Value: 2
Return TRUE for the values of M1 whose rank values are greater than or
equal to 2.
Syntax
Where:
Usage Notes
Example
l Metric: M1
l Function: Rank
l Operator: *between
l Value: 2 and
l Value: 8
Returns TRUE for the values of M1 whose rank values are between 2 and 8.
Syntax
Where:
Usage Notes
Values equal to Condition1 and Condition2 are not satisfied with the
condition.
Example
l Metric: M1
l Function: Rank
l Value: 2 and
l 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
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
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
Where:
Usage Notes
Example
This metric returns 0 if the Total Revenue is less than 300,000; otherwise, it
returns 1.
Not
Returns TRUE if the specified condition is FALSE, and FALSE if the condition
is TRUE.
Syntax
Not(Arg1)
Where:
Example
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
This condition returns FALSE only if the Cost is greater than 1000, and the
Freight is greater than 500.
PLUG -I N PACKAGE
FUN CTION S
Each section briefly describes the category of function and then lists each
function along with information designed to provide data necessary for
understanding and implementing an individual function. The information
provided for each function includes:
l Usage notes describing any error conditions, invalid data types, or key
items to know before using the function (if applicable)
For a list of databases and the functions they support, see Appendix A,
MicroStrategy and Database Support for Functions.
Data mining is covered in the Data Mining Services chapter of the Advanced
Reporting Help. The Data Mining Services chapter introduces MicroStrategy
Data Mining Services, which includes these features:
The data mining functions that are available within MicroStrategy are
employed when using standard MicroStrategy Data Mining Services
interfaces and techniques, which includes the Training Metric Wizard and
importing third-party predictive models. To ensure proper functionality, it is
recommended to use these MicroStrategy data mining functions within the
Data Mining Services interfaces and techniques, rather than manually
defining the values and parameters for these functions.
Once you have downloaded and configured the R Integration Pack, there are
several functions available in MicroStrategy Web or Workstation that allow
you to deploy your R analytics. These functions include:
For the functions listed below, scalars are variables with a single value
while vectors are variables with one or more values.
l RScript: Supports R scripts that use vectors for the inputs and output.
Sorting is also supported.
l RScriptAgg: Supports R scripts that use vectors for the inputs and a
scalar output. Sorting is also supported.
l 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.
l RScriptSimple: Supports R scripts that use scalar for the inputs and
output. Sorting is not supported.
l 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 in a MicroStrategy Web or Workstation
dossier. The R Integration Pack User Guide provides steps to use the
deployR utility to create metric expressions for R scripts.
l Value1, ..., ValueN: The MicroStrategy metrics that act as inputs for
the R script.
l _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.
l 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.
Syntax
Where:
Settlement is the settlement date. This is the date, after issue, on which
the security is traded.
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.
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.
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
l
Par ¹ 1000
l
Issue ³ Settlement
l Frequency is a value other than 1, 2, or 4
l 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:
l Frequency is semiannual
l Basis is 30/360
Syntax
Where:
Maturity is the maturity date. This is the date on which the coupon
expires.
Par is a constant that indicates the par value. The default, and only valid,
value is 1000.
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.
Expression
Where:
A is the accrued time (for interest-at-maturity items, the value used is the
number of days from issue to maturity)
Usage Notes
l Rate £ 0
l Par ¹ 1000
l 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:
l Frequency is semiannual
l Basis is Actual/365
Syntax
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.
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.
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.
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.
Syntax
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.
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.
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.
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
Syntax
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.
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.
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.
Usage Notes
l 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.
Syntax
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.
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.
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.
Usage Notes
l
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.
Syntax
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.
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.
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.
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.
Syntax
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.
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.
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.
Usage Notes
l
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.
Syntax
Where:
Start is the first period in the calculation. Payment period counting begins
at 1.
Usage Notes
l Rate £ 0, Nper £ 0, or Pv £ 0
l Type ¹ 0
Example
The total interest paid in the second year of payments (periods 13 through
24) is defined as follows:
The interest paid in a single payment in the first month is defined as follows:
Syntax
Where:
Start is the first period in the calculation. Payment period counting begins
at 1.
Usage Notes
l Rate £ 0, Nper £ 0, or Pv £ 0
l Type ¹ 0
Example
The total principal paid in the second year of payments (periods 13 through
24) is defined as follows:
Syntax
Where:
Salvage is the value of the asset at the end of the depreciation period.
Life is the number of periods over which the asset is depreciated. This is
sometimes referred to as the useful life of an asset.
Expression
Where:
Syntax
Where:
Expression
Usage Notes
Syntax
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.
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.
Expression
Where:
Usage Notes
l Price £ 0 or Redemption £ 0.
l 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.
Syntax
Expression
Where:
Syntax
Where:
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 price’s response to changes in yield. Bonds with higher
durations face higher risk from changes in interest rates.
Syntax
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.
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.
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.
Expression
Where:
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.
Syntax
Effect(NominalRate, Npery)
Where:
Expression
Usage Notes
l NominalRate £ 0
l 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
Where:
Pmt is the (fixed) amount paid each period. This typically includes principal
and interest, but no other fees or taxes.
Usage Notes
Syntax
Where:
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.
Usage Notes
Use the Fv function for payments made with a constant interest rate.
Syntax
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.
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.
Expression
Where:
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.
Syntax
Where:
Period is the period for which the interest payment is sought. The valid
range is from 1 to Nperiod.
PV is the present value. This is the total value that a series of future
payments has today.
FV is a parameter that indicates the future value, also called the cash
balance, expected after the last payment is made.
Usage Notes
To calculate the internal rate of return for payments that do not occur at
regular intervals, see XIRR (Internal Rate of Return for Payments at
Irregular Intervals), page 405.
Syntax
Where:
l 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.
l 1: The IRR function uses Newton’s 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.
Usage Notes
The list of values must contain at least one positive entry and one negative
entry.
Syntax
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.
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.
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.
Expression
Where:
Usage Notes
l CouponRate < 0
l YieldRate < 0
l 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.
To calculate the internal rate of return for payments that do not occur at
regular intervals, see XIRR (Internal Rate of Return for Payments at
Irregular Intervals), page 405.
Syntax
Where:
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.
Syntax
Nominal(EffectiveRate, Npery)
Where:
Expression
Usage Notes
l EffectiveRate £ 0
l Npery < 1
Syntax
Where:
Pmt is the amount paid each period. Typically it includes principal and
interest, but no other fees or taxes.
All payments and incomes must be equally spaced in time, and occur at the
end of each period. To calculate the net present value of an investment in
which payments and income do not occur at regular intervals, see XNPV
(Net Present Value of an Investment for Payments or Incomes at Irregular
Intervals), page 408.
Syntax
Where:
Expression
Where:
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.
The primary differences between this function and the Present Value (PV)
function are that
Syntax
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.
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.
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.
Expression
l Odd Short First Coupon: for securities with a short first period
l Odd Long First Coupon: for securities with a long first period
Where:
DFC is the number of days from the beginning of odd first coupon to first
coupon date
Where:
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)
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
NLi is the Normal length in days of the full ith quasi-coupon period within
odd 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.
Syntax
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.
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.
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.
Usage Notes
l CouponRate < 0
l Price £ 0
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.
Syntax
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.
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.
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.
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
NLi is the Normal length in days of the ith quasi-coupon period within odd
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.
Syntax
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.
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.
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.
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.
NLi is 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
Where:
FV a parameter that indicates the future value of the loan. It is the balance to
be attained once all payments are made.
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.
Syntax
Where:
Expression
Where:
Syntax
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.
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
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.
Expression
Where:
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
Usage Notes
l Redemption £ 0
l 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.
Syntax
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.
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.
Expression
Where:
Usage Notes
l
DiscRate £ 0 or Redemption £ 0
l
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.
Syntax
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.
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.
Expression
Where:
Usage Notes
l 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
Where:
Expression
If rate = 0
Else
Syntax
Where:
Copyright © 2023 All Rights Reserved 397
Fu n ct io n s Refer en ce
l FVis the future value (also called cash balance) expected after the last
payment.
l Payment is the payment made for each period. Cannot change over the
life of the annuity. Typically, includes principal and interest, but no other
fees or taxes.
l PV is the present value of the annuity. It is the total amount that a series of
future payments is worth today.
Usage Notes
Syntax
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.
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.
Expression
Where:
Usage Notes
l
Investment £ 0.
l
Discount £ 0.
l
Maturity £ Settlement.
l 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.
Syntax
Where:
Salvage, also called the salvaged value of an asset, is the residual value at
the end of the estimated life span.
Life, also called the useful life of an asset, is the number of periods over
which the asset is being depreciated.
Syntax
Where:
Salvage, also called the salvaged value of an asset, is the residual value at
the end of the estimated life span.
Life, also called the useful life of an asset, is the number of periods over
which the asset is being depreciated.
Period is the depreciation period. This must have the same number of units
as Life.
Expression
Syntax
Where:
Settlement is the settlement date. This is the date on which the security is
traded.
Maturity is the maturity date. This is the date on which the treasury bill
expires.
Expression
Where:
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.
Syntax
Where:
Settlement is the settlement date. This is the date on which the treasury
bill is purchased.
Maturity is the maturity date. This is the date on which the treasury bill
expires.
Expression
Where:
This excludes any maturity date that is more than one calendar year past
Settlement.
Usage Notes
l Discount £ 0
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.
Syntax
Where:
Settlement is the settlement date. This is the date on which the treasury
bill is purchased.
Maturity is the maturity date. This is the date on which the treasury bill
expires.
Expression
Where:
This excludes any maturity date that is more than one calendar year past
Settlement.
Usage Notes
l
Price £ 0
l 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.
Syntax
Where:
Period is the first period for which depreciation is calculated. This must use
the same number of units as Life.
Usage Notes
To calculate the internal rate of return for payments that occur at regular
intervals, see:
l IRR (internal rate of return): Internal rate of return for periodic payments.
l MIRR (modified internal rate of return): Modified internal rate of return for
periodic payments, which takes into consideration both the cost of
investment and the interest received on investment.
Syntax
Where:
Dates is a fact or metric representing a list of dates for the payments that
are included. Ensure that these values use a date/time format.
Usage Notes
The list of values must contain at least one positive entry and one negative
entry.
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.
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 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.
Syntax
Where:
Rate is the discount rate applied to the cash flows. This is commonly
included in the expression as a constant value.
Expression
Where:
Usage Notes
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%:
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
Where:
l Settlement is the settlement date. This is the date on which the security
is purchased.
l Maturity is the maturity date. This is the date on which the security
expires.
l 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.
Expression
Where:
Usage notes
▫ Price £ 0 or Redemption £ 0.
• 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.
Syntax
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.
Usage Notes
l
Price £ 0 or Redemption £ 0.
l
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.
Syntax
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.
each year.
Usage Notes
l Rate < 0.
l Price £ 0.
l 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
Syntax
Abs(Argument)
Where:
Example
This simple example show the results of executing the Abs function on a list
of values. Assuming you have a metric that represents deposit and
withdrawal amounts, the function operates as follows:
Syntax
Acos(Argument)
Where:
Argument is a metric representing a list of real numbers. The values are the
values of the cosine for the angles sought. This value must be between -1
and 1.
For more information on the hyperbolic cosine function, see Cosh (Cosine,
Hyperbolic), page 422.
Syntax
Acosh(Argument)
Where:
Syntax
Asin(Argument)
Where:
Argument is a metric representing a list of real numbers. The values are the
values of the sine of the angles sought. These values must be between -1
and 1.
For more information on the hyperbolic sine function, see Sinh (Sine,
Hyperbolic), page 436.
Syntax
Asinh(Argument)
Where:
Syntax
Atan(Number)
Where:
Syntax
Atan2(x_num, y_num)
Where:
For more information on the hyperbolic tangent function, see Tanh (Tangent,
Hyperbolic), page 438.
Syntax
Atanh(Number)
Where:
Syntax
Ceiling(Argument)
Where:
Example
This simple example illustrates how the Ceiling function acts on positive
and negative numbers, and how the results compare to the use of the Floor
function.
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:
Expression
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.
l n< 0
l k<0
l n £ k
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.
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/p.
Syntax
Cosh(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 hyperbolic cosine is sought. To
convert radians to degrees, multiply by 180/p.
Expression
Syntax
Degrees(Argument)
Where:
Example
Function/Result Calculation
Degrees(2.27) = 130
Degrees( p/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. Exp is the inverse of
Ln, the natural logarithm of a number.
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
X = e2 ;
Exp (2) =
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.
Syntax
Factorial(Argument)
Where:
Usage Notes
Example
These simple examples illustrate the results of using the Factorial function.
Function/Result Calculation
1 × 2 × 3 = 6;
Factorial(Argument) = 6,
1 × 2 × 3 × 4 × 5 × 6 × 7 = 5040;
5040, 362880 where Argument
contains the values 3,7,9 1 ×2×3×4×5×6×7×8×9
= 362880
Syntax
Floor(Argument)
Where:
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:
Usage Notes
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
423.
Syntax
Ln(Argument)
Where:
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:
Example
Function/Result Calculation
Syntax
Log10(Argument)
Where:
Example
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
Where:
Usage Notes
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
the dividend
Power
Returns the value of an input number raised to a given power. This is a
single-value function.
Syntax
Power(Argument, Power)
Where:
Usage Notes
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:
Usage Notes
Use the Mod function (Mod (Modulus), page 428) to retrieve only the
remainder.
Example
These simple examples illustrate the results of using the Quotient function.
Function/Result Calculation
Syntax
Radians(Argument)
Where:
Example
This simple example illustrates how the Radians function converts an angle
entered in degrees into radians.
Function/Result Calculation
Radians(130) = 2.27
A different number is returned each time the function is run. However, if the
Randbetween function is used to modify multiple rows of values on a report,
be aware that if you use a simple definition such as Randbetween(2, 10) the
same random number will be applied to each row of data on the report. You
Syntax
Randbetween(Bottom, Top)
Where:
Top is a real number or metric representing a list of real numbers which are
the highest value(s) the function can return; the top of the range. You can
also include expressions that result in a real number value.
While Randbetween can accept real values as input values for Bottom and
Top, the input values are processed differently based on the following:
Example
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:
When using a metric with this definition on a report the same random
percentage is applied to all revenue values 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.
Syntax
Round(Argument)
Where:
Example
These simple examples illustrate the result of using the Round function, and
compare them to the Int function results for the same values.
Syntax
Round2(Argument, Precision)
Where:
l If Precision = 0, then the values are rounded to the nearest integer. This
has the same results as using the Round function.
l If Precision is less than 0, then the values are rounded to the specified
digits to the left of the decimal and starting to the left of the integer in the
ones place.
Example
This simple example illustrates how the Precision value affects the results of
the Round2 function.
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.
Syntax
Sin(Argument)
Where:
Syntax
Sinh(Argument)
Where:
Expression
Syntax
Sqrt(Argument)
Where:
Usage Notes
Example
This simple example illustrates the results of using the Sqrt function.
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.
Syntax
Tan(Argument)
Where:
Syntax
Tanh(Argument)
Where:
Expression
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:
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.
Syntax
Where:
Expression
Where:
BetaDistribution
Returns the cumulative Beta distribution of the variables alpha and beta,
where the probability density function is given by
Where:
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.
l alpha =
l beta =
Usage Notes
l
alpha £ 0 or beta £ 0.
l x < Lower Bound or x > 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:
Syntax
Where:
Expression
Where:
is Combine(n, x).
Usage Notes
l x>n
l x< 0
l p < 0 or p > 1
ChiSquareDistribution
Returns the right-tailed chi-squared distribution of the degrees of freedom,
where the probability density function is given by
Where:
Syntax
ChiSquareDistribution(x, df)
Where:
Usage Notes
l x < 0
l df < 1
Reality: H 0 is Reality: H 1 is
Decision
correct correct
Definition
ChiSquareTest returns the p-value for the hypothesis test in the following
form:
Syntax
ChiSquareTest(Argument1, Argument2)
Where:
Usage Notes
This function returns the probability for a chi-squared (x 2 ) statistic and its
associated degrees of freedom (df).
Syntax
Where:
Stdev is the standard deviation of the population for the given data range.
Expression
l Confidence = 95%
Usage Notes
l stdev < 0
l size < 1
Example
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.
Syntax
Where:
Usage Notes
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.
Syntax
Where:
Expression
l Argument1 = X
l Argument2= Y
Where:
= average value of x
= average value of y
Usage Notes
l Argument1 and Argument2 do not contain the same number of data points.
Syntax
Where:
Usage Notes
l Trials < 0
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
Where:
Expression
Usage Notes
l x<0
l
lambda £ 0
Syntax
Fisher (x)
Where:
Expression
Usage Notes
l x is nonnumeric.
l
x £ -1 or x ³ 1.
Syntax
Where:
Expression
Where:
Usage Notes
l An argument is non-numeric
l x<0
l df 1 < 1
l df 2 < 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.
For a function that predicts values in a similar way for data that is increasing
or decreasing exponentially, see Growth, page 458.
Syntax
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).
Example
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.
For a function that predicts values in a similar way for data that is increasing
or decreasing exponentially, see GrowthV (Growth, Vector Input), page 459.
Syntax
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).
Since this function allows you to enter a list of time intervals, it can account
for missing time intervals more accurately than the TrendV function (see
TrendV (Trend, Vector Input), page 488). For an example, see the examples
described below.
Example
ForecastV(2008, x, Year)
Also, 2008 is used for the period in time to predict metric data for because
the Year attribute uses ID values that match the year.
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 Forecast is displayed on the report, it displays the
predicted value for 2008 Revenue, as shown below:
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.
Definition
FTest returns the p-value for the hypothesis test in the following form:
l :
l :
Syntax
Usage Notes
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
Where:
Expression
Usage Notes
When alpha > 0, this function is also known as the Erlang distribution.
l
Either alpha £ 0 or beta £ 0
l 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.
For a function that predicts values in a similar way for data that is increasing
or decreasing with a linear trend, see Forecast, page 452 or Trend, page
487.
Syntax
Growth <FactID>
(KnownData1,...,KnownDataN, FutureTimeOffset)
Where:
Example
historical data. For example, based on revenue data for three years, you
want to predict what your Revenue will be for the coming year.
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.
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 453 or TrendV (Trend, Vector Input), page 488.
Syntax
Where:
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.
Example
GrowthV(x, 1)
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 453 and TrendV (Trend, Vector Input), page 488. 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.
Definition
l For H 0 :
l For H 1 :
Syntax
Usage Notes
Example
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:
Expression
Usage Notes
l n < 0 or n > N
l M < 0 or M > N
l 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
Where:
Expression
Usage Notes
Example
Syntax
Where:
Usage Notes
l
alpha £ 0 or beta £ 0
l
x £ 0 or x ³ 1
l x < Lower Bound or x > Upper Bound
Syntax
InverseChiDistribution(x, df)
Where:
Usage Notes
l x < 0 or x >1
l df < 1
Syntax
InverseFisher(x)
Where:
Expression
Usage Notes
Syntax
Where:
Usage Notes
l An argument is nonnumeric
l x< 0 or x > 1
l df 1 < 1
l df 2 < 1
Syntax
Where:
Usage Notes
l
Either alpha £ 0 or beta £ 0
l x < 0 or x > 1
Syntax
Where:
Expression
Usage Notes
l x<0
l x>1
l stdev < 0
Syntax
Where:
Usage Notes
l stdev £ 0.
Syntax
InverseNormSDistribution(x)
Where:
Usage Notes
l x is nonnumeric.
l x < 0 or x > 1.
Syntax
InverseTDistribution(Probability, df)
Where:
Expression
Where:
Usage Notes
l df < 1
Kurtosis
Returns the kurtosis, which is a measure of whether the data is heavy or
light-tailed relative to a normal distribution. Datasets with high kurtosis tend
to have heavy tails, or outliers. Datasets with low kurtosis tend to have light
tails, or lack of outliers.
Syntax
Where:
Expression
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
Where:
Expression
Usage Notes
l
x £0
l
stdev £ 0
Definition
MeanTTest returns the p-value for the hypothesis test in the following form:
l For H 0 :
l For H 1 :
Syntax
Where:
Hypothesis mean is m 0 .
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.
Syntax
NegativeBinomialDistribution(F, S, P)
Where:
Expression
Usage Notes
l P< 0 or P> 1.
l
F + (S - 1) £ 0.
Syntax
Where:
Expression
Usage Notes
l Stdev £ 0
Definition
PairedTTest returns the P-value for the hypothesis test in the following
form:
l H0:
l H1:
Syntax
Where:
Usage Notes
Syntax
Where:
Expression
Usage Notes
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:
Expression
Usage Notes
l Number < 0
l NumberChosen < 0
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
Where:
Expression
For type = 1:
For type = 0:
Usage Notes
l x or lambda is nonnumeric
l x < 0
l lambda £ 0
Syntax
Where:
Usage Notes
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
Where:
Expression
Syntax
Where:
Expression
Usage Notes
Example
See Hypothesis Testing Example, page 83 for an example using the Slope
function.
Standardize
Returns a normalized value from a distribution characterized by a mean and
standard deviation.
Syntax
Where:
Expression
Usage Notes
Syntax
StandardNormalDistribution (Argument)
Where:
Expression
Usage Notes
Syntax
SteYX([Y], [X])
Where:
Expression
Usage Notes
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:
Expression
Where:
Usage Notes
l Either x or df is nonnumeric
l 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.
For a function that predicts values in a similar way for data that is increasing
or decreasing exponentially, see GrowthV (Growth, Vector Input), page 459.
Syntax
Where:
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 488.
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.
For a function that predicts values in a similar way for data that is increasing
or decreasing exponentially, see GrowthV (Growth, Vector Input), page 459.
Syntax
Where:
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.
Example
TrendV(x, 1)
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 453. 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
VarTest returns the P-value for the hypothesis test in the following form:
l H0:
l H1:
Syntax
Where:
Copyright © 2023 All Rights Reserved 491
Fu n ct io n s Refer en ce
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.
Example
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
Where:
Expression
Usage Notes
l x<0
l alpha < 0
l beta < 0
M ICRO STRATEGY AN D
D ATABASE SUPPORT FOR
FUN CTION S
• Add
• Average
• Avg
• Count
Basic functions
• First
• GeoMean
• Greatest
• Last
• Least
• Max
• Median
• Min
• Mode
• Multiply
• Product
• Stdev
• StdevP
• Sum
• Var
• VarP
• Banding
• BandingC
• Case
• CaseV
• IsNotNull
• IsNull
• NullToZero
• ZeroToNull
• 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
• NTile
• NTileSize
• NTileValue
Rank and NTile functions
• NTileValueSize
• Percentile
• Rank
• Concat
• ConcatBlank
• InitCap
• LeftStr
• Length
• Lower
• Position
• RightStr
• RTrim
• SubStr
• Trim
• Upper
• <
• <=
Comparison operators
• <>
• =
• >
• >=
• Begins With
• Between
• Contains
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
Except where explicitly stated, only databases that are certified to work with
MicroStrategy 10 are listed below. For information on the latest certification
and support for databases, see Platform Certifications.
Actian Vectorwise
The tables listed below describe the MicroStrategy function support for
Actian Vectorwise databases:
• Add
• Average
• Avg
• Count
• GeoMean
• Greatest
• Least
• Max
Basic functions
• Min
• Multiply
• Product
• Stdev
• StdevP
• Sum
• Var
• VarP
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
Date and time functions
• CurrentTime
• Date
• DayOfMonth
• DayOfWeek
• DayOfYear
• DaysBetween
• Hour
• MilliSecond
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Week
• Year
• YearEndDate
• YearStartDate
• Banding
Internal functions
• BandingC
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• Concat
String functions
• ConcatBlank
• InitCap
• LeftStr
• Length
• Lower
• LTrim
• Position
• RightStr
• RTrim
• SubStr
• Trim
• Upper
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
• <>
• =
• >=
• Begins With
• Between
• Contains
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
Mathematical functions
• Acosh
• Asin
• Asinh
• Atan
• Atan2
• Atanh
• Ceiling
• Cos
• Cosh
• Degrees
• Exp
• Floor
• Int
• Int2
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Radians
• RandBetween
• Round
• Round2
• Sin
• Sinh
• Sqrt
• Tan
• Tanh
• Trunc
• Correlation
• Covariance
• RSquare
• Slope
• Add
• Average
• Avg
• Count
• GeoMean
• Greatest
• Max
• Min
• Multiply
• Product
• Stdev
• StdevP
• Sum
• Var
• VarP
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
• Date
• DayOfMonth
• DayOfWeek
• DayOfYear
• DaysBetween
• Hour
Date and time functions
• MilliSecond
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Week
• Year
• YearEndDate
• YearStartDate
• Banding
Internal functions
• BandingC
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• Concat
• ConcatBlank
• InitCap
• LeftStr
• Length
• Lower
• Position
• RightStr
• RTrim
• SubStr
• Trim
• Upper
• -
Arithmetic operators • x
• +
• /
• U-
• <
• <=
• <>
• =
• >
• >=
• Begins With
• Between
• Contains
Comparison operators
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
• Acosh
• Asin
• Asinh
• Atan
• Atan2
• Atanh
• Ceiling
Mathematical functions
• Cos
• Cosh
• Degrees
• Exp
• Floor
• Int
• Int2
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Radians
• RandBetween
• Round
• Round2
• Sin
• Sinh
• Sqrt
• Tan
• Tanh
• Trunc
• Correlation
• Covariance
• RSquare
• Slope
Aster Database
The tables listed below describe the MicroStrategy function support for Aster
Databases:
• Add
• Average
• Avg
• Count
• GeoMean
• Greatest
• Least
• Min
• Multiply
• Stdev
• StdevP
• Sum
• Var
• VarP
• AddDays
• AddMonths
• CurrentDate
• CurrentTime
• Date
• DayOfMonth
• DayOfWeek
• DayOfYear
• DaysBetween
• Hour
• MilliSecond
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Week
• Year
• YearEndDate
• YearStartDate
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• Lag
• Lead
OLAP functions
• MovingAvg
• MovingCount
• MovingMax
• MovingMin
• MovingSum
• RunningAvg
• RunningCount
• RunningMax
• RunningMin
• RunningSum
• Concat
• InitCap
• LeftStr
• Length
• Lower
• LTrim
String functions
• Position
• RightStr
• RTrim
• SubStr
• Trim
• Upper
• -
• x
Arithmetic operators
• +
• /
• U-
• <
• <=
• <>
• =
• >
• >=
• Begins With
• Between
• Contains
Comparison operators
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
• Acosh
• Asin
• Asinh
• Atan
• Atan2
• Atanh
• Ceiling
• Degrees
• Exp
• Floor
• Int
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Radians
• Round
• Round2
• Sin
• Sqrt
• Tan
• Trunc
• Add
• Average
• Avg
• Count
• GeoMean
• Greatest
Basic functions
• Least
• Max
• Min
• Multiply
• Stdev
• StdevP
• Sum
• Var
• VarP
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
• Date
• DayOfMonth
• DayOfWeek
• DayOfYear
• DaysBetween
• Hour
Date and time functions
• MilliSecond
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Week
• Year
• YearEndDate
• YearStartDate
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• Lag
• Lead
• MovingAvg
• MovingCount
• MovingMax
• MovingMin
OLAP functions
• MovingSum
• RunningAvg
• RunningCount
• RunningMax
• RunningMin
• RunningSum
• Concat
• InitCap
• LeftStr
String functions
• Length
• Lower
• LTrim
• Position
• RightStr
• RTrim
• SubStr
• Trim
• Upper
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
• <>
• =
• >
• >=
• Begins With
Comparison operators
• Between
• Contains
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
• Acosh
• Asin
• Atan
• Atan2
• Atanh
• Ceiling
• Cos
• Degrees
• Exp
• Floor
• Int
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Radians
• Round
• Round2
• Sin
• Sqrt
• Tan
• Trunc
• Add
Basic functions
• Average
• Avg
• Count
• GeoMean
• Greatest
• Least
• Max
• Min
• Multiply
• Stdev
• StdevP
• Sum
• Var
• VarP
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
• Date
Date and time functions
• DayOfMonth
• DayOfWeek
• DayOfYear
• DaysBetween
• Hour
• MilliSecond
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Week
• Year
• YearEndDate
• YearStartDate
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• Lag
• Lead
• MovingAvg
• MovingCount
• MovingMin
• MovingSum
• RunningAvg
• RunningCount
• RunningMax
• RunningMin
• RunningSum
• Concat
• InitCap
• LeftStr
• Length
• Lower
• LTrim
String functions
• Position
• RightStr
• RTrim
• SubStr
• Trim
• Upper
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
Comparison operators
• <>
• =
• >
• >=
• Begins With
• Between
• Contains
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
• Acosh
• Asin
• Asinh
• Atan
• Atan2
• Atanh
• Ceiling
• Cos
• Degrees
• Exp
Mathematical functions
• Floor
• Int
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Radians
• Round
• Round2
• Sin
• Sqrt
• Tan
• Trunc
Calpont InfiniDB
The tables listed below describe the MicroStrategy function support for
Calpont InfiniDB databases:
• Add
• Average
• Avg
• Count
• GeoMean
• Least
• Max
• Min
• Multiply
• Product
• Stdev
• StdevP
• Sum
• Var
• VarP
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
• Date
• DayOfMonth
• DayOfWeek
• DayOfYear
• DaysBetween
Date and time functions
• Hour
• MilliSecond
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Week
• Year
• YearEndDate
• YearStartDate
• Banding
Internal functions
• BandingC
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• ConcatBlank
• Concat
• InitCap
• LeftStr
• Length
• Lower
• Position
• RightStr
• RTrim
• SubStr
• Trim
• Upper
Arithmetic operators • -
• x
• +
• /
• U-
• <
• <=
• <>
• =
• >
• >=
• Begins With
• Between
• Contains
Comparison operators
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *=
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
• Acosh
• Asin
• Asinh
• Atan
• Atan2
• Atanh
Mathematical functions
• Ceiling
• Cos
• Degrees
• Exp
• Floor
• Int
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Radians
• Randbetween
• Round
• Round2
• Sin
• Sqrt
• Tan
• Trunc
• Add
• Average
• Avg
• Count
Basic functions
• GeoMean
• Greatest
• Least
• Max
• Min
• Multiply
• Product
• Stdev
• StdevP
• Sum
• Var
• VarP
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
• Date
• DayOfMonth
• DayOfWeek
• DaysBetween
• Hour
• MilliSecond
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Week
• Year
• YearEndDate
• YearStartDate
• Banding
Internal functions
• BandingC
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• ConcatBlank
• Concat
• InitCap
• LeftStr
• Length
• LTrim
• Position
• RightStr
• RTrim
• SubStr
• Trim
• Upper
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
• <>
• =
• >
• >=
• Begins With
• Between
• Contains
Comparison operators
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
• Acosh
• Asin
• Asinh
• Atan
• Atanh
• Ceiling
• Cos
• Degrees
• Exp
• Floor
• Int
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Radians
• Randbetween
• Round
• Round2
• Sin
• Sqrt
• Tan
• Trunc
EXASolution
The tables listed below describe the MicroStrategy function support for
EXASolution databases:
EXASolution 4.x
• Add
• Average
• Avg
• Count
• GeoMean
• Greatest
• Least
• Max
Basic functions
• Median
• Min
• Multiply
• Stdev
• StdevP
• Sum
• Var
• VarP
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
Date and time functions
• CurrentTime
• Date
• DayOfMonth
• DayOfWeek
• DayOfYear
• DaysBetween
• Hour
• MilliSecond
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Week
• Year
• YearEndDate
• YearStartDate
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• Lag
• Lead
• MovingCount
• MovingMax
• MovingMin
• MovingSum
• RunningAvg
• RunningCount
• RunningMax
• RunningMin
• RunningSum
• Concat
• InitCap
• LeftStr
• Length
• Lower
• Position
• RightStr
• RTrim
• SubStr
• Trim
• -
• x
Arithmetic operators • +
• /
• U-
• <=
• <>
• =
• >
• >=
• Begins With
• Between
• Contains
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
Logical operators
• IF
• Not
• Or
• Abs
• Acos
• Acosh
• Asin
• Asinh
• Atan
• Atan2
• Atanh
• Ceiling
• Cos
• Exp
• Floor
• Int
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Radians
• Round
• Round2
• Sin
• Sinh
• Sqrt
• Tan
• Tanh
• Trunc
• Correlation
• Covariance
• RSquare
• Slope
Greenplum
The tables listed below describe the MicroStrategy function support for
Greenplum databases:
Greenplum 4.x
• Add
• Avg
• Count
• GeoMean
• Greatest
• Least
• Max
• Min
• Multiply
• Product
• Stdev
• StdevP
• Sum
• Var
• VarP
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
• Date
Date and time functions
• DayOfMonth
• DayOfWeek
• DayOfYear
• DaysBetween
• Hour
• MilliSecond
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Year
• YearEndDate
• YearStartDate
• Banding
• Coalesce
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• Concat
• ConcatBlank
• InitCap
String functions
• LeftStr
• Length
• Lower
• LTrim
• Position
• RightStr
• RTrim
• SubStr
• Trim
• Upper
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
• <>
• =
• >
• >=
• Between
• Contains
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
• Acosh
• Asin
Mathematical functions
• Asinh
• Atan
• Atan2
• Atanh
• Ceiling
• Cos
• Degrees
• Exp
• Floor
• Int
• Int2
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Radians
• Randbetween
• Round
• Round2
• Sin
• Sqrt
• Tan
• Trunc
• Correlation
• Covariance
• RSquare
• Slope
Hadoop Hive
The tables listed below describe the MicroStrategy function support for
Hadoop Hive databases:
Hadoop Hive
• Add
• Average
• Avg
• Count
• First
• GeoMean
• Greatest
• Last
• Max
• Min
• Multiply
• Stdev
• StdevP
• Sum
• Var
• VarP
• AddDays
Date and time functions
• CurrentDate
• CurrentDateTime
• CurrentTime
• Date
• DayOfMonth
• DaysBetween
• Hour
• Minute
• Month
• Second
• Week
• Year
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• Concat
• LeftStr
• Length
• LTrim
• Position
• RightStr
• RTrim
• SubStr
• Trim
• Upper
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
• <>
• =
• >
• >=
• Begins With
• Between
Comparison operators
• Contains
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Acos
• Acosh
• Asin
• Asinh
• Atan
• Ceiling
• Cos
• Cosh
• Degrees
• Exp
• Floor
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Radians
• Round
• Round2
• Sin
• Sinh
• Sqrt
• Tan
• Tanh
• Covariance
Statistical functions
• Standardize
HP Vertica
The tables listed below describe the MicroStrategy function support for HP
Vertica databases:
HP Vertica 5.1
• Add
• Average
• Avg
• Count
• GeoMean
• Max
• Min
Basic functions
• Multiply
• Product
• Stdev
• StdevP
• Sum
• Var
• VarP
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
Date and time functions
• Date
• DayOfMonth
• DayOfWeek
• DayOfYear
• DaysBetween
• Hour
• MilliSecond
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Year
• YearEndDate
• YearStartDate
• NullToZero
Null and Zero functions
• ZeroToNull
• FirstInRange
• Lag
• LastInRange
• Lead
• MovingAvg
OLAP functions
• MovingCount
• MovingMax
• MovingMin
• MovingStdev
• MovingSum
• OLAPAvg
• OLAPCount
• OLAPMax
• OLAPMin
• OLAPRank
• OLAPSum
• RunningAvg
• RunningCount
• RunningMax
• RunningMin
• RunningStdev
• RunningStdevP
• RunningSum
• Concat
• ConcatBlank
• InitCap
• LeftStr
• Length
• LTrim
• Position
• RightStr
• RTrim
• SubStr
• Trim
• Upper
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
• <>
• =
• >
• >=
• Begins With
• Between
• Contains
Comparison operators
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
• Acosh
• Asin
• Asinh
• Atan
• Atanh
• Ceiling
• Cos
• Degrees
• Exp
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Radians
• Randbetween
• Round
• Round2
• Sin
• Sqrt
• Tan
• Trunc
HP Vertica 6.x
• Add
• Average
• Avg
• GeoMean
• Max
• Min
• Multiply
• Product
• Stdev
• StdevP
• Sum
• Var
• VarP
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
• Date
• DayOfMonth
• DayOfWeek
• DayOfYear
Date and time functions
• DaysBetween
• Hour
• MilliSecond
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Year
• YearEndDate
• YearStartDate
• NullToZero
Null and Zero functions
• ZeroToNull
• FirstInRange
• Lag
• LastInRange
• Lead
• MovingAvg
• MovingCount
• MovingMax
• MovingMin
• MovingStdev
OLAP functions
• MovingSum
• OLAPAvg
• OLAPCount
• OLAPMax
• OLAPMin
• OLAPRank
• OLAPSum
• RunningAvg
• RunningCount
• RunningMax
• RunningMin
• RunningStdev
• RunningStdevP
• RunningSum
• Concat
• ConcatBlank
• InitCap
• LeftStr
• Length
• Lower
• Position
• RightStr
• RTrim
• SubStr
• Trim
• Upper
• -
• x
Arithmetic operators • +
• /
• U-
• <=
• <>
• =
• >
• >=
• Begins With
• Between
• Contains
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
Logical operators
• IF
• Not
• Or
• Abs
• Acos
• Acosh
• Asin
• Asinh
• Atan
• Atan2
• Atanh
• Ceiling
• Cos
• Exp
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Radians
• Randbetween
• Round
• Round2
• Sin
• Sqrt
• Tan
• Trunc
IBM DB2
The tables listed below describe the MicroStrategy function support for IBM
DB2 databases:
• Add
• Average
Basic functions
• Avg
• Count
• GeoMean
• Max
• Min
• Multiply
• Product
• StdevP
• Sum
• Var
• VarP
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
• Date
• DayOfMonth
• DayOfWeek
Date and time functions
• DayOfYear
• DaysBetween
• Hour
• MilliSecond
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Week
• Year
• YearEndDate
• YearStartDate
• Banding
• Coalesce
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• Lag
• Lead
• MovingAvg
• MovingCount
• MovingMax
• MovingStdev
• MovingStdevP
• MovingSum
• OLAPAvg
• OLAPCount
• OLAPMax
• OLAPMin
• OLAPRank
• OLAPSum
• RunningAvg
• RunningCount
• RunningMax
• RunningMin
• RunningStdev
• RunningStdevP
• RunningSum
• Concat
• ConcatBlank
• InitCap
• LeftStr
• Length
• Lower
• Position
• RightStr
• RTrim
• SubStr
• Trim
• Upper
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
• <>
• =
• >
• >=
• Begins With
• Between
• Contains
Comparison operators
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
Comparison operators for rank
• *<>
• *=
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
• Acosh
• Asin
• Asinh
• Atan
• Atan2
• Ceiling
• Cos
• Cosh
• Degrees
• Exp
• Floor
• Int
• Int2
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Radians
• Randbetween
• Round
• Round2
• Sin
• Sinh
• Sqrt
• Tan
• Tanh
• Trunc
• Correlation
• Covariance
• RSquare
• Slope
• Add
• Average
• Avg
• Count
• GeoMean
• Max
• Multiply
• Product
• StdevP
• Sum
• Var
• VarP
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• Date
• DayOfMonth
• DayOfWeek
• DayOfYear
• DaysBetween
• Hour
• MilliSecond
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Week
• Year
• YearEndDate
• YearStartDate
• Banding
• Coalesce
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• Lag
• Lead
OLAP functions
• MovingAvg
• MovingCount
• MovingMax
• MovingMin
• MovingStdev
• MovingStdevP
• MovingSum
• OLAPAvg
• OLAPCount
• OLAPMax
• OLAPMin
• OLAPRank
• OLAPSum
• RunningAvg
• RunningCount
• RunningMax
• RunningMin
• RunningStdev
• RunningStdevP
• RunningSum
• Concat
• ConcatBlank
• InitCap
String functions
• LeftStr
• Length
• Lower
• LTrim
• Position
• RightStr
• RTrim
• SubStr
• Trim
• Upper
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
• <>
• =
• >
• >=
• Between
• Contains
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
• Acosh
• Asin
Mathematical functions
• Asinh
• Atan
• Atan2
• Atanh
• Ceiling
• Cos
• Cosh
• Degrees
• Exp
• Floor
• Int
• Int2
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Radians
• Randbetween
• Round
• Round2
• Sin
• Sinh
• Sqrt
• Tan
• Tanh
• Trunc
• Covariance
• Intercept
• RSquare
• Slope
• Add
• Average
• Avg
• Count
• GeoMean
• Max
• Multiply
• Product
• StdevP
• Sum
• Var
• VarP
• AddDays
• AddMonths
Date and time functions
• CurrentDate
• CurrentDateTime
• CurrentTime
• Date
• DayOfMonth
• DayOfWeek
• DayOfYear
• DaysBetween
• Hour
• MilliSecond
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Week
• Year
• YearEndDate
• YearStartDate
• Banding
• Coalesce
• IsNotNull
• NullToZero
• ZeroToNull
• Lag
• Lead
• MovingAvg
• MovingCount
• MovingMax
• MovingMin
• MovingStdev
• MovingStdevP
• MovingSum
• OLAPAvg
• OLAPCount
OLAP functions
• OLAPMax
• OLAPMin
• OLAPRank
• OLAPSum
• RunningAvg
• RunningCount
• RunningMax
• RunningMin
• RunningStdev
• RunningStdevP
• RunningSum
• ConcatBlank
• InitCap
• LeftStr
• Length
• Lower
• LTrim
• Position
• RightStr
• RTrim
• SubStr
• Trim
• Upper
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
• <>
• =
Comparison operators
• >
• >=
• Begins With
• Between
• Contains
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acosh
• Asin
• Asinh
• Atan
• Atan2
• Atanh
• Ceiling
• Cos
• Cosh
• Degrees
• Exp
• Floor
• Int
• Int2
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Radians
• Randbetween
• Round
• Round2
• Sin
• Sinh
• Sqrt
• Tan
• Tanh
• Trunc
• Correlation
• Covariance
• RSquare
• Slope
• Add
• Average
• Avg
• Count
• GeoMean
• Max
Basic functions
• Min
• Multiply
• Product
• StdevP
• Sum
• Var
• VarP
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
• Date
• DayOfMonth
• DayOfWeek
• DayOfYear
• DaysBetween
• Hour
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Week
• Year
• YearEndDate
• YearStartDate
• BandingC
• Coalesce
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• Lag
• Lead
• MovingAvg
• MovingCount
• MovingMax
• MovingMin
• MovingStdev
• MovingStdevP
• MovingSum
• OLAPCount
• OLAPMax
• OLAPMin
• OLAPRank
• OLAPSum
• RunningAvg
• RunningCount
• RunningMax
• RunningMin
• RunningStdev
• RunningStdevP
• RunningSum
• Concat
• ConcatBlank
• InitCap
• LeftStr
• Length
• Lower
• Position
• RightStr
• RTrim
• SubStr
• Trim
• Upper
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <>
• =
• >
• >=
• Begins With
• Between
• Contains
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
• Acosh
• Asin
• Asinh
• Atan
• Atan2
• Atanh
• Ceiling
• Cos
• Cosh
• Exp
• Floor
• Int
• Int2
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Radians
• Randbetween
• Round
• Round2
• Sin
• Sinh
• Sqrt
• Tan
• Tanh
• Trunc
• Correlation
• Covariance
• RSquare
• Slope
• Add
• Average
• Avg
• GeoMean
• Max
• Min
• Multiply
• Product
• Stdev
• StdevP
• Sum
• Var
• VarP
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
• Date
• DayOfMonth
• DayOfWeek
• DayOfYear
Date and time functions
• DaysBetween
• Hour
• MilliSecond
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Week
• Year
• YearEndDate
• YearStartDate
• Banding
• Coalesce
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• Concat
• ConcatBlank
• InitCap
• LeftStr
• Length
• LTrim
• Position
• RightStr
• RTrim
• SubStr
• Trim
• Upper
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
• <>
• =
• >
• >=
• Begins With
• Between
• Contains
Comparison operators
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
• Acosh
• Asin
• Asinh
• Atan
• Atanh
• Ceiling
• Cos
• Cosh
• Degrees
• Exp
• Floor
• Int
• Int2
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Radians
• Randbetween
• Round
• Round2
• Sin
• Sinh
• Sqrt
• Tan
• Tanh
• Trunc
• Average
• Avg
• Count
• GeoMean
• Max
• Min
• Multiply
• Product
• Stdev
• StdevP
• Sum
• Var
• VarP
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
• Date
Date and time functions
• DayOfMonth
• DayOfWeek
• DayOfYear
• DaysBetween
• Hour
• MilliSecond
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Week
• Year
• YearEndDate
• YearStartDate
• Banding
• Coalesce
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• Concat
• ConcatBlank
• LeftStr
• Length
• Lower
• LTrim
• Position
• RightStr
• RTrim
• SubStr
• Trim
• Upper
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
• <>
• =
• >
• >=
Comparison operators
• Begins With
• Between
• Contains
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
• Acosh
• Asinh
• Atan
• Atan2
• Atanh
• Ceiling
• Cos
• Cosh
• Degrees
• Exp
• Floor
• Int
• Int2
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Radians
• Randbetween
• Round
• Round2
• Sin
• Sinh
• Sqrt
• Tan
• Tanh
• Trunc
IBM Informix
The tables listed below describe the MicroStrategy function support for IBM
Informix databases:
l IBM Informix IDS 11.5 and Informix Ultimate Edition 11.7, page 602
• Add
• Average
• Avg
• Count
• Max
Basic functions
• Min
• Multiply
• Stdev
• Sum
• Var
• AddDays
• AddMonths
• CurrentDate
Date and time functions
• CurrentDateTime
• CurrentTime
• Date
• DayOfMonth
• DayOfWeek
• DayOfYear
• DaysBetween
• Hour
• MilliSecond
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Year
• YearEndDate
• YearStartDate
• Banding
• Coalesce
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• Concat
• ConcatBlank
• InitCap
• LeftStr
• Length
• LTrim
• RightStr
• RTrim
• SubStr
• Trim
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
• <>
• =
• >=
• Begins With
• Between
• Contains
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
Mathematical functions
• Asin
• Atan
• Atan2
• Ceiling
• Cos
• Exp
• Floor
• Int
• Int2
• Ln
• Log10
• Mod
• Power
• Quotient
• Round
• Round2
• Sin
• Sqrt
• Tan
• Trunc
• Add
Basic functions
• Average
• Avg
• Count
• Max
• Min
• Multiply
• Stdev
• Sum
• Var
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
• Date
• DayOfMonth
• DayOfWeek
• DaysBetween
• Hour
• MilliSecond
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Year
• YearEndDate
• YearStartDate
• Banding
• Coalesce
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• FirstInRange
• Lag
• LastInRange
• Lead
• OLAPAvg
OLAP functions
• OLAPCount
• OLAPMax
• OLAPMin
• OLAPRank
• OLAPSum
• Concat
String functions
• ConcatBlank
• InitCap
• LeftStr
• Length
• Lower
• LTrim
• RightStr
• RTrim
• SubStr
• Trim
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
• <>
• =
• >
• Begins With
• Between
• Contains
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
• Asin
Mathematical functions
• Atan
• Atan2
• Ceiling
• Cos
• Exp
• Floor
• Int
• Int2
• Ln
• Log10
• Mod
• Power
• Quotient
• Round
• Round2
• Sin
• Sqrt
• Tan
• Trunc
• Add
• Average
Basic functions
• Avg
• Count
• Max
• Min
• Multiply
• Stdev
• Sum
• Var
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
• Date
• DayOfMonth
• DayOfWeek
• DayOfYear
• Hour
• MilliSecond
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Year
• YearEndDate
• YearStartDate
• Banding
• Coalesce
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• Concat
• ConcatBlank
• InitCap
• LeftStr
• Length
• LTrim
• RightStr
• RTrim
• SubStr
• Trim
• -
Arithmetic operators
• x
• +
• /
• U-
• <
• <=
• <>
• =
• >
• >=
• Begins With
• Between
• Contains
Comparison operators
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
Comparison operators for rank
• *=
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
• Asin
• Atan
• Atan2
• Ceiling
• Cos
• Exp
• Int
• Int2
• Ln
• Log10
• Mod
• Power
• Round
• Round2
• Sin
• Sqrt
• Tan
• Trunc
IBM Netezza
The tables listed below describe the MicroStrategy function support for IBM
Netezza databases:
• Add
• Average
• Avg
• Count
• Max
• Min
• Multiply
• Product
• Stdev
• StdevP
• Sum
• Var
• VarP
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
• Date
• DayOfMonth
• DayOfWeek
• DayOfYear
• DaysBetween
Date and time functions
• Hour
• MilliSecond
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Week
• Year
• YearEndDate
• YearStartDate
• Banding
• Coalesce
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• FirstInRange
• Lag
• LastInRange
• Lead
• MovingAvg
• MovingCount
• MovingMax
• MovingStdev
• MovingStdevP
• MovingSum
• OLAPAvg
• OLAPCount
• OLAPMax
• OLAPMin
• OLAPRank
• OLAPSum
• RunningAvg
• RunningCount
• RunningMax
• RunningMin
• RunningStdev
• RunningStdevP
• RunningSum
• Concat
• ConcatBlank
• InitCap
• LeftStr
• Length
• Lower
String functions
• LTrim
• Position
• RightStr
• RTrim
• SubStr
• Trim
• -
Arithmetic operators • x
• +
• /
• U-
• <
• <=
• <>
• =
• >
• >=
• Begins With
• Between
• Contains
Comparison operators
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
• Acosh
• Asin
• Asinh
• Atan
• Atan2
• Atanh
• Ceiling
Mathematical functions
• Cos
• Cosh
• Degrees
• Exp
• Floor
• Int
• Int2
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Radians
• Randbetween
• Round
• Round2
• Sin
• Sinh
• Sqrt
• Tan
• Tanh
• Trunc
• Correlation
• Covariance
• Fisher
• Intercept
• InverseFisher
• RSquare
• Skew
• Slope
• Standardize
• SteYX
• Add
• Average
• Avg
• Count
• GeoMean
• Max
• Min
Basic functions
• Multiply
• Product
• Stdev
• StdevP
• Sum
• Var
• VarP
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
Date and time functions
• Date
• DayOfMonth
• DayOfWeek
• DayOfYear
• DaysBetween
• Hour
• MilliSecond
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Week
• Year
• YearEndDate
• YearStartDate
• Banding
• Coalesce
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• FirstInRange
• Lag
• Lead
• MovingAvg
• MovingCount
• MovingMax
• MovingMin
• MovingStdev
• MovingStdevP
• MovingSum
• OLAPAvg
• OLAPCount
• OLAPMax
• OLAPMin
• OLAPRank
• OLAPSum
• RunningAvg
• RunningCount
• RunningMax
• RunningMin
• RunningStdev
• RunningStdevP
• RunningSum
• Concat
• ConcatBlank
• LeftStr
• Length
• Lower
• LTrim
• Position
• RightStr
• RTrim
• SubStr
• Trim
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
• <>
• =
• >
• >=
• Between
• Contains
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
• Acosh
• Asin
Mathematical functions
• Asinh
• Atan
• Atan2
• Atanh
• Ceiling
• Cos
• Cosh
• Degrees
• Exp
• Floor
• Int
• Int2
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Radians
• Randbetween
• Round
• Round2
• Sin
• Sinh
• Sqrt
• Tan
• Tanh
• Trunc
• Covariance
• Fisher
• Intercept
• InverseFisher
• Kurtosis
• Pearson
• RSquare
• Skew
• Slope
• Standardize
• SteYX
• Add
• Average
• Avg
• Count
• GeoMean
Basic functions
• Max
• Min
• Multiply
• Product
• Stdev
• StdevP
• Sum
• Var
• VarP
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
• Date
• DayOfMonth
• DayOfWeek
• DayOfYear
• DaysBetween
• MilliSecond
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Week
• Year
• YearEndDate
• YearStartDate
• Banding
• Coalesce
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• FirstInRange
• Lag
• LastInRange
• Lead
• MovingAvg
• MovingCount
• MovingMax
• MovingMin
OLAP functions
• MovingStdev
• MovingStdevP
• MovingSum
• OLAPAvg
• OLAPCount
• OLAPMax
• OLAPMin
• OLAPRank
• OLAPSum
• RunningAvg
• RunningCount
• RunningMax
• RunningMin
• RunningStdev
• RunningStdevP
• RunningSum
• Concat
• ConcatBlank
• InitCap
• LeftStr
• Length
• Lower
String functions
• LTrim
• Position
• RightStr
• RTrim
• SubStr
• Trim
• -
• x
Arithmetic operators
• +
• /
• U-
• <
• <=
• <>
• =
• >
• >=
• Begins With
• Between
• Contains
Comparison operators
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
• Acosh
• Asin
• Asinh
• Atan
• Atan2
• Atanh
• Ceiling
• Cosh
• Degrees
• Exp
• Floor
• Int
• Int2
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Radians
• Randbetween
• Round
• Round2
• Sin
• Sinh
• Sqrt
• Tan
• Tanh
• Trunc
• Correlation
• Covariance
• Fisher
• Intercept
• InverseFisher
• Kurtosis
Statistical functions
• Pearson
• RSquare
• Skew
• Slope
• Standardize
• SteYX
• Add
• Average
• Avg
• Count
Basic functions
• Max
• Min
• Multiply
• Sum
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
• DayOfMonth
• DayOfWeek
• DayOfYear
• DaysBetween
• Hour
• MilliSecond
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Week
• Year
• YearEndDate
• YearStartDate
• Banding
• Coalesce
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• Lag
• Lead
• MovingAvg
OLAP functions
• MovingCount
• MovingMax
• MovingMin
• MovingSum
• OLAPAvg
• OLAPCount
• OLAPMax
• OLAPMin
• OLAPRank
• OLAPSum
• RunningAvg
• RunningCount
• RunningMax
• RunningMin
• RunningSum
• Concat
• ConcatBlank
• InitCap
• LeftStr
• Length
• Lower
String functions
• LTrim
• Position
• RightStr
• RTrim
• SubStr
• Trim
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
• <>
• =
• >
• >=
• Begins With
• Between
• Contains
Comparison operators
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
Comparison operators for rank
• *<>
• *=
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Ceiling
• Exp
• Floor
• Int
• Int2
Mathematical functions
• Ln
• Mod
• Quotient
• Round
• Round2
• Sqrt
Infobright
The tables listed below describe the MicroStrategy function support for
Infobright databases:
Infobright 4.0.x
• Add
• Average
• Avg
• Count
• GeoMean
• Greatest
• Least
• Max
Basic functions
• Min
• Multiply
• Product
• Stdev
• StdevP
• Sum
• Var
• VarP
• AddDays
• CurrentDate
• CurrentDateTime
• CurrentTime
• Date
• DayOfMonth
• DayOfWeek
• DayOfYear
• DaysBetween
• Hour
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Week
• Year
• YearEndDate
• YearStartDate
• Banding
• Coalesce
• IsNotNull
• NullToZero
• ZeroToNull
• Concat
• ConcatBlank
• InitCap
• LeftStr
• Length
• Lower
• Position
• RightStr
• RTrim
• SubStr
• Trim
• Upper
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
Comparison operators
• <>
• =
• >
• >=
• Begins With
• Between
• Contains
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
• Acosh
• Asin
• Asinh
• Atan
• Atan2
• Atanh
• Ceiling
• Cos
• Cosh
• Degrees
Mathematical functions
• Exp
• Floor
• Int
• Int2
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Radians
• Randbetween
• Round
• Round2
• Sin
• Sinh
• Sqrt
• Tan
• Tanh
• Trunc
Kognitio
The tables listed below describe the MicroStrategy function support for
Kognitio databases:
• Add
• Average
• Avg
• First
• GeoMean
• Greatest
• Last
• Least
• Max
• Min
• Multiply
• StdevP
• Sum
• VarP
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
• Date
• DayOfMonth
• DayOfWeek
• DaysBetween
• Hour
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Week
• Year
• YearEndDate
• YearStartDate
• NullToZero
Null and Zero functions
• ZeroToNull
• Lag
• Lead
• MovingAvg
• MovingCount
• MovingMax
• MovingMin
• MovingStdevP
• MovingSum
• OLAPCount
• OLAPMax
• OLAPMin
• OLAPRank
• OLAPSum
• RunningAvg
• RunningCount
• RunningMax
• RunningMin
• RunningStdevP
• RunningSum
• Concat
• InitCap
• LeftStr
• Length
• Lower
• Position
• RightStr
• RTrim
• SubStr
• Trim
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
• =
• >
• >=
• Begins With
• Between
• Contains
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
• Acosh
• Asin
• Asinh
• Atan
• Atanh
• Ceiling
• Cos
• Cosh
• Degrees
• Exp
• Int
• Ln
• Log10
• Mod
• Power
• Quotient
• Radians
• Round
• Round2
• Sin
• Sinh
• Sqrt
• Tan
• Tanh
• Trunc
Maria DB
The tables listed below describe the MicroStrategy function support for
Maria DB databases:
Maria DB 5.5.x
• Add
• Average
• Avg
• Count
• GeoMean
• Greatest
Basic functions
• Least
• Max
• Min
• Multiply
• Product
• Stdev
• StdevP
• Sum
• Var
• VarP
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
• Date
• DayOfMonth
• DayOfWeek
• DayOfYear
• DaysBetween
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Week
• Year
• YearEndDate
• YearStartDate
• Banding
• Coalesce
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• Concat
• ConcatBlank
• InitCap
• LeftStr
• Length
• Lower
• Position
• RightStr
• RTrim
• SubStr
• Trim
• Upper
• -
Arithmetic operators
• x
• +
• /
• U-
• <
• <=
• <>
• =
• >
• >=
• Begins With
• Between
• Contains
Comparison operators
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
Comparison operators for rank
• *=
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
• Acosh
• Asin
• Asinh
• Atan
• Atan2
• Atanh
• Cos
• Degrees
• Exp
• Floor
• Int
• Int2
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Radians
• Randbetween
• Round
• Round2
• Sin
• Sqrt
• Tan
• Trunc
Microsoft Access
The tables listed below describe the MicroStrategy function support for
Microsoft Access databases:
• Add
• Average
• Avg
• Count
Basic functions
• Max
• Min
• Multiply
• Sum
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
• Date
• DayOfMonth
• DayOfWeek
• DaysBetween
• Hour
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Week
• Year
• YearEndDate
• YearStartDate
• Banding
• Coalesce
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• Concat
• ConcatBlank
• InitCap
• LeftStr
• Length
• Position
• RightStr
• SubStr
• Trim
• Upper
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
• <>
• =
• >
• >=
• Begins With
• Between
• Contains
Comparison operators
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
Comparison operators for rank
• *<>
• *=
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Floor
• Int
• Int2
Mathematical functions
• Ln
• Mod
• Quotient
• Add
Basic functions
• Average
• Avg
• Count
• GeoMean
• Max
• Min
• Multiply
• Stdev
• StdevP
• Sum
• Var
• VarP
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
• Date
• DayOfMonth
Date and time functions
• DayOfWeek
• DayOfYear
• DaysBetween
• Hour
• Millisecond
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Year
• YearEndDate
• YearStartDate
• Banding
• Coalesce
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• Concat
• ConcatBlank
• InitCap
• LeftStr
String functions
• Length
• Lower
• LTrim
• Position
• RightStr
• RTrim
• SubStr
• Trim
• Upper
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
• <>
• =
• >
• >=
• Begins With
• Contains
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Cos
• Exp
• Floor
• Int
Mathematical functions
• Int2
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Round
• Round2
• Sin
• Sqrt
• Tan
• Add
Basic functions
• Average
• Avg
• Count
• GeoMean
• Max
• Min
• Multiply
• Stdev
• StdevP
• Sum
• Var
• VarP
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
• Date
• DayOfMonth
Date and time functions
• DayOfWeek
• DayOfYear
• DaysBetween
• Hour
• MilliSecond
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Week
• Year
• YearEndDate
• YearStartDate
• Banding
• Coalesce
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• Concat
• ConcatBlank
• InitCap
• Length
• Lower
• LTrim
• Position
• RightStr
• RTrim
• SubStr
• Trim
• Upper
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
• <>
• =
• >
• >=
• Begins With
Comparison operators
• Between
• Contains
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
• Acosh
• Asin
• Atan
• Atan2
• Atanh
• Ceiling
• Cos
• Degrees
• Exp
• Floor
• Int
• Int2
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Radians
• Randbetween
• Round
• Round2
• Sin
• Sqrt
• Tan
• Trunc
• Add
• Average
• Avg
• Count
• GeoMean
• Max
• Multiply
• Stdev
• StdevP
• Sum
• Var
• VarP
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
• DayOfMonth
• DayOfWeek
• DayOfYear
• DaysBetween
• Hour
• MilliSecond
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Week
• Year
• YearEndDate
• YearStartDate
• Banding
• Coalesce
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• Concat
• ConcatBlank
String functions
• InitCap
• LeftStr
• Length
• Lower
• LTrim
• Position
• RightStr
• RTrim
• SubStr
• Trim
• Upper
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
• <>
• =
• >
• Begins With
• Between
• Contains
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
• Acosh
Mathematical functions
• Asin
• Asinh
• Atan
• Atan2
• Atanh
• Ceiling
• Cos
• Degrees
• Exp
• Floor
• Int
• Int2
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Radians
• Randbetween
• Round
• Round2
• Sin
• Sqrt
• Tan
• Trunc
• Add
• Average
• Avg
• Count
• GeoMean
• Max
• Multiply
• Stdev
• StdevP
• Sum
• Var
• VarP
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
• DayOfMonth
• DayOfWeek
• DayOfYear
• DaysBetween
• Hour
• MilliSecond
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Week
• Year
• YearEndDate
• YearStartDate
• Banding
• Coalesce
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• Lag
• OLAPRank
• Concat
String functions
• ConcatBlank
• InitCap
• LeftStr
• Length
• Lower
• LTrim
• Position
• RightStr
• RTrim
• SubStr
• Trim
• Upper
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
• <>
• =
• >=
• Begins With
• Between
• Contains
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acosh
Mathematical functions
• Asin
• Asinh
• Atan
• Atanh
• Ceiling
• Cos
• Exp
• Floor
• Int
• Int2
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Round
• Round2
• Sin
• Sqrt
• Tan
• Trunc
• Add
• Average
• Avg
• Count
• GeoMean
• Max
• Multiply
• Stdev
• StdevP
• Sum
• Var
• VarP
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
• DayOfMonth
• DayOfWeek
• DayOfYear
• DaysBetween
• Hour
• MilliSecond
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Week
• Year
• YearEndDate
• YearStartDate
• Banding
• Coalesce
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• Lag
• LastInRange
• Lead
OLAP functions
• MovingAvg
• MovingCount
• MovingMax
• MovingMin
• MovingStdev
• MovingStdevP
• MovingSum
• OLAPAvg
• OLAPCount
• OLAPMax
• OLAPMin
• OLAPRank
• OLAPSum
• RunningAvg
• RunningCount
• RunningMax
• RunningMin
• RunningStdev
• RunningStdevP
• RunningSum
• Concat
• ConcatBlank
• InitCap
• Length
• Lower
• LTrim
• Position
• RightStr
• RTrim
• SubStr
• Trim
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
• <>
• =
• >
• >=
• Begins With
• Contains
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
• Acosh
• Asin
• Asinh
Mathematical functions
• Atan
• Atanh
• Atan2
• Ceiling
• Cos
• Exp
• Floor
• Int
• Int2
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Round
• Round2
• Sin
• Sqrt
• Tan
• Trunc
• Add
• Average
Basic functions
• Avg
• Count
• GeoMean
• Max
• Min
• Multiply
• Stdev
• StdevP
• Sum
• Var
• VarP
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
• Date
• DayOfMonth
• DayOfWeek
Date and time functions
• DayOfYear
• DaysBetween
• Hour
• MilliSecond
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Week
• Year
• YearEndDate
• YearStartDate
• Banding
• Coalesce
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• Lag
• OLAPRank
• Concat
• ConcatBlank
• InitCap
• Length
• Lower
• LTrim
• Position
• RightStr
• RTrim
• SubStr
• Trim
• Upper
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
• <>
• =
• >
• >=
• Begins With
Comparison operators
• Between
• Contains
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acosh
• Asin
• Asinh
• Atanh
• Ceiling
• Cos
• Exp
• Floor
• Int
• Int2
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Round
• Round2
• Sin
• Sqrt
• Tan
• Trunc
• Add
• Average
• Count
• GeoMean
• Max
• Min
• Multiply
• Stdev
• StdevP
• Sum
• Var
• VarP
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
• Date
• DayOfMonth
• DayOfWeek
• DaysBetween
• Hour
• MilliSecond
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Week
• Year
• YearEndDate
• YearStartDate
• Banding
• Coalesce
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• Concat
• ConcatBlank
• InitCap
• LeftStr
• Length
String functions
• Lower
• LTrim
• Position
• RightStr
• RTrim
• SubStr
• Trim
• Upper
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
• <>
• =
• >
• >=
• Begins With
• Between
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
• Acosh
• Asin
• Asinh
• Atan
Mathematical functions
• Atan2
• Atanh
• Ceiling
• Cos
• Degrees
• Exp
• Floor
• Int
• Int2
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Radians
• Randbetween
• Round
• Round2
• Sin
• Sqrt
• Tan
• Trunc
MySQL
The tables listed below describe the MicroStrategy function support for
MySQL databases:
MySQL 5.x
• Add
• Average
• Avg
• Count
• GeoMean
• Greatest
• Least
• Max
Basic functions
• Min
• Multiply
• Product
• Stdev
• StdevP
• Sum
• Var
• VarP
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
Date and time functions
• CurrentTime
• Date
• DayOfMonth
• DayOfWeek
• DayOfYear
• DaysBetween
• Hour
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Week
• Year
• YearEndDate
• YearStartDate
• Banding
• Coalesce
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• Concat
String functions
• ConcatBlank
• InitCap
• LeftStr
• Length
• Lower
• LTrim
• Position
• RightStr
• RTrim
• SubStr
• Trim
• Upper
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
• <>
• =
• >=
• Begins With
• Between
• Contains
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
Mathematical functions
• Acosh
• Asin
• Asinh
• Atan
• Atan2
• Atanh
• Ceiling
• Cos
• Degrees
• Exp
• Floor
• Int
• Int2
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Radians
• Randbetween
• Round
• Round2
• Sin
• Sqrt
• Tan
• Trunc
Oracle
The tables listed below describe the MicroStrategy function support for
Oracle databases:
Oracle 10g
• Add
• Average
• Avg
• Count
• First
• GeoMean
• Greatest
Basic functions
• Last
• Least
• Max
• Median
• Min
• Multiply
• Product
• Stdev
• StdevP
• Sum
• Var
• VarP
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
• Date
• DayOfMonth
• DayOfWeek
• DayOfYear
• DaysBetween
Date and time functions
• Hour
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Week
• Year
• YearEndDate
• YearStartDate
• Banding
• Coalesce
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• FirstInRange
• Lag
• LastInRange
• Lead
• MovingAvg
• MovingCount
• MovingMax
• MovingMin
OLAP functions
• MovingStdev
• MovingStdevP
• MovingSum
• OLAPAvg
• OLAPCount
• OLAPMax
• OLAPMin
• OLAPRank
• OLAPSum
• RunningAvg
• RunningCount
• RunningMax
• RunningMin
• RunningStdev
• RunningStdevP
• RunningSum
• Concat
• ConcatBlank
• InitCap
• LeftStr
• Length
• Lower
String functions
• LTrim
• Position
• RightStr
• RTrim
• SubStr
• Trim
• -
• x
Arithmetic operators
• +
• /
• U-
• <
• <=
• <>
• =
• >
• >=
• Begins With
• Between
• Contains
Comparison operators
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
• Acosh
• Asin
• Asinh
• Atan
• Atan2
• Atanh
• Ceiling
• Cosh
• Degrees
• Exp
• Floor
• Int
• Int2
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Radians
• Round
• Round2
• Sin
• Sinh
• Sqrt
• Tan
• Tanh
• Trunc
• Correlation
• Covariance
• Fisher
• Intercept
• InverseFisher
• Kurtosis
Statistical functions
• Pearson
• RSquare
• Skew
• Slope
• Standardize
• SteYX
Oracle 10gR2
• Add
• Average
• Avg
• Count
• First
• GeoMean
• Greatest
• Last
• Least
• Median
• Min
• Multiply
• Product
• Stdev
• StdevP
• Sum
• Var
• VarP
• AddDays
• AddMonths
• CurrentDateTime
• CurrentTime
• Date
• DayOfMonth
• DayOfWeek
• DayOfYear
• DaysBetween
• Hour
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Week
• Year
• YearEndDate
• YearStartDate
• Banding
• Coalesce
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• Lag
• LastInRange
• Lead
• MovingAvg
• MovingCount
• MovingMax
• MovingMin
• MovingStdev
• MovingStdevP
• MovingSum
• OLAPAvg
• OLAPCount
• OLAPMax
• OLAPMin
• OLAPRank
• OLAPSum
• RunningAvg
• RunningCount
• RunningMax
• RunningMin
• RunningStdev
• RunningStdevP
• RunningSum
• ConcatBlank
• InitCap
• LeftStr
• Length
• Lower
• LTrim
• Position
• RightStr
• RTrim
• SubStr
• Trim
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
• <>
• =
• >=
• Begins With
• Between
• Contains
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
Mathematical functions
• Acosh
• Asin
• Asinh
• Atan
• Atan2
• Atanh
• Ceiling
• Cos
• Cosh
• Degrees
• Exp
• Floor
• Int
• Int2
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Radians
• Round
• Round2
• Sin
• Sinh
• Sqrt
• Tan
• Tanh
• Trunc
• Correlation
• Covariance
• Fisher
• Intercept
• InverseFisher
• Kurtosis
Statistical functions
• Pearson
• RSquare
• Skew
• Slope
• Standardize
• SteYX
Oracle 11g
• Add
• Average
• Avg
• First
• GeoMean
• Greatest
• Last
• Least
• Max
• Median
• Min
• Multiply
• Product
• Stdev
• StdevP
• Sum
• Var
• VarP
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
• Date
• DayOfWeek
• DayOfYear
• DaysBetween
• Hour
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Week
• Year
• YearEndDate
• YearStartDate
• Banding
• Coalesce
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• FirstInRange
• Lag
• LastInRange
• Lead
• MovingCount
• MovingMax
• MovingMin
• MovingStdev
• MovingStdevP
• MovingSum
• OLAPAvg
• OLAPCount
• OLAPMax
• OLAPMin
• OLAPRank
• OLAPSum
• RunningAvg
• RunningCount
• RunningMax
• RunningMin
• RunningStdev
• RunningStdevP
• RunningSum
• Concat
• ConcatBlank
• InitCap
• LeftStr
• Lower
• LTrim
• Position
• RightStr
• RTrim
• SubStr
• Trim
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
• <>
• =
• >
• >=
• Begins With
• Between
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
• Acosh
• Asin
• Asinh
• Atan
Mathematical functions
• Atan2
• Atanh
• Ceiling
• Cos
• Cosh
• Degrees
• Exp
• Floor
• Int
• Int2
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Radians
• Round
• Round2
• Sin
• Sinh
• Sqrt
• Tan
• Tanh
• Trunc
• Correlation
• Covariance
• Fisher
Statistical functions
• Intercept
• InverseFisher
• Kurtosis
• Pearson
• RSquare
• Skew
• Slope
• Standardize
• SteYX
Oracle 11g R2
• Add
• Average
• Avg
• Count
• First
• GeoMean
• Greatest
• Least
• Max
• Median
• Min
• Multiply
• Product
• Stdev
• StdevP
• Sum
• Var
• VarP
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
• Date
• DayOfMonth
• DayOfWeek
• DayOfYear
• DaysBetween
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Week
• Year
• YearEndDate
• YearStartDate
• Banding
• Coalesce
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• FirstInRange
• Lag
• LastInRange
• Lead
• MovingAvg
• MovingCount
• MovingMax
• MovingMin
• MovingStdevP
• MovingSum
• OLAPAvg
• OLAPCount
• OLAPMax
• OLAPMin
• OLAPRank
• OLAPSum
• RunningAvg
• RunningCount
• RunningMax
• RunningMin
• RunningStdev
• RunningStdevP
• RunningSum
• Concat
• ConcatBlank
• InitCap
• LeftStr
• Length
• Lower
String functions
• LTrim
• Position
• RightStr
• RTrim
• SubStr
• Trim
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
• <>
• =
• >
• >=
• Begins With
• Between
• Contains
Comparison operators
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• IF
• Not
• Or
• Abs
• Acos
• Acosh
• Asin
• Asinh
• Atan
• Atan2
• Atanh
• Ceiling
• Cos
Mathematical functions
• Cosh
• Degrees
• Exp
• Floor
• Int
• Int2
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Radians
• Round
• Round2
• Sin
• Sinh
• Sqrt
• Tan
• Tanh
• Trunc
• Correlation
• Covariance
• Fisher
• Intercept
• InverseFisher
• Kurtosis
Statistical functions
• Pearson
• RSquare
• Skew
• Slope
• Standardize
• SteYX
Oracle 12c
• Add
• Average
• Avg
• Count
• First
• GeoMean
• Greatest
• Last
• Least
• Median
• Min
• Multiply
• Product
• Stdev
• StdevP
• Sum
• Var
• VarP
• AddDays
• AddMonths
• CurrentDateTime
• CurrentTime
• Date
• DayOfMonth
• DayOfWeek
• DayOfYear
• DaysBetween
• Hour
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Week
• Year
• YearEndDate
• YearStartDate
• Banding
• Coalesce
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• Lag
• LastInRange
• Lead
• MovingAvg
• MovingCount
• MovingMax
• MovingMin
• MovingStdev
• MovingStdevP
• MovingSum
• OLAPAvg
• OLAPCount
• OLAPMax
• OLAPMin
• OLAPRank
• OLAPSum
• RunningAvg
• RunningCount
• RunningMax
• RunningMin
• RunningStdev
• RunningStdevP
• RunningSum
• ConcatBlank
• InitCap
• LeftStr
• Length
• Lower
• LTrim
• Position
• RightStr
• RTrim
• SubStr
• Trim
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
• <>
• =
• >=
• Begins With
• Between
• Contains
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
Mathematical functions
• Acosh
• Asin
• Asinh
• Atan
• Atan2
• Atanh
• Ceiling
• Cos
• Cosh
• Degrees
• Exp
• Floor
• Int
• Int2
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Radians
• Round
• Round2
• Sin
• Sinh
• Sqrt
• Tan
• Tanh
• Trunc
• Correlation
• Covariance
• Fisher
• Intercept
• InverseFisher
• Kurtosis
Statistical functions
• Pearson
• RSquare
• Skew
• Slope
• Standardize
• SteYX
Actian Matrix
The tables listed below describe the MicroStrategy function support for
Actian Matrix databases:
• Add
• Average
• Avg
• Count
• GeoMean
• Min
• Multiply
• Product
• Sum
• VarP
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
• Date
• DaysBetween
• Hour
• MilliSecond
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Week
• Year
• YearEndDate
• YearStartDate
• Banding
• Coalesce
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• FirstInRange
• Lag
• LastInRange
• Lead
• MovingAvg
OLAP functions
• MovingCount
• MovingMax
• MovingMin
• MovingSum
• OLAPAvg
• OLAPCount
• OLAPMax
• OLAPMin
• OLAPRank
• OLAPSum
• RunningAvg
• RunningCount
• RunningMax
• RunningMin
• RunningSum
• Concat
• ConcatBlank
• InitCap
• LeftStr
• Length
• Lower
String functions
• LTrim
• Position
• RightStr
• RTrim
• SubStr
• Trim
• -
Arithmetic operators
• x
• +
• /
• U-
• <
• <=
• <>
• =
• >
• >=
• Begins With
• Between
• Contains
Comparison operators
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
Comparison operators for rank
• *=
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
• Acosh
• Asin
• Asinh
• Atan
• Atan2
• Atanh
• Cos
• Cosh
• Degrees
• Exp
• Floor
• Int
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Radians
• Randbetween
• Round
• Round2
• Sin
• Sinh
• Sqrt
• Tan
• Tanh
• Trunc
• Covariance
• Fisher
• Intercept
• InverseFisher
Statistical functions
• Kurtosis
• RSquare
• Slope
• Standardize
• Add
• Average
• Avg
• Count
• GeoMean
• Max
• Min
Basic functions
• Multiply
• Product
• Sum
• Stdev
• StdevP
• Var
• VarP
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
Date and time functions
• Date
• DayOfMonth
• DaysBetween
• Hour
• MilliSecond
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Year
• YearEndDate
• YearStartDate
• Banding
• Coalesce
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• FirstInRange
• Lag
• LastInRange
• Lead
OLAP functions
• MovingAvg
• MovingCount
• MovingMax
• MovingMin
• MovingSum
• OLAPAvg
• OLAPCount
• OLAPMax
• OLAPMin
• OLAPRank
• OLAPSum
• RunningAvg
• RunningCount
• RunningMax
• RunningMin
• RunningSum
• Concat
• ConcatBlank
• InitCap
• LeftStr
• Length
• Lower
String functions
• LTrim
• Position
• RightStr
• RTrim
• SubStr
• Trim
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
• <>
• =
• >
• >=
• Begins With
• Between
• Contains
Comparison operators
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
Comparison operators for rank
• *<>
• *=
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
• Acosh
• Asin
• Asinh
• Atan
• Atan2
• Ceiling
• Cos
• Cosh
• Degrees
• Exp
• Floor
• Int
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Radians
• Randbetween
• Round
• Round2
• Sin
• Sinh
• Tan
• Tanh
• Trunc
• Covariance
• Fisher
• Intercept
• InverseFisher
Statistical functions
• Kurtosis
• RSquare
• Slope
• Standardize
• Add
• Average
• Avg
• Count
• GeoMean
• Max
• Min
Basic functions
• Multiply
• Product
• Sum
• Stdev
• StdevP
• Var
• VarP
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
Date and time functions
• Date
• DayOfMonth
• DaysBetween
• Hour
• MilliSecond
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Year
• YearEndDate
• YearStartDate
• Banding
• Coalesce
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• FirstInRange
• Lag
• LastInRange
• Lead
OLAP functions
• MovingAvg
• MovingCount
• MovingMax
• MovingMin
• MovingSum
• OLAPAvg
• OLAPCount
• OLAPMax
• OLAPMin
• OLAPRank
• OLAPSum
• RunningAvg
• RunningCount
• RunningMax
• RunningMin
• RunningSum
• Concat
• ConcatBlank
• InitCap
• LeftStr
• Length
• Lower
String functions
• LTrim
• Position
• RightStr
• RTrim
• SubStr
• Trim
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
• <>
• =
• >
• >=
• Begins With
• Between
• Contains
Comparison operators
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
Comparison operators for rank
• *<>
• *=
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
• Acosh
• Asin
• Asinh
• Atan
• Atan2
• Ceiling
• Cos
• Cosh
• Degrees
• Exp
• Floor
• Int
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Radians
• Randbetween
• Round
• Round2
• Sin
• Sinh
• Tan
• Tanh
• Trunc
• Covariance
• Fisher
• Intercept
• InverseFisher
Statistical functions
• Kurtosis
• RSquare
• Slope
• Standardize
PostgreSQL
The tables listed below describe the MicroStrategy function support for
PostgreSQL databases:
PostgreSQL 8.4
• Add
• Average
• Avg
• Count
• GeoMean
• Greatest
• Least
• Max
Basic functions
• Min
• Multiply
• Product
• Stdev
• StdevP
• Sum
• Var
• VarP
• AddDays
Date and time functions
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
• Date
• DayOfMonth
• DayOfWeek
• DayOfYear
• DaysBetween
• Hour
• MilliSecond
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Year
• YearEndDate
• YearStartDate
• Banding
• Coalesce
• IsNotNull
Null and Zero functions
• IsNull
• NullToZero
• ZeroToNull
• FirstInRange
• OLAPRank
• Concat
• ConcatBlank
• InitCap
• LeftStr
• Length
• Lower
• Position
• RightStr
• RTrim
• SubStr
• Trim
• Upper
• -
• x
Arithmetic operators • +
• /
• U-
• <=
• <>
• =
• >
• >=
• Begins With
• Between
• Contains
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
Logical operators
• IF
• Not
• Or
• Abs
• Acos
• Acosh
• Asin
• Asinh
• Atan
• Atan2
• Atanh
• Ceiling
• Cos
• Exp
• Floor
• Int
• Int2
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Radians
• Randbetween
• Round
• Round2
• Sin
• Sqrt
• Tan
• Trunc
• Correlation
• Covariance
• RSquare
• Slope
PostgreSQL 9.x
• Add
• Average
• Avg
• Count
Basic functions
• GeoMean
• Greatest
• Least
• Max
• Min
• Multiply
• Product
• Stdev
• StdevP
• Sum
• Var
• VarP
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
• Date
• DayOfMonth
• DayOfWeek
• DaysBetween
• Hour
• MilliSecond
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Year
• YearEndDate
• YearStartDate
• Banding
• Coalesce
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• FirstInRange
• OLAPRank
• Concat
• ConcatBlank
• InitCap
• LeftStr
• Lower
• LTrim
• Position
• RightStr
• RTrim
• SubStr
• Trim
• Upper
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
• <>
• =
• >
• >=
• Begins With
• Between
Comparison operators
• Contains
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
• Acosh
• Asin
• Asinh
• Atan2
• Atanh
• Ceiling
• Cos
• Degrees
• Exp
• Floor
• Int
• Int2
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Radians
• Randbetween
• Round
• Round2
• Sin
• Sqrt
• Tan
• Trunc
• Correlation
• Covariance
• RSquare
• Slope
Salesforce.com
The tables listed below describe the MicroStrategy function support for
Salesforce.com data sources:
Salesforce.com
• Add
• Average
• Avg
• Count
• Max
• Min
• Multiply
• Sum
• CurrentDate
• CurrentDateTime
• CurrentTime
• Date
• DayOfMonth
Date and time functions
• DayOfWeek
• DayOfYear
• DaysBetween
• Hour
• MilliSecond
• Minute
• Month
• MonthsBetween
• Quarter
• Second
• Week
• Year
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• Concat
• ConcatBlank
• InitCap
• LeftStr
• Length
• LTrim
• Position
• RightStr
• RTrim
• SubStr
• Trim
• Upper
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
• <>
• =
• >
• >=
• Begins With
• Between
• Contains
Comparison operators
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
• Acosh
• Asin
• Asinh
• Atan
• Atan2
• Ceiling
• Cos
• Cosh
• Degrees
• Exp
• Floor
• Int
• Int2
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Radians
• Randbetween
• Round
• Round2
• Sin
• Sinh
• Sqrt
• Tan
• Tanh
SAND CDBMS
The tables listed below describe the MicroStrategy function support for
SAND CDBMS databases:
• Add
• Average
• Avg
• Count
• GeoMean
• Max
• Min
• Multiply
• Product
• Stdev
• Sum
• Var
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
• DayOfMonth
• DayOfWeek
• DayOfYear
• DaysBetween
• Hour
• MilliSecond
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Week
• Year
• YearEndDate
• YearStartDate
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• Concat
• ConcatBlank
• InitCap
String functions
• LeftStr
• Length
• Lower
• LTrim
• Position
• RightStr
• RTrim
• SubStr
• Trim
• Upper
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
• <>
• =
• >
• >=
• Between
• Contains
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
• Acosh
• Asin
Mathematical functions
• Asinh
• Atan
• Atanh
• Ceiling
• Cos
• Cosh
• Degrees
• Exp
• Floor
• Int
• Ln
• Log10
• Power
• Radians
• Round
• Round2
• Sin
• Sinh
• Sqrt
• Tan
• Tanh
• Correlation
• Intercept
• Average
• Avg
• Count
• GeoMean
• Max
• Median
• Min
• Multiply
• Product
• Stdev
• Sum
• Var
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
• Date
• DayOfWeek
• DayOfYear
• DaysBetween
• Hour
• MilliSecond
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Week
• Year
• YearEndDate
• YearStartDate
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• Concat
• ConcatBlank
• InitCap
• LeftStr
String functions
• Length
• Lower
• LTrim
• Position
• RightStr
• RTrim
• SubStr
• Trim
• Upper
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
• <>
• =
• >
• >=
• Begins With
• Contains
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
• Acosh
• Asin
• Asinh
Mathematical functions
• Atan
• Atanh
• Ceiling
• Cos
• Cosh
• Degrees
• Exp
• Floor
• Int
• Ln
• Log10
• Power
• Radians
• Round
• Round2
• Sin
• Sinh
• Sqrt
• Tan
• Tanh
• Correlation
• Intercept
• Add
• Average
• Avg
• Count
• GeoMean
• Greatest
• Max
• Min
• Multiply
• Stdev
• Sum
• Var
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
• DayOfMonth
• DayOfWeek
• DayOfYear
• DaysBetween
• Hour
• MilliSecond
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Week
• Year
• YearEndDate
• YearStartDate
• Banding
Internal functions
• BandingC
• NullToZero
Null and Zero functions
• ZeroToNull
• -
• x
Arithmetic operators • +
• /
• U-
• <=
• <>
• =
• >
• >=
• Begins With
• Between
• Contains
• Ends With
• In
• Like
• Not Between
• Not Contains
• NotIn
• NotLike
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
Logical operators
• IF
• Not
• Or
• Abs
• Acos
• Acosh
• Asin
• Asinh
• Atan
• Atan2
• Atanh
• Ceiling
• Cos
• Exp
• Floor
• Int
• Int2
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Round
• Round2
• Sin
• Sinh
• Sqrt
• Tan
• Tanh
• Trunc
• Add
• Average
• Avg
• Count
• GeoMean
• Greatest
Basic functions
• Least
• Max
• Min
• Multiply
• Stdev
• Sum
• Var
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
• Date
• DayOfMonth
• DayOfWeek
• DayOfYear
• DaysBetween
• Hour
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Week
• Year
• YearEndDate
• YearStartDate
• BandingC
• NullToZero
Null and Zero functions
• ZeroToNull
• Lag
• OLAPRank
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
• <>
• =
• >
• >=
Comparison operators
• Begins With
• Between
• Contains
• Ends With
• In
• Like
• Not Between
• Not Contains
• NotIn
• NotLike
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
• Acosh
• Asinh
• Atan
• Atan2
• Atanh
• Ceiling
• Cos
• Cosh
• Exp
• Floor
• Int
• Int2
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Round
• Round2
• Sin
• Sinh
• Sqrt
• Tan
• Tanh
• Trunc
Sybase
The tables listed below describe the MicroStrategy function support for SAP
Sybase databases:
• Add
• Average
• Avg
• Count
Basic functions
• Max
• Min
• Multiply
• Sum
• AddDays
• AddMonths
• CurrentDate
Date and time functions
• CurrentDateTime
• CurrentTime
• Date
• DayOfMonth
• DayOfWeek
• DayOfYear
• DaysBetween
• Hour
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Year
• YearEndDate
• YearStartDate
• Banding
• Coalesce
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• ConcatBlank
• InitCap
• LeftStr
• Length
• Lower
• LTrim
• Position
• RightStr
• RTrim
• SubStr
• Trim
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
• <>
• =
• >=
• Begins With
• Between
• Contains
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
Mathematical functions
• Asin
• Atan
• Atan2
• Ceiling
• Cos
• Degrees
• Exp
• Floor
• Int
• Int2
• Ln
• Log10
• Mod
• Power
• Quotient
• Radians
• Round
• Round2
• Sin
• Sqrt
• Tan
• Average
• Avg
• Count
• GeoMean
• Max
• Median
• Min
• Multiply
• Stdev
• Sum
• Var
• VarP
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
• Date
• DayOfWeek
• DayOfYear
• DaysBetween
• Hour
• MilliSecond
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Week
• Year
• YearEndDate
• YearStartDate
• Banding
• Coalesce
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• FirstInRange
• Lag
• LastInRange
• Lead
OLAP functions
• MovingAvg
• MovingCount
• MovingMax
• MovingMin
• MovingStdev
• MovingSum
• OLAPAvg
• OLAPCount
• OLAPMax
• OLAPMin
• OLAPRank
• OLAPSum
• RunningAvg
• RunningCount
• RunningMax
• RunningMin
• RunningStdev
• RunningSum
• Concat
• ConcatBlank
• InitCap
• LeftStr
• Length
String functions
• Lower
• LTrim
• Position
• RightStr
• RTrim
• SubStr
• Trim
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
• <>
• =
• >
• >=
• Begins With
• Between
• Contains
Comparison operators
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
• Asin
• Atan
• Atan2
• Ceiling
• Degrees
• Exp
• Floor
• Int
• Int2
• Ln
• Log10
• Mod
• Power
• Quotient
• Radians
• Round
• Round2
• Sin
• Sqrt
• Tan
• Trunc
• Add
• Average
• Avg
• Count
• Max
• Median
• Min
• Multiply
• Stdev
• Sum
• Var
• VarP
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
• Date
• DayOfMonth
• DayOfWeek
• DayOfYear
• DaysBetween
• MilliSecond
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Week
• Year
• YearEndDate
• YearStartDate
• Banding
• Coalesce
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• FirstInRange
• Lag
• LastInRange
• Lead
• MovingAvg
• MovingCount
• MovingMax
• MovingMin
OLAP functions
• MovingStdev
• MovingSum
• OLAPAvg
• OLAPCount
• OLAPMax
• OLAPMin
• OLAPRank
• OLAPSum
• RunningAvg
• RunningCount
• RunningMax
• RunningMin
• RunningStdev
• RunningSum
• Concat
• ConcatBlank
• InitCap
• LeftStr
• Length
• Lower
String functions
• LTrim
• Position
• RightStr
• RTrim
• SubStr
• Trim
• -
• x
Arithmetic operators • +
• /
• U-
• <=
• <>
• =
• >
• >=
• Begins With
• Between
• Contains
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
Logical operators
• IF
• Not
• Or
• Abs
• Acos
• Asin
• Atan
• Atan2
• Ceiling
• Cos
• Degrees
• Exp
• Floor
• Int2
• Ln
• Log10
• Mod
• Power
• Quotient
• Radians
• Round
• Round2
• Sin
• Sqrt
• Tan
• Trunc
• Add
• Average
• Avg
• Count
• GeoMean
• Max
• Min
• Multiply
• Stdev
• Sum
• Var
• VarP
• AddDays
• AddMonths
Date and time functions
• CurrentDate
• CurrentDateTime
• CurrentTime
• Date
• DayOfMonth
• DayOfWeek
• DayOfYear
• DaysBetween
• Hour
• MilliSecond
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Week
• Year
• YearEndDate
• YearStartDate
• Banding
• Coalesce
• IsNotNull
• NullToZero
• ZeroToNull
• FirstInRange
• Lag
• LastInRange
• Lead
• MovingAvg
• MovingCount
• MovingMax
• MovingMin
• MovingStdev
• MovingSum
• OLAPAvg
OLAP functions
• OLAPCount
• OLAPMax
• OLAPMin
• OLAPRank
• OLAPSum
• RunningAvg
• RunningCount
• RunningMax
• RunningMin
• RunningStdev
• RunningSum
• ConcatBlank
• InitCap
• LeftStr
• Length
• Lower
• LTrim
• Position
• RightStr
• RTrim
• SubStr
• Trim
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
• <>
• =
• >=
• Begins With
• Between
• Contains
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
Mathematical functions
• Asin
• Atan
• Atan2
• Ceiling
• Cos
• Degrees
• Exp
• Floor
• Int
• Int2
• Ln
• Log10
• Mod
• Power
• Quotient
• Radians
• Round
• Round2
• Sin
• Sqrt
• Tan
• Trunc
• Add
• Average
• Avg
• Count
• GeoMean
• Max
• Min
• Multiply
• Stdev
• Sum
• Var
• VarP
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
• DayOfMonth
• DayOfWeek
• DayOfYear
• DaysBetween
• Hour
• MilliSecond
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Week
• Year
• YearEndDate
• YearStartDate
• Banding
• Coalesce
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• FirstInRange
• Lag
• LastInRange
OLAP functions
• Lead
• MovingAvg
• MovingCount
• MovingMax
• MovingMin
• MovingStdev
• MovingSum
• OLAPAvg
• OLAPCount
• OLAPMax
• OLAPMin
• OLAPRank
• OLAPSum
• RunningAvg
• RunningCount
• RunningMax
• RunningMin
• RunningStdev
• RunningSum
• Concat
• ConcatBlank
• InitCap
• LeftStr
String functions
• Length
• Lower
• LTrim
• Position
• RightStr
• RTrim
• SubStr
• Trim
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
• <>
• =
• >
• >=
• Begins With
• Between
Comparison operators
• Contains
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
• Asin
• Atan
• Atan2
• Cos
• Degrees
• Exp
• Floor
• Int
• Int2
• Ln
• Log10
• Mod
• Power
• Quotient
• Radians
• Round
• Round2
• Sin
• Sqrt
• Tan
• Trunc
Teradata
The tables listed below describe the MicroStrategy function support for
Teradata databases:
Teradata 12
• Add
• Average
• Avg
• Count
• GeoMean
• Max
• Min
Basic functions
• Multiply
• Product
• Stdev
• StdevP
• Sum
• Var
• VarP
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
Date and time functions
• Date
• DayOfMonth
• DayOfYear
• DaysBetween
• Hour
• MilliSecond
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Year
• YearEndDate
• YearStartDate
• Banding
• Coalesce
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• Lag
• Lead
• MovingAvg
• MovingMax
• MovingMin
• MovingStdev
• MovingSum
• OLAPAvg
• OLAPCount
• OLAPMax
• OLAPMin
• OLAPRank
• OLAPSum
• RunningAvg
• RunningCount
• RunningMax
• RunningMin
• RunningStdev
• RunningStdevP
• RunningSum
• Concat
• ConcatBlank
• InitCap
• LeftStr
• Length
String functions
• Lower
• LTrim
• Position
• RightStr
• RTrim
• SubStr
• Trim
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
• <>
• =
• >
• >=
• Begins With
• Between
• Contains
Comparison operators
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
• Acosh
• Asin
• Asinh
• Atan
• Atanh
• Ceiling
• Cos
• Cosh
• Degrees
• Exp
• Floor
• Int
• Int2
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Radians
• Round
• Sin
• Sinh
• Sqrt
• Tan
• Tanh
• Trunc
• Correlation
• Covariance
• Fisher
• Intercept
Statistical functions
• InverseFisher
• Kurtosis
• Pearson
• RSquare
• Skew
• Slope
• Standardize
• SteYX
Teradata 13
• Add
• Average
• Avg
• Count
• GeoMean
• Max
• Min
Basic functions
• Multiply
• Product
• Stdev
• StdevP
• Sum
• Var
• VarP
• AddDays
• CurrentDate
• CurrentDateTime
• CurrentTime
• Date
• DayOfMonth
• DayOfYear
• DaysBetween
• Hour
• MilliSecond
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Year
• YearEndDate
• YearStartDate
• Banding
• Coalesce
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• Lag
• Lead
• MovingAvg
• MovingCount
• MovingMax
• MovingMin
• MovingStdev
• MovingSum
• OLAPAvg
• OLAPCount
• OLAPMin
• OLAPRank
• OLAPSum
• RunningAvg
• RunningCount
• RunningMax
• RunningMin
• RunningStdev
• RunningStdevP
• RunningSum
• Concat
• InitCap
• LeftStr
• Length
• Lower
• LTrim
• Position
• RightStr
• RTrim
• SubStr
• Trim
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
• <>
• =
• >
• Begins With
• Between
• Contains
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
• Acosh
Mathematical functions
• Asin
• Asinh
• Atan
• Atan2
• Atanh
• Ceiling
• Cos
• Cosh
• Degrees
• Exp
• Floor
• Int
• Int2
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Radians
• Round
• Sin
• Sinh
• Sqrt
• Tan
• Tanh
• Trunc
• Covariance
• Fisher
• Intercept
• InverseFisher
• Kurtosis
• Pearson
• RSquare
• Skew
• Slope
• Standardize
• SteYX
Teradata 13.10
• Add
• Average
• Avg
• Count
• GeoMean
Basic functions
• Max
• Min
• Multiply
• Product
• Stdev
• StdevP
• Sum
• Var
• VarP
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
• Date
• DayOfMonth
• DayOfYear
• DaysBetween
• Hour
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Year
• YearEndDate
• YearStartDate
• Banding
• Coalesce
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• Lag
• Lead
• MovingAvg
• MovingCount
• MovingMax
• MovingMin
• MovingStdev
• MovingSum
• OLAPAvg
OLAP functions
• OLAPCount
• OLAPMax
• OLAPMin
• OLAPRank
• OLAPSum
• RunningAvg
• RunningCount
• RunningMax
• RunningMin
• RunningStdev
• RunningStdevP
• RunningSum
• Concat
• ConcatBlank
• InitCap
• LeftStr
• Length
• Lower
String functions
• LTrim
• Position
• RightStr
• RTrim
• SubStr
• Trim
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
Comparison operators
• <>
• =
• >
• >=
• Begins With
• Between
• Contains
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
• Acosh
• Asin
• Asinh
• Atan
• Atan2
• Atanh
• Ceiling
• Cos
• Cosh
• Degrees
Mathematical functions
• Exp
• Floor
• Int
• Int2
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Radians
• Round
• Sin
• Sinh
• Sqrt
• Tan
• Tanh
• Trunc
• Correlation
• Covariance
• Fisher
• Intercept
• InverseFisher
• Kurtosis
Statistical functions
• Pearson
• RSquare
• Skew
• Slope
• Standardize
• SteYX
Teradata 14.0
• Add
• Avg
• Count
• GeoMean
• Greatest
• Least
• Max
• Min
• Multiply
• Product
• Stdev
• StdevP
• Sum
• Var
• VarP
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
• Date
Date and time functions
• DayOfMonth
• DayOfWeek
• DayOfYear
• DaysBetween
• Hour
• MilliSecond
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Week
• Year
• YearEndDate
• YearStartDate
• Banding
• Coalesce
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• Lag
• Lead
• MovingAvg
• MovingMax
• MovingMin
• MovingStdev
• MovingSum
• OLAPAvg
• OLAPCount
• OLAPMax
• OLAPMin
• OLAPRank
• OLAPSum
• RunningAvg
• RunningCount
• RunningMax
• RunningMin
• RunningStdev
• RunningStdevP
• RunningSum
• Concat
• ConcatBlank
• InitCap
• LeftStr
• Length
String functions
• Lower
• LTrim
• Position
• RightStr
• RTrim
• SubStr
• Trim
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
• <>
• =
• >
• >=
• Begins With
• Between
• Contains
Comparison operators
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Abs
• Acos
• Acosh
• Asin
• Asinh
• Atan
• Atanh
• Ceiling
• Cos
• Cosh
• Degrees
• Exp
• Floor
• Int
• Int2
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Radians
• Round
• Round2
• Sin
• Sinh
• Sqrt
• Tan
• Tanh
• Trunc
• Correlation
• Covariance
• Fisher
• InverseFisher
• Kurtosis
• Pearson
• RSquare
• Skew
• Slope
• Standardize
• SteYX
Teradata 14.10
• Add
• Average
• Avg
• Count
• GeoMean
• Greatest
• Least
• Max
Basic functions
• Min
• Multiply
• Product
• Stdev
• StdevP
• Sum
• Var
• VarP
• AddDays
• AddMonths
• CurrentDate
• CurrentDateTime
• CurrentTime
• Date
• DayOfMonth
• DayOfWeek
• DayOfYear
• DaysBetween
• Hour
• Minute
• Month
• MonthEndDate
• MonthsBetween
• MonthStartDate
• Quarter
• Second
• Week
• Year
• YearEndDate
• YearStartDate
• Banding
Internal functions
• BandingC
• Coalesce
• IsNotNull
• IsNull
Null and Zero functions
• NullToZero
• ZeroToNull
• Lag
• Lead
• MovingAvg
• MovingCount
• MovingMax
• MovingMin
• MovingStdev
• MovingSum
• OLAPAvg
• OLAPCount
OLAP functions
• OLAPMax
• OLAPMin
• OLAPRank
• OLAPSum
• RunningAvg
• RunningCount
• RunningMax
• RunningMin
• RunningStdev
• RunningStdevP
• RunningSum
• Concat
• ConcatBlank
• InitCap
• LeftStr
• Length
• Lower
String functions
• LTrim
• Position
• RightStr
• RTrim
• SubStr
• Trim
• -
• x
Arithmetic operators • +
• /
• U-
• <
• <=
• <>
Comparison operators
• =
• >
• >=
• Begins With
• Between
• Contains
• Ends With
• In
• Like
• Not Between
• Not Contains
• Not In
• Not Like
• *<=
• *<>
• *=
Comparison operators for rank
• *>=
• *Between
• Not*Between
• AND
• IF
Logical operators
• Not
• Or
• Acos
• Acosh
• Asin
• Asinh
• Atan
• Atan2
• Atanh
• Ceiling
• Cos
• Cosh
• Degrees
• Exp
• Floor
• Int
• Int2
• Ln
• Log
• Log10
• Mod
• Power
• Quotient
• Radians
• Round
• Round2
• Sin
• Sinh
• Sqrt
• Tan
• Tanh
• Trunc
• Correlation
• Covariance
• Fisher
• Intercept
• InverseFisher
• Kurtosis
Statistical functions
• Pearson
• RSquare
• Skew
• Slope
• Standardize
• SteYX