Functions Utility

Depivot

The Depivot() function converts a block of data with row and column headers into an array of columns. In the output, the columns are ordered as follows: column headers first, followed by row headers, and then the value columns. This format is useful for performing calculations on the data.

Related functions: Pivot


Syntax:

Qx.Depivot(Range, Columns, Rows)
  • In Excel with Quintessence addin versions prior to 25.1, use: Depivot()
  • In the Quintessence Editor (Studio) using Quintessence language, use: Depivot()
  • In the Quintessence Editor (Studio) using Python language, use: Qx.Depivot()
 See parameter descriptions

RangeThe range of cells to transform.
Columns
(optional)
The columns that contain the key values (column headers).
Rows
(optional)
The rows that contain the key values (row headers).

Remarks:

  • Unless changed by an administrator, the default parameters are:
    • Columns: C1
    • Rows: 1

Examples:

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

> Example 1: Depivoting a range of data with headers into three columns


Source Data (range in Excel: A1:C5):

Factor 1Factor 2
QGW3.793.88
QJU6.986.98
XDU5.555.77
VRR6.170.95

Formula:

=Qx.Depivot(A1:C5, "C1", 1) 

Result:

QGWFactor 13.79
QGWFactor 23.88
QJUFactor 16.98
QJUFactor 26.98
XDUFactor 15.55
XDUFactor 25.77
VRRFactor 16.17
VRRFactor 20.95
> Example 2: Depivoting a range of data with multiple row and column headers


Source Data (range in Excel: A1:F5):

Factor 1Factor 1Factor 2Factor 2
2017201820172018
Stock 1QGW4045200190
Stock 2QJU88806760
Stock 3XDU55507075

Formula:

=Qx.Depivot(A1:F5, "C1,C2", 2)

Result:

Stock 1QGWFactor 1201740
Stock 1QGWFactor 1201845
Stock 1QGWFactor 22017200
Stock 1QGWFactor 22018190
Stock 2QJUFactor 1201788
Stock 2QJUFactor 1201880
Stock 2QJUFactor 2201767
Stock 2QJUFactor 2201860
Stock 3XDUFactor 1201755
Stock 3XDUFactor 1201850
Stock 3XDUFactor 2201770
Stock 3XDUFactor 2201875