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. This is useful for formatting reports.
Syntax
AlignToAxes (Range, Rows, Columns, View, Row Axis Columns, Column Axis Column, Value Column)
Range | The range of Excel cells to manipulate |
Rows | The target row values on which to match data |
Columns | The target column values on which to match data |
View | View determines whether to retain any headings. Options are: ‘none‘, ‘both‘, ‘row‘, ‘column‘. |
Row Axis Columns | The source columns on which to match data to the target rows. |
Column Axis Column | The source column on which to match data to the target columns. |
Value Column | The column to use as the value corresponding to the new rows and columns. |
Note:
Input parameters can consist of Quintessence functions. This includes functions that return ranges in cases where a parameter value can be a range.
Examples
Example 1. Rearrange the source data that matches the target criteria
Example 2. Rearrange the source data that matches multi-level target criteria
Example 3. Rearrange the source data into flexible output formats
Note:
How your system administrator configured Quintessence determines which function parameters are required. In most implementations, administrators configure functions so that certain parameters default to specific values when left blank.
Example 1. Rearrange the source data that matches the target criteria
In this example, a range of data is transposed to form a new grid in a different arrangement. The source column ‘Asset’ is matched against the new rows. The source column ‘Date’ is matched against the new columns. The source column ‘Price’ is used as the grid value corresponding to the rows and columns.
Range | Align to axes | ||||||
Asset | Date | Price | 31 Mar 2014 | 30 Jun 2014 | 30 Sep 2014 | ||
YLG | 31 Mar 2014 | 250 | CFH | =AlignToAxes(A2:C14,E3:E5,F2:H2,‘none‘,‘C1‘,‘C2‘,‘C3‘) | |||
YLG | 30 Jun 2014 | 300 | UAG | ||||
YLG | 30 Sep 2014 | 100 | YLG | ||||
CFH | 31 Mar 2014 | 240 | |||||
CFH | 30 Jun 2014 | 200 | |||||
CFH | 30 Sep 2014 | 90 | |||||
DNM | 31 Mar 2014 | 110 | |||||
DNM | 30 Jun 2014 | 350 | |||||
DNM | 30 Sep 2014 | 225 | |||||
UAG | 31 Mar 2014 | 95 | |||||
UAG | 30 Jun 2014 | 100 | |||||
UAG | 30 Sep 2014 | 400 |
Range | Output | ||||||
Asset | Date | Price | 31 Mar 2014 | 30 Jun 2014 | 30 Sep 2014 | ||
YLG | 31 Mar 2014 | 250 | CFH | 240 | 200 | 90 | |
YLG | 30 Jun 2014 | 300 | UAG | 95 | 100 | 400 | |
YLG | 30 Sep 2014 | 100 | YLG | 250 | 300 | 100 | |
CFH | 31 Mar 2014 | 240 | |||||
CFH | 30 Jun 2014 | 200 | |||||
CFH | 30 Sep 2014 | 90 | |||||
DNM | 31 Mar 2014 | 110 | |||||
DNM | 30 Jun 2014 | 350 | |||||
DNM | 30 Sep 2014 | 225 | |||||
UAG | 31 Mar 2014 | 95 | |||||
UAG | 30 Jun 2014 | 100 | |||||
UAG | 30 Sep 2014 | 400 |
Example 2. Rearrange the source data that matches multi-level target criteria
This example has multiple level target rows, consisting of Portfolio and Date. The match is done on source column 1 (Portfolio) and source column 3 (Date).
Range | Align to axes | |||||||
Portfolio | Asset | Date | Income | YLG | CFH | |||
5010 | YLG | 31 Mar 2014 | 250 | 5010 | 31 Mar 2014 | =AlignToAxes(A2:D10,F3:G7,H2:I2,‘none‘,‘C1,C3‘,‘C2‘,‘C4‘) | ||
5010 | YLG | 30 Jun 2014 | 300 | 5010 | 30 Jun 2014 | |||
5010 | CFH | 31 Mar 2014 | 125 | 5030 | 31 Mar 2014 | |||
5010 | CFH | 30 Jun 2014 | 325 | 5030 | 30 Jun 2014 | |||
5030 | YLG | 31 Mar 2014 | 100 | |||||
5030 | YLG | 30 Jun 2014 | 240 | |||||
5030 | CFH | 31 Mar 2014 | 200 | |||||
5030 | CFH | 30 Jun 2014 | 90 |
Range | Output | |||||||
Portfolio | Asset | Date | Income | YLG | CFH | |||
5010 | YLG | 31 Mar 2014 | 250 | 5010 | 31 Mar 2014 | 250 | 125 | |
5010 | YLG | 30 Jun 2014 | 300 | 5010 | 30 Jun 2014 | 300 | 325 | |
5010 | CFH | 31 Mar 2014 | 125 | 5030 | 31 Mar 2014 | 100 | 200 | |
5010 | CFH | 30 Jun 2014 | 325 | 5030 | 30 Jun 2014 | 240 | 90 | |
5030 | YLG | 31 Mar 2014 | 100 | |||||
5030 | YLG | 30 Jun 2014 | 240 | |||||
5030 | CFH | 31 Mar 2014 | 200 | |||||
5030 | CFH | 30 Jun 2014 | 90 |
Example 3. Rearrange the source data into flexible output formats
An additional advantage of this function is that spaces can be created between the rows and columns in the target output block. Those spaces can contain formatting, values and formulas, and the matching process can be instructed to disregard those spaces. In the example below, rows have been created in the output to create totals.
Note: In this example, the output overwrites (cleans up) anything within the contiguous output block. Sometimes this is desirable, but in this case, the totals need to be retained. In this example the second row of totals is not overwritten, as it falls outside of the contiguous output block, but the first row of totals is overwritten. To prevent information and formulas from being overwritten, see Example 4.
Range | Align to axes | |||||||
Portfolio | Asset | Date | Income | YLG | CFH | |||
5010 | YLG | 31 Mar 2014 | 250 | 5010 | 31 Mar 2014 | =AlignToAxes(A2:D10,F3:G7,H2:I2,‘none‘,‘C1,C3‘,‘C2‘,‘C4‘) | ||
5010 | YLG | 30 Jun 2014 | 300 | 5010 | 30 Jun 2014 | |||
5010 | CFH | 31 Mar 2014 | 125 | TOTAL | =SUM(H3:H4) | =SUM(I3:I4) | ||
5010 | CFH | 30 Jun 2014 | 325 | 5030 | 31 Mar 2014 | |||
5030 | YLG | 31 Mar 2014 | 100 | 5030 | 30 Jun 2014 | |||
5030 | YLG | 30 Jun 2014 | 240 | TOTAL | =SUM(H6:H7) | =SUM(I6:I7) | ||
5030 | CFH | 31 Mar 2014 | 200 | |||||
5030 | CFH | 30 Jun 2014 | 90 |
Range | Output | |||||||
Portfolio | Asset | Date | Income | YLG | CFH | |||
5010 | YLG | 31 Mar 2014 | 250 | 5010 | 31 Mar 2014 | 250 | 125 | |
5010 | YLG | 30 Jun 2014 | 300 | 5010 | 30 Jun 2014 | 300 | 325 | |
5010 | CFH | 31 Mar 2014 | 125 | TOTAL | ||||
5010 | CFH | 30 Jun 2014 | 325 | 5030 | 31 Mar 2014 | 100 | 200 | |
5030 | YLG | 31 Mar 2014 | 100 | 5030 | 30 Jun 2014 | 240 | 90 | |
5030 | YLG | 30 Jun 2014 | 240 | TOTAL | 340 | 290 | ||
5030 | CFH | 31 Mar 2014 | 200 | |||||
5030 | CFH | 30 Jun 2014 | 90 |
Example 4. Rearrange the source data into flexible output formats, but retain any information that already exists in the unmatched blocks
This example is identical to example 3 above, but the Fx() function is used to prevent any internal unmatched data from being overwritten. The AlignToAxes() function is placed inside the Fx() function, and Fx is provided with an additional parameter ‘TRUE’ which instructs it to retain internal unmatched information within the output block. Therefore the first row of totals is not overwritten.
Range | Align to axes | |||||||
Portfolio | Asset | Date | Income | YLG | CFH | |||
5010 | YLG | 31 Mar 2014 | 250 | 5010 | 31 Mar 2014 | =Fx(AlignToAxes(A2:D10,F3:G7, H2:I2,‘none‘,‘C1,C3‘,‘C2‘,‘C4‘),TRUE) | ||
5010 | YLG | 30 Jun 2014 | 300 | 5010 | 30 Jun 2014 | |||
5010 | CFH | 31 Mar 2014 | 125 | TOTAL | =SUM(H3:H4) | =SUM(I3:I4) | ||
5010 | CFH | 30 Jun 2014 | 325 | 5030 | 31 Mar 2014 | |||
5030 | YLG | 31 Mar 2014 | 100 | 5030 | 30 Jun 2014 | |||
5030 | YLG | 30 Jun 2014 | 240 | TOTAL | =SUM(H6:H7) | =SUM(I6:I7) | ||
5030 | CFH | 31 Mar 2014 | 200 | |||||
5030 | CFH | 30 Jun 2014 | 90 |
Range | Output | |||||||
Portfolio | Asset | Date | Income | YLG | CFH | |||
5010 | YLG | 31 Mar 2014 | 250 | 5010 | 31 Mar 2014 | 250 | 125 | |
5010 | YLG | 30 Jun 2014 | 300 | 5010 | 30 Jun 2014 | 300 | 325 | |
5010 | CFH | 31 Mar 2014 | 125 | TOTAL | 550 | 450 | ||
5010 | CFH | 30 Jun 2014 | 325 | 5030 | 31 Mar 2014 | 100 | 200 | |
5030 | YLG | 31 Mar 2014 | 100 | 5030 | 30 Jun 2014 | 240 | 90 | |
5030 | YLG | 30 Jun 2014 | 240 | TOTAL | 340 | 290 | ||
5030 | CFH | 31 Mar 2014 | 200 | |||||
5030 | CFH | 30 Jun 2014 | 90 |