UpdateCodes
The UpdateCodes() function updates the codes for specified entities and code types in the Quintessence database.
- If the specified code type already exists for the entity, its code is updated.
- If the code type does not exist for the entity, the code type and code are added.
- If multiple codes exist for the same code type, the default code in the database is updated.
Related functions: UpdateRelationship, UpdateRelationshipData, UpdateTimeseries, UpdateTradingDays
Syntax:
Qx.UpdateCodes(Entities, Code Types, Codes, [ShowError])- In Excel with Quintessence add-in versions prior to 25.1, use:
UpdateCodes()
ⓘ See parameter descriptions
| Entities | The entities to update. |
| Code Types | The code types to update. |
| Codes | The replacement codes. |
| ShowError (optional) | If set to TRUE, an error message will be displayed if the function fails. |
Remarks:
- Unless changed by the administrator, default parameter values are:
- ShowError:
TRUE
- ShowError:
Examples:
The examples provided below are based on fictitious data for illustrative purposes only.
> Example 1: Add a new entity code and code type to an existing entity
Current data in the database:
| Entity | Code | Code Type | Default |
| VRR | VRR | StockExchange1 Alpha Code | Y |
A new entity code,100U, with code type TradableInstrument1 must be added to the existing entity VRR.
Formula:
=Qx.UpdateCodes("VRR", "TradableInstrument1", "100U", TRUE)After clicking Upload Selected or Upload Sheet, the database will contain:
| Entity | Code | Code Type | Default |
| VRR | VRR | StockExchange1 Alpha Code | Y |
| 100U | TradableInstrument1 | Y |
> Example 2: Update an existing code and code type
Current data in the database:
| Entity | Code | Code Type | Default |
| VRR | VRR | StockExchange1 Alpha Code | Y |
| 100U | TradableInstrument1 | Y | |
| 100U_1 | TradableInstrument1 | N |
The default code for TradableInstrument1 on entity VRR must be updated to 100U_0.
Formula:
=Qx.UpdateCodes("VRR", "TradableInstrument1", "100U_0", TRUE)After clicking Upload Selected or Upload Sheet, the database will contain:
| Entity | Code | Code Type | Default |
| VRR | VRR | StockExchange1 Alpha Code | Y |
| 100U_0 | TradableInstrument1 | Y | |
| 100U_1 | TradableInstrument1 | N |
