Union (PQL)

Returns the union of two sets.

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

Syntax

Union( <List> , <List> )

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

Comments

Union returns a new set that is created by the union of existing sets from the same hierarchy. The new set does not contain any duplicate members, this means that if a member is present in both List A and List B it will also be present exactly once in the new set.

  • Each List parameter should be a list or set of elements from an existing hierarchy in the model.
  • In our syntax example, List A represents a list of elements from a hierarchy and List B represents another list of elements from the same hierarchy.
  • You can use the union function to join more than two lists in a union, by simply adding more sets to the list. For example, Union(List A, List B, List C, ...).
  • For details on how to employ and use this function see the semantic calculation overview.
Different Function types

This function is like the MDX Union function, returning a new list that is the union of the preceding lists.

Examples

The following example returns a list that is a union of the top 5 and the bottom 5 date key members (returned using AllMembers):

Union( TopCount({[Date].[dateKey].allmembers}, 5), BottomCount({[Date].[dateKey].allmembers}, 5) )

Note: Syntax alternatives are available for TopCount and BottomCount. See the linked reference for more information.