MicroStrategy ONE

Insert Function Wizard: Window

The Window page is displayed if the selected function accepts a moving window of values for parameters. An example is the OLAP function OLAPSum. You define the moving window by specifying its start point and end point.

The Start Point can have the following values:

  • Top of dataset: The calculation starts at the top value as determined by the BreakBy and SortBy values.

  • Current row: The calculation starts at the current row.

  • N rows before current row: The calculation starts a number of rows before the current row. Enter the number of rows in the Number of rows field.

  • N rows after current row: The calculation starts a number of rows after the current row. Enter the number of rows in the Number of rows field.

The End Point can have the following values:

  • Bottom of dataset: The calculation stops at the bottom value. The top value is determined by the BreakBy and SortBy values.

  • Current row: The calculation stops at the current row.

  • N rows before current row: The calculation stops a number of rows before the current row. Enter the number of rows in the Number of rows field.

  • N rows after current row: The calculation stops a number of rows after the current row. Enter the number of rows in the Number of rows field.

Click Finish to enter the function into the expression.

For example, create an expression using the OLAPSum function. Set the start point to the current row and the end point to two rows after the current row. For the first value, the values in rows 1 through 3 are added together. For the second row, the values in rows 2 through 4 are added together, and so on, as shown in the table below.

Row

Value

Window

OLAPSum

1

10

Rows 1 - 3

60 (10 + 20 + 30)

2

20

Rows 2 - 4

65 (20 + 30 + 15)

3

30

Rows 3 - 5

50 (30 + 15 + 5)

4

15

Rows 4 - 5

20 (15 + 5)

5

 5

Row 5

5