Functions for Restricted Measures

This is a list of functions you can use in expressions for restricted measures. These functions can't be used without a hierarchy. If you don't specify a hierarchy to be used, the first hierarchy that's defined for the dimension is used. The hierarchy must be selected in the preview or the story in SAP Analytics Cloud before you can use this function.

Date Time Functions

Function

Description

Syntax

Example

YTD (Year to Date)

Sums the aggregated values from the beginning of the year to the current date.

Without Hierarchy

"DATE_DIM" = YTD()

With Hierarchy

"DATE_DIM" = YTD('YQM') 

The following example returns the sum of the values for ExpectedClosingDate from the beginning of the year to the current date:

 "ExpectedClosingDate" = YTD();

.

MTD (Month to Date)

Sums the aggregated values from the beginning of the month to the current date.

Without Hierarchy

"DATE_DIM" = MTD()

With Hierarchy

"DATE_DIM" = MTD('YQM') 

The following example returns the sum of the values from the beginning of the month to the current date:

 "ExpectedClosingDate" = MTD();

QTD (Quarter to Date)

Sums the aggregated values from the beginning of the quarter to the current date.

Without Hierarchy

"DATE_DIM" = QTD()

With Hierarchy

"DATE_DIM" = QTD('YQM') 

The following example returns the sum of the values from the beginning of the quarter to the current date:

 "ExpectedClosingDate" = QTD();