Navigation :
test ../ test user-ref.html
User & Reference Guide
test ../ test getting-started.html
Getting started
test ../ test getting-started/about.html
- Using this guide
test ../ test getting-started/whats-new.html
- What's New
test ../ test getting-started/data-model.html
- Market Risk Data Model
test ../ test getting-started/direct-query.html
- DirectQuery
test ../ test dashboards.html
Dashboards
test ../ test calculations.html
Calculations Guide
test ../ test configuration.html
Configuration files
test ../ test cube.html
Cube Reference
test ../ test datastore.html
Datastores
test ../ test input-files.html
Input file formats
test ../ test what-if.html
What-If Analysis
test ../ test database.html
Database
test ../ test database/global.html
-
Global Database Definition
test ../ test database/book_hierarchy.html
-- BOOK_HIERARCHY
test ../ test database/book_parent_child.html
-- BOOK_PARENT_CHILD
test ../ test database/counterparties.html
-- COUNTERPARTIES
test ../ test database/counterparty_hierarchy.html
-- COUNTERPARTY_HIERARCHY
test ../ test database/counterparty_parent_child.html
-- COUNTERPARTY_PARENT_CHILD
test ../ test database/countries.html
-- COUNTRIES
test ../ test database/fxrates.html
-- FXRATES
test ../ test database/legal_entity_hierarchy.html
-- LEGAL_ENTITY_HIERARCHY
test ../ test database/legal_entity_parent_child.html
-- LEGAL_ENTITY_PARENT_CHILD
test ../ test database/market_data_sets.html
-- MARKET_DATA_SETS
test ../ test database/market_shifts.html
-- MARKET_SHIFTS
test ../ test database/market_shifts_vector.html
-- MARKET_SHIFTS_VECTOR
test ../ test database/quantiles.html
-- QUANTILES
test ../ test database/risk_factors_catalogue.html
-- RISK_FACTORS_CATALOGUE
test ../ test database/rounding_methods.html
-- ROUNDING_METHODS
test ../ test database/scenarios.html
-- SCENARIOS
test ../ test database/sign_off_digest_store.html
-- SIGN_OFF_DIGEST_STORE
test ../ test database/trade_attributes.html
-- TRADE_ATTRIBUTES
test ../ test database/pnl-database.html
-
PnL Database Definition
test ../ test database/sensitivities.html
-
Sensitivities Database Definition
test ../ test database/vares.html
-
VaR-ES Database Definition
test ../ test sign-off.html
Sign-Off Approvals
test ../ test limits.html
Limit monitoring
test ../ test dev.html
Developer Guide
test ../ test dev/dev-release.html
-
Release and migration notes
test ../ test dev/dev-getting-started.html
-
Getting Started
test ../ test dev/dev-ui-config.html
-
Configuring the UI
test ../ test dev/dev-mr-application.html
-
The Market Risk Application
test ../ test dev/dev-libraries.html
-
Market Risk Libraries
test ../ test dev/dev-extensions.html
-
Extending Atoti Market Risk
test ../ test dev/dev-tools.html
-
Configuring tools and methodologies
test ../ test dev/dev-sign-off.html
-
Sign-Off
test ../ test dev/dev-whatif.html
-
What-If
test ../ test dev/dev-direct-query.html
-
DirectQuery
test ../ test pdf-guides.html
PDF Guides
COUNTERPARTY_PARENT_CHILD
The COUNTERPARTY_PARENT_CHILD table contains the parent/child relationships used to build the counterparty hierarchy.
Column Name
Type
Not Null
Cube Field
Default Value
Description
AS_OF_DATE
DATE
Y
Timestamp (at close of business) for the data.
CHILD
STRING
Y
Identifier of the node in the Counterparty hierarchy.
PARENT
STRING
Identifier of the parent node (or null if there is no parent).
Unique Key
Joins
There is a self-join on the COUNTERPARTY_PARENT_CHILD table - see database creation script for details.
Table creation script
Snowflake
Table creation
create OR REPLACE table COUNTERPARTY_PARENT_CHILD(
AS_OF_DATE DATE NOT NULL,
CHILD STRING,
PARENT STRING,
primary key (AS_OF_DATE, CHILD)
);
The content of this table is used to populate the COUNTERPARTY_HIERARCHY table; see the script
here .
Table population from files (optional)
If you want to populate the table from CSV files, you can run the following scripts (this example assumes that you want to load the
files CounterpartyParentChild.csv present in the folders 2023-09-25, 2023-09-26, 2023-09-27 and 2023-09-28):
create OR REPLACE stage MR_INPUT_RAW;
create OR REPLACE file format CSV_GZIP
TYPE = CSV
COMPRESSION = GZIP
SKIP_HEADER = 1
comment = 'File format to import MR data';
create OR REPLACE file format CSV_FORMAT
TYPE = CSV
COMPRESSION = AUTO
SKIP_HEADER = 1
comment = 'File format to import MR data';
PUT file://<full path to you data folder>/2023-09-26/CounterpartyParentChild.csv @MR_INPUT_RAW/2023-09-26;
PUT file://<full path to you data folder>/2023-09-27/CounterpartyParentChild.csv @MR_INPUT_RAW/2023-09-27;
PUT file://<full path to you data folder>/2023-09-28/CounterpartyParentChild.csv @MR_INPUT_RAW/2023-09-28;
copy into COUNTERPARTY_PARENT_CHILD from @MR_INPUT_RAW pattern='./CounterpartyParentChild. .csv.gz' FILE_FORMAT = CSV_GZIP;