ClosingElement (PQL)

Returns the last member from a list of member elements in an attribute.

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


ClosingElement( <Hierarchy> , OPTIONAL <Member> )

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

  • The hierarchy or attribute needs to be the unique name for an existing hierarchy in the model.
  • The filtering member is the unique name for a member that will be used to filter the set of members in order to find the last member.
  • For details on how to employ and use this function see the semantic calculation overview.
Different Function types
  • This function is similar to the MDX "LastSibling" function.
  • The reciprocal OpeningElement function operates similarly.


This expression returns the member Yuba in the county hierarchy:

ClosingElement( [customer].[county] )

This example returns the member Westchester in the county hierarchy, (cross) filtered by the element "NY" in the states hierarchy:

ClosingElement( [customer].[county], [customer].[states].[NY] )