Lag (PQL)

Returns a member which is offset backwards from the specified member in a given hierarchy or attribute.

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

Syntax

Lag( <Member> , <Integer> )

Syntax Alternatives

<Member> .Lag()

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

Comments
  • The member needs to be the unique name of an existing member in a hierarchy in the model.
  • The integer position offset can be a positive or negative integer
  • For details on how to employ and use this function see the semantic calculation overview.
Different Function types
  • This function is like the MDX lag function and is a specific variation of the PQL Offset function.
  • The reciprocal Lead function operates similarly.

Also see the Offset function.

Examples

This example returns the member "2017" from the year hierarchy in the dates dimension (or table) since it is 2 positions lagging behind the year 2019:

Lag( [dates].[year].[2019] 2 )

This example returns the member September in the month hierarchy because it is 3 positions from the month of June. It is reflected forwards because it is NEGATIVE 3 positions from June:

Lag( [dates].[month].[June] -3 )