Functions Utility

SetUnion

The SetUnion() function returns the set theoretic union of two ranges. In other words, it returns all distinct elements that appear in either range, or in both.

Related functions: SetDifference, SetIntersect


Syntax:

Qx.SetUnion(Range 1, Range 2, [ByRow])
  • In Excel with Quintessence add-in versions prior to 25.1, use: SetUnion()
  • In the Quintessence Editor (Studio) using Quintessence language, use: SetUnion()
  • In the Quintessence Editor (Studio) using Python language, use: Qx.SetUnion()
 See parameter descriptions

Range 1The first range of data.
Range 2The second range of data.
ByRow
(optional)
Determines whether to treat multi-column input as rows (e.g., side-by-side items
as pairs) or as a set of discrete entities.

Remarks:

  • The default parameters are:
    • ByRow: False

Examples:

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

> Example 1: Distinct numbers appearing in either range


Range 1 (A1:A6):

1
5
6
4
5
8

Range 1 (B1:B4):

7
5
4
3

Find all distinct numbers that appear in either Range 1 or Range 2:

=Qx.SetUnion(A1:A6, B1:B4)

Result:

1
2
4
5
6
7
8
> Example 2: Treat multiple columns as single entities


Range 1 (A1:B5):

CEBBUY
MBDSELL
KVJSELL
GMPHOLD
YKGHOLD

Range 2 (C1:D4):

PHOBUY
GMP
CEBBUY
QGWBUY

Find all unique rows present in either Range 1 or Range 2:

=Qx.SetUnion(A1:B5, C1:D4, TRUE)

Result:

CEBBUY
GMP
GMPHOLD
KVJSELL
MBDSELL
PHOBUY
QGWBUY
YKGHOLD
> Example 3: Treat multiple columns as separate entities


Range 1 (A1:B2):

CEBKVJ
MBDGMP

Range 2 (C1:D2):

PHOCEB
GMP

Find all unique entities that appear in either Range 1 or Range 2:

=Qx.SetUnion(A1:B2, C1:D2)

Result:

CEB
GMP
KVJ
MBD
PHO