Functions Utility

Span

The Span() function arranges multiple blocks of data into a single combined block. It is commonly used to build reports consisting of multiple sections. Data blocks can be placed next to one another (horizontally) or on top of one another (vertically).

When the source data changes, resulting in larger or smaller output blocks, the combined layout automatically adjusts so that blocks expand or shift without overwriting one another.


Syntax:

Qx.Span([Expression], [Range n])
  • In Excel with Quintessence addin versions prior to 25.1, use: Span()
  • In the Quintessence Editor (Studio) using Quintessence language, use: Span()
  • In the Quintessence Editor (Studio) using Python language, use: Qx.Span()
 See parameter descriptions

Expression
(optional)
Defines how the input ranges (referred to as arr) are arranged:
* places two ranges side by side (horizontal placement)
/ places one range above another (vertical stacking)
() defines grouping and order of operations
Range n
(optional)
The blocks of input data to be arranged according to the expression.

Remarks:

  • The default parameters are:
    • Expression: / (all ranges are stacked vertically)
    • Range n: If no ranges are supplied, nothing is spanned.

Examples:

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

> Example 1: Arranging data vertically and horizontally


Arr1 (A1:A2):

AAA
AAA

Arr2 (B1:B2):

BBB
BBB

Arr3 (C1:C2):

CCC
CCC

To build this composite layout, the Expression parameter must:
Place Arr2 to the right of Arr1:

Place Arr1 to the right of Arr3:

Arr1 * Arr2
Arr3 * Arr1

Stack the two resulting blocks vertically:

(Arr1 * Arr2) / (Arr3 * Arr1)

Final formula:

=Qx.Span("(Arr1 * Arr2) / (Arr3 * Arr1)", A1:A2, B1:B2, C1:C2)

Result:

AAABBB
AAABBB
CCCAAA
CCCAAA