Head (PQL)

Returns the first 'n' elements from a given 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

Head( <List> , <Integer> )

Syntax Alternatives

First( <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 head function; it retrieves the first "n" members of the specified object.

Head, unlike other methods such as 'TopCount', simply retrieves the first elements in the list. As such, a TopCount, is effectively an ordered list combined with the Head function.

Examples

This example will retrieve the first 5 members in the Manufacturer attribute:

Head( {AllMembers([manufacturers].[manufacturer])}, 5 )

Using the table below, this method would return Acme, Adihash, Esics, Nuke, and Old Balance: