UpdateTimeSeries
The UpdateTimeSeries() function updates TimeSeries data in the Quintessence database.
Related functions: TimeSeries
Syntax:
Qx.UpdateTimeSeries(Data, Entity, Factor, Unit, Period, [IAAD], Attributes, Source, Options, [ShowError])- In Excel with Quintessence add-in versions prior to 25.1, use:
UpdateTimeSeries() - In the Quintessence Editor (Studio) using Quintessence language, use:
UpdateTimeSeries() - In the Quintessence Editor (Studio) using Python language, use:
Qx.UpdateTimeSeries()
ⓘ See parameter descriptions
| Data | The range containing the new values to upload. |
| Entity | An entity in the Quintessence database is any element with associated data that is identified by a code, such as an instrument, portfolio, country, or manager. |
| Factor | The type of TimeSeries values requested. |
| Unit | The code of the unit type associated with the TimeSeries. |
| Period | The period related to the values under consideration. Possible values: • NA – Not Applicable• D – Day• W – Week• M – Month• B – Bi-Monthly• Q – Quarter• S – Semi-Annual• Y – Year |
| IAAD (optional) | The as at date specifies the point in time for the information. Any data declared after the IAAD is ignored. |
| Attributes | The attribute(s) of the values under consideration. |
| Source | The source provider of the data. |
| Options | Sets the insertion strategy. Valid value: • OnChangeMay also be combined with: • SnapshotExample: OnChange, Snapshot |
| ShowError (optional) | If TRUE, an error message is displayed when the function fails. |
Remarks:
- Unless changed by an administrator, the default parameter is:
- IAAD: today
- This function is executed by clicking Execute Selected or Execute Sheet in the Quintessence ribbon.
Examples:
The examples provided below are based on fictitious data for illustrative purposes only.
> Example 1: Adding a new TimeSeries value
Initial data:
| Entity | Factor | Unit | Period | Attributes | Source | Value date | Declaration date | Value |
| XDU | Close Price | ZAR | D | Final | Source1 | 2015/02/01 | 2015/02/02 | 100 |
| XDU | Close Price | ZAR | D | Final | Source1 | 2015/02/02 | 2015/02/03 | 149 |
A new value is declared:
- Value date: 3 Feb 2015
- Declaration date: 4 Feb 2015
- Value: 124
Data (A1:B1):
| 3-Feb-15 | 124 |
Formula:
=Qx.UpdateTimeSeries(A1:B1, "XDU", "Close Price", "ZAR", "D", "2015-02-04", "Final", "Source1", "OnChange", TRUE)Result:
| Entity | Factor | Unit | Period | Attributes | Source | Value date | Declaration date | Value |
| XDU | Close Price | ZAR | D | Final | Source1 | 2015/02/01 | 2015/02/02 | 100 |
| XDU | Close Price | ZAR | D | Final | Source1 | 2015/02/02 | 2015/02/03 | 149 |
| XDU | Close Price | ZAR | D | Final | Source1 | 2015/02/03 | 2015/02/04 | 124 |
> Example 2: Updating an existing TimeSeries value
Initial data:
| Entity | Factor | Unit | Period | Attributes | Source | Value date | Declaration date | Value |
| XDU | Close Price | ZAR | D | Final | Source1 | 2015/02/01 | 2015/02/02 | 100 |
| XDU | Close Price | ZAR | D | Final | Source1 | 2015/02/02 | 2015/02/03 | 149 |
| XDU | Close Price | ZAR | D | Final | Source1 | 2015/02/03 | 2015/02/04 | 124 |
An updated value is declared:
- Value date: 2 Feb 2015
- Declaration date: 4 Feb 2015
- Value: 150
Data (A1:B1):
| 2-Feb-15 | 150 |
Formula:
=Qx.UpdateTimeSeries(A1:B1, "XDU", "Close Price", "ZAR", "D", "2015-02-04", "Final", "Source1", "OnChange", TRUE)Result:
| Entity | Factor | Unit | Period | Attributes | Source | Value date | Declaration date | Value |
| XDU | Close Price | ZAR | D | Final | Source1 | 2015/02/01 | 2015/02/02 | 100 |
| XDU | Close Price | ZAR | D | Final | Source1 | 2015/02/02 | 2015/02/04 | 150 |
| XDU | Close Price | ZAR | D | Final | Source1 | 2015/02/03 | 2015/02/04 | 124 |
> Example 3: Updating Snapshot TimeSeries values
Initial data:
| Entity | Factor | Unit | Period | Attributes | Source | Value date | Declaration date | Value |
| XDU | Close Price | ZAR | D | Forecast | Source1 | 2025/02/02 | 2015/02/04 | 150 |
| XDU | Close Price | ZAR | D | Forecast | Source1 | 2026/02/02 | 2015/02/04 | 151 |
| XDU | Close Price | ZAR | D | Forecast | Source1 | 2027/02/02 | 2015/02/04 | 149 |
An updated value is declared:
- Value date: 2 Feb 2026
- Declaration date: 4 Feb 2015
- Value: 148
Data (A1:B3):
| 2-Feb-25 | 150 |
| 2-Feb-26 | 148 |
| 2-Feb-27 | 149 |
Formula:
=Qx.UpdateTimeSeries(A1:B3, "XDU", "Close Price", "ZAR", "D", "2015-02-04", "Forecast", "Source1", "OnChange, Snapshot", TRUE)Result:
| Entity | Factor | Unit | Period | Attributes | Source | Value date | Declaration date | Value |
| XDU | Close Price | ZAR | D | Forecast | Source1 | 2025/02/02 | 2015/02/04 | 150 |
| XDU | Close Price | ZAR | D | Forecast | Source1 | 2026/02/02 | 2015/02/04 | 148 |
| XDU | Close Price | ZAR | D | Forecast | Source1 | 2027/02/02 | 2015/02/04 | 149 |
