Functions Utility

AlignToAxes

AlignToAxes() can be used to transpose only the source data that matches the specified target data. The target data does not have to be contiguous but can contain spaces between rows and columns that do not get overwritten.


Syntax:

Qx.AlignToAxes(Range, Rows, Columns, View, Row Axis Columns, Column Axis Column, Value Column)
  • In Excel with Quintessence add-in versions prior to 25.1, use: AlignToAxes()
  • In the Quintessence Editor (Studio) using Quintessence language, use: AlignToAxes()
  • In the Quintessence Editor (Studio) using Python language, use: Qx.AlignToAxes()
 See parameter descriptions

RangeThe data that needs to be mapped.
RowsThe axis representing rows.
ColumnsThe axis representing columns.
View
(optional)
Defines how the data should be displayed. Options include:
• none return result without headers
• column return result with column headers only
• row return result with row headers only
• both return result with both column and row headers
Row Axis Columns
(optional)
The column to use for the row axis. This data must be in a vertical format.
Column Axis Columns
(optional)
The column to use for the column axis. This data must be in a horizontal format.
Value Column
(optional)
The column to use for the value.


Remarks:

  • Unless changed by an administrator, the default parameters are:
    • View: none
    • Row Axis Columns: Defaults to the first column of the Range parameter.
    • Column Axis Columns: Defaults to the second column of the Range parameter.
    • Value Column: Defaults to the third column of the Range parameter.

Examples:

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

> Example 1: Rearrange the source data that matches the target criteria

The following source data is in Excel in range B2:D13:

Stock 1Monday, March 31, 2014250
Stock 1Monday, June 30, 2014300
Stock 1Tuesday, September 30, 2014100
Stock 2Monday, March 31, 2014240
Stock 2Monday, June 30, 2014200
Stock 2Tuesday, September 30, 201490
Stock 3Monday, March 31, 2014110
Stock 3Monday, June 30, 2014350
Stock 3Tuesday, September 30, 2014225
Stock 4Monday, March 31, 201495
Stock 4Monday, June 30, 2014100
Stock 4Tuesday, September 30, 2014400

The rows to display the aligned results is in range F4:F6:

Stock 1
Stock 2
Stock 4

The columns to display the aligned results is in range F2:H2:

Monday, March 31, 2014Monday, June 30, 2014Tuesday, September 30, 2014

To align this data with both the row and column headers showing, the following formula can be passed:

=Qx.AlignToAxes(B2:D13, F4:F6, F2:H2, "both", "C1", "C2", "C3")

Result is:

Monday, March 31, 2014Monday, June 30, 2014Tuesday, September 30, 2014
Stock 1250300100
Stock 224020090
Stock 495100400

> Example 2: Rearrange the source data that matches multi-level target criteria

The following source data is in Excel in range B2:E13:

Stock 1PriceMonday, March 31, 2014250
Stock 1QuantityMonday, March 31, 2014100
Stock 1PriceMonday, June 30, 2014240
Stock 1QuantityMonday, June 30, 2014105
Stock 2PriceMonday, March 31, 201415
Stock 2QuantityMonday, March 31, 20141000
Stock 2PriceMonday, June 30, 201415
Stock 2QuantityMonday, June 30, 20141005
Stock 3PriceMonday, March 31, 2014200
Stock 3QuantityMonday, March 31, 2014100
Stock 3PriceMonday, June 30, 2014200
Stock 3QuantityMonday, June 30, 201455

The rows to display the aligned results is in range G4:H5 (a blank row will be used to separate the data between Stock 1 and Stock 3):

Stock 1Price
Stock 1Quantity
Stock 3Price
Stock 3Quantity

The columns to display the aligned results is in range G2:H2:

Monday, March 31, 2014Monday, June 30, 2014

To align this data with both the row and column headers showing, the following formula can be passed:

=Qx.AlignToAxes(B2:E13, G4:H5, G2:H2, "both", "C1, C2", "C3", "C4")

Result is:

Monday, March 31, 2014Monday, June 30, 2014
Stock 1Price250240
Stock 1Quantity100105
Stock 3Price200200
Stock 3Quantity10055