FirstChild (PQL)

Executes first child aggregation on a column of data from the model. The column must contain numerical data for it to be functional.

  • Returned Output: Numeric
  • Library: PQL \ Semantic \ Aggregate
  • Version: 2023.00.000
  • Compatibility: Pyramid Query Language (PQL) data sources

Syntax

FirstChild( <Measure> )

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

Comments

The FirstChild function is used to return the first child of a specified member in a hierarchy. This function is useful when you need to retrieve or work with the first item in a hierarchical level, such as the first month of a year, the first employee reporting to a manager, or the first product in a category.

Parameters
  • member: The member in the hierarchy for which you want to retrieve the first child.
How It Works
  • The function navigates through the hierarchy to find the first child of the specified member.
  • The "first" child is determined by the natural order of the hierarchy, which is typically defined by the data model or the order in which the data is arranged.

Example

FirstChild([Products].^[Products].CurrentMember)

You can see the effect from this example snippet in column #3 – FirstChild, based on the products hierarchy and sales amount columns in position #1 and #2: