43
Understanding Functions in MicroStrategy
MicroStrategy Functions Reference
1
90
Additional examples of functions in expressions
© 2011 MicroStrategy, Inc.
insert into ZZT1Y0100BWMD002 values (1, -559.25,
33788.25)
Pass10 - Duration: 0:00:00.01
select pa2.[CATEGORY_ID] AS CATEGORY_ID,
a11.[CATEGORY_DESC] AS CATEGORY_DESC,
pa2.[YEAR_ID] AS YEAR_ID,
(IIF(ISNULL((pa3.[WJXBFS1] * pa2.[WJXBFS2])), 0,
(pa3.[WJXBFS1] * pa2.[WJXBFS2])) +
IIF(ISNULL(pa3.[WJXBFS2]), 0, pa3.[WJXBFS2])) AS
WJXBFS1
from [ZZT1Y0100BWMD001] pa2,
[ZZT1Y0100BWMD002] pa3,
[LU_CATEGORY] a11
where pa2.[CATEGORY_ID] = pa3.[CATEGORY_ID] and
pa2.[CATEGORY_ID] = a11.[CATEGORY_ID]
Pass11 - Duration: 0:00:00.01
drop table ZZT1Y0100BWMD000
Pass12 - Duration: 0:00:00.00
drop table ZZT1Y0100BWMD001
Pass13 - Duration: 0:00:00.01
drop table ZZT1Y0100BWMD002
• Pass0 and Pass1 calculate the Revenue {Year} metric.
• Pass2 calculates the inner portion of the YearNumber metric, assigning
the integer 1 to each year available in the LU_YEAR lookup table. Note
that this metric was defined by adding “Year” dimensionality with
filtering “None”; this forces the metric into its own pass of SQL (instead
of sharing Pass #02 with the Revenue {Year} metric). Consequently, all
years in the lookup table get numbered, not just the years with data in the
fact table.
• Passes 3 to 9 calculate the YearNumber, SlopeMetric, and
InterceptMetrics. The Intelligence Server performs the calculations based
on the data in the temporary table from passes 0 to 2. Values are
calculated and inserted back into the temporary tables.
• In Pass10, the Forecast metric is calculated based on the information
from all of the previous calculations. The mx+b calculation can be seen in
the SQL.
• The remaining passes drop the temporary tables.