CurrentMember

Returns the currently selected member based on the context of the calculation or query.

  • Returned Output: Member
  • Library: PQL \ Semantic \ Member
  • Version: 2018.00.000
  • Compatibility: Pyramid Query Language (PQL) data sources

Syntax

CurrentMember( <Hierarchy> )

Syntax Alternatives

<Hierarchy> .CurrentMember()

* Click on the function's arguments above for more details on the input values.

Comments
  • The hierarchy or attribute needs to be the unique name for an existing hierarchy in the model.
  • For details on how to employ and use this function see the semantic calculation overview.
Different Function types
  • This function is like the MDX CurrentMember function.

How to Use this Function

Sometimes a formula needs to address the context in which the function is running to determine the way an operation is completed. "CurrentMember" is central to bringing the context into the formulation, by allowing the formula to ask what the current hierarchy selection is.

Examples

If the current query has been filtered by the year 2019, this function would return the member "2019" from the year hierarchy in the date dimension:

[date].[year].CurrentMember()

The example below builds a list of years starting with the currently selected year and then ranging backwards 5 years:

Range( CurrentMember([date].[year]), Offset(CurrentMember([date].[year]), -5) )