DataView
When using data functions that return data from the Quintessence database, the results can be displayed in various ways using the ‘View’ parameter.
Syntax
The format for the View parameter value is: DataView(Columns[]):Headings
Columns[] specifies which columns to display by column name, separated by commas. ‘*’ displays all columns. Headings determines whether to display headings or not.
Possible values for Headings:
both | Display both row and column headings |
none | Display no headings |
column | Display column headings |
row | Display row headings |
Examples
Example 2. Default columns, with column headings
Example 3. All columns, with column headings
Example 4. Specific columns, with headings
Example 5. Request specific code types
Example 1. Default columns
When DataView() is used with no additional instructions, a default set of columns is returned (ValueDate, Entity, Factor, Value).
Retrieve the MarketCap values for instrument VWE |
=TimeSeries(“VWE”,”MarketCap”,”1 Oct 2012″,”3 Oct 2012″,”D”,,”DataView()”,,,,”MarketDataProvider1″) |
Output | |||
2012/10/01 | VWE | MarketCap | 359853.254 |
2012/10/02 | VWE | MarketCap | 356550.43 |
2012/10/03 | VWE | MarketCap | 346923.048 |
Example 2. Default columns, with column headings
In Example 1 above, it is not clear which columns have been returned. To display the column headings, append ‘:column’ to DataView(), in other words DataView():column.
Retrieve the MarketCap values for instrument VWE |
=TimeSeries(“VWE”,”MarketCap”,”1 Oct 2012″,”3 Oct 2012″,”D”,,”DataView():column”,,,,”MarketDataProvider1″) |
Output | |||
ValueDate | Entity | Factor | Value |
2012/10/01 | VWE | MarketCap | 359853.254 |
2012/10/02 | VWE | MarketCap | 356550.43 |
2012/10/03 | VWE | MarketCap | 346923.048 |
Example 3. All columns, with column headings
It is useful to request all columns to see what information is available, and then, if necessary, filter the output to specific columns as required. To request all columns, use ‘*’ – DataView(*). To show column headings, use DataView(*):column.
Retrieve the MarketCap values for instrument VWE |
=TimeSeries(“VWE”,”MarketCap”,”1 Oct 2012″,”3 Oct 2012″,”D”,,”DataView(*):column”,,,,”MarketDataProvider1″) |
Output | ||||||||
Entity | Factor | Unit | Period | Attributes | Source | ValueDate | DeclarationDate | Value.Value |
VWE | MarketCap | ZAR | D | Historical | MarketDataProvider1 | 2012/10/01 | 2012/10/01 | 359853.254 |
VWE | MarketCap | ZAR | D | Historical | MarketDataProvider1 | 2012/10/02 | 2012/10/02 | 356550.43 |
VWE | MarketCap | ZAR | D | Historical | MarketDataProvider1 | 2012/10/03 | 2012/10/03 | 346923.048 |
Example 4. Specific columns, with headings
After viewing all columns using DataView(*) to see which columns are returned and what their headings are, it may be useful to only display specific columns, in a specific order. To do so, specify the columns by name, separated by commas, for example, DataView(Entity, ValueDate, Value, Source):column.
Retrieve the MarketCap values for instrument VWE |
=TimeSeries(“VWE”,”MarketCap”,”1 Oct 2012″,”3 Oct 2012″,”D”,,”DataView(Entity, ValueDate, Value, Source):column”,,,,”MarketDataProvider1″) |
Output | |||
Entity | ValueDate | Value | Source |
VWE | 2012/10/01 | 359853.254 | MarketDataProvider1 |
VWE | 2012/10/02 | 356550.43 | MarketDataProvider1 |
VWE | 2012/10/03 | 346923.048 | MarketDataProvider1 |
Example 5. Request specific code types
When requesting specific columns, it is possible to request that specific code types are returned. Specific code types can be requested for all or any of Entity, Unit, Factor, Parent, Child and Relationship. To request a specific code, append “:codetype” to the column name.
In this example, values are requested for portfolio ‘HIJ891’. The FinancialGroup1 Code is requested for that entity – ‘Entity:FinancialGroup1 Code’, which is returned as ‘PSPSPS’:
Retrieve the Total Return values for Portfolio ‘HIJ891’ |
=TimeSeries(“HIJ891″,”Total Return”,”1 Oct 2015″,”10 Oct 2015″,”D”,,”DataView(Entity:FinancialGroup1 Code, Unit, Factor ,ValueDate,Value, Source):column”,,,,”PortfolioAdministrator1″,”NA”) |
Output | |||||
Entity | Unit | Factor | ValueDate | Value | Source |
PSPSPS | ZAR | Total Return | 2015/10/01 | 0.00903 | PortfolioAdministrator1 |
PSPSPS | ZAR | Total Return | 2015/10/02 | 0.009336 | PortfolioAdministrator1 |
PSPSPS | ZAR | Total Return | 2015/10/03 | 0.000001 | PortfolioAdministrator1 |
PSPSPS | ZAR | Total Return | 2015/10/04 | 0.000001 | PortfolioAdministrator1 |
PSPSPS | ZAR | Total Return | 2015/10/05 | 0.023467 | PortfolioAdministrator1 |
PSPSPS | ZAR | Total Return | 2015/10/06 | 0.000479 | PortfolioAdministrator1 |
PSPSPS | ZAR | Total Return | 2015/10/07 | 0.006283 | PortfolioAdministrator1 |
PSPSPS | ZAR | Total Return | 2015/10/08 | -0.000027 | PortfolioAdministrator1 |
PSPSPS | ZAR | Total Return | 2015/10/09 | 0.008033 | PortfolioAdministrator1 |
PSPSPS | ZAR | Total Return | 2015/10/10 | 0.000001 | PortfolioAdministrator1 |