Functions Data

ReverseHierarchy

The ReverseHierarchy() function returns the parent levels linked to a specific child on a given date, for a relationship that is consistent across all levels. In Quintessence, a hierarchy consists of the same type of relationship repeating from parent to child, from that child to the next child, and so on.

Related functions: Hierarchy()Relationship()ReverseRelationship().


Syntax:

Qx.ReverseHierarchy(Classification Codes, Entity Codes, Relationship, Levels, IAAD, Projection, Headers, Source, ShowError)
  • In Excel with Quintessence addin versions prior to 25.1, use: ReverseHierarchy()
  • In the Quintessence Editor (Studio) using Quintessence language, use: ReverseHierarchy()
  • In the Quintessence Editor (Studio) using Python language, use: Qx.ReverseHierarchy()
 See parameter descriptions

Classification CodesThe root node to traverse to.
Entity CodesFunction requires an entity code that represents the root of a hierarchy.
RelationshipThe relationship between the child and parent entities.
Levels
(optional)
Specifies which levels to display (the first level is 0).
IAAD
(optional)
The “as at” date specifies the point in time for the information.
Relationships established after this date will not be shown.
Projection
(optional)
The projection of the hierarchy.
Available options are none, parents, or leaves.
Headers
(optional)
Specifies whether to include column headers in the output.
Options are none and column.
Source
(optional)
The source provider of the data.
ShowError
(optional)
If TRUE, an error message is displayed when the function fails.

Remarks:

  • Unless changed by an administrator, the default parameters are:
    • Levels: all available levels
    • IAAD: today
    • Projection: none
    • Headers: none
    • Source: determined by implicit or explicit defaults, if available.
  • It is always safer to specify the source parameter rather than relying on the default. Leaving this blank not only depends on explicit defaults set by the administrator, but also on data being loaded, which may cause conflicts with implicit defaults.

Examples:

The examples provided below are based on fictitious data for illustrative purposes only.

> Example 1: Return all levels of FofxPortfolio’s 5-tier classification hierarchy down to specific leaf nodes.


The relationship of interest is the ICB Classification, and the data is provided by the source InternalDataProvider.

=Qx.ReverseHierarchy("FofxPortfolio","YRK, RCL","ICB Classification","0,1,2,3,4,5",,, "column","InternalDataProvider")
012345
FofxPortfolioBasic MaterialsBasic ResourcesForestry & PaperForestryYRK
FofxPortfolioFood & BeverageFood ProducersFarming & FishingRCL