Tail

Returns the last 'n' elements from a list in the specified hierarchy or attribute.

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

Syntax

Tail( <List> , <Integer> )

Syntax Alternatives

Last( <List> , <Integer> )

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

Comments
  • The list is a listing of elements from a hierarchy.
  • The integer is the number of values to return.
  • For details on how to employ and use this function see the semantic calculation overview.

This function is like the MDX tail function; it retrieves the last "n" members of the specified object.

Tail, unlike other methods such as 'BottomCount', simply retrieves the last elements in the list. As such, a BottomCount, is effectively an ordered list combined with the Tail function.

Examples

This example retrieves the last 3 members in the Manufacturer attribute:

Tail( {AllMembers([manufacturers].[manufacturer])}, 3 )

Using the table below, this method would return Ribuck, Slicenger, and Woolson: