You are viewing content for 5.1 | 5.0 | 4.9 | 4.8 | 4.7 | 4.6 | 4.5 | 4.4 | 4.3 | Previous Releases


descendantOf

Examples

Returns true for each record (in the “FIRST_NAME” column) that is descendant of “John”, i.e. whose manager is “John”.

descendantOf(HR.EMPLOYEES.FIRST_NAME, "John")

You may also create a variable for the second parameter to compare against the records of the first one. When creating the variable, you can give it a default value, which users can change on the Insight level.

descendantOf(HR.EMPLOYEES.FIRST_NAME, $Emp)

If John is the manager of Paul, and if Paul is the manager of Mary, and if Mary is the manager of Dan, the function will return “true” for Paul and Mary only. The function will return “false” for Dan, since Dan is at depth level 3.

descendantOf(HR.EMPLOYEES.FIRST_NAME, "John", 2)

You may also create a variable for the second parameter to compare against the records of the first one. When creating the variable, you can give it a default value, which users can change on the Insight level.

descendantOf(HR.EMPLOYEES.FIRST_NAME, $Emp, 2)

Syntax

descendantOf(field, value, [depth])

Parameters

  • field: type
  • value: type
  • depth: int

Returns

boolean

Description

descendantOf takes a column of a hierarchical table as the first parameter, and returns true for each row where the first parameter is a descendant of the second one, down to the depth level specified by the optional depth parameter. The $sessionVariable parameter could be a value (e.g. Joe), or variable (e.g. $employee).


© Incorta, Inc. All Rights Reserved.