PivotView
PivotView()
is one of the view options for displaying data retrieved from the RelationshipData() and TimeSeries() functions. This view organises the requested data into rows and columns, with values shown at their intersections.
Syntax:
PivotView({Row(s)}, {Column(s)}, Value):Headers
ⓘ See parameter descriptions
Row(s) | Define how data is grouped vertically using {} . Each row represents a unique value (or combination of values). |
Column(s) | Define how data is grouped horizontally using {} . Each column represents a unique value (or combination of values). |
Value | The data shown at the intersection of a row and a column. |
Headers (optional) | Parameter use to display headers. Options are none , row , column or both . |
Remarks:
- Unless changed by an administrator, the default parameters are:
- Headers:
both
- Headers:
Examples:
The examples provided below are based on fictitious data for illustrative purposes only.
> Example 1: Displays the requested TimeSeries data in a pivoted view.
Data is requested using DataView() as the View parameter.
=Qx.TimeSeries("StockEntity1, StockEntity2", "Name, Price", "2025-09-08", "2025-09-09", "D", "Forward:Forward", "DataView(Entity, Valuedate, Factor, Value)", "na", "NA", "2025-09-10", "StockExchange1", "na")
StockEntity1 | 2025-09-08 | Name | StEnt1 |
StockEntity1 | 2025-09-09 | Name | StEnt1 |
StockEntity1 | 2025-09-08 | Price | 100 |
StockEntity1 | 2025-09-09 | Price | 101 |
StockEntity2 | 2025-09-08 | Name | StEnt2 |
StockEntity2 | 2025-09-09 | Name | StEnt2 |
StockEntity2 | 2025-09-08 | Price | 200 |
StockEntity2 | 2025-09-09 | Price | 201 |
We can request the same data using PivotView()
, with rows representing Entities and columns representing Factor and ValueDate.
=Qx.TimeSeries("StockEntity1, StockEntity2", "Name, Price", "2025-09-08", "2025-09-09", "D", "Forward:Forward", "PivotView({Entity}, {ValueDate, Factor}, Value)", "na", "NA", "2025-09-10", "StockExchange1", "na")
2025-09-08 | 2025-09-08 | 2025-09-09 | 2025-09-09 | |
Name | Price | Name | Price | |
StockEntity1 | StEnt1 | 100 | StEnt1 | 101 |
StockEntity2 | StEnt2 | 200 | StEnt2 | 201 |