Functions Data

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).
ValueThe 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

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")
StockEntity12025-09-08NameStEnt1
StockEntity12025-09-09NameStEnt1
StockEntity12025-09-08Price100
StockEntity12025-09-09Price101
StockEntity22025-09-08NameStEnt2
StockEntity22025-09-09NameStEnt2
StockEntity22025-09-08Price200
StockEntity22025-09-09Price201

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-082025-09-082025-09-092025-09-09
NamePriceNamePrice
StockEntity1StEnt1100StEnt1101
StockEntity2StEnt2200StEnt2201