The pointer to the Scenario’s position in the PnL[] vector. Values range from 0 to the total number of scenarios in the given scenario set. Note: The index must start at 0 for each ScenarioSet.
The name of the scenario for that Index. For historical scenarios, this could be the date. For stress simulations, it could be the name of the particular event.
Unique Key
Columns
AS_OF_DATE
INDEX
SCENARIO
SCENARIO_SET
Table creation script
Snowflake
Table creation
create OR REPLACE table SCENARIOS(
AS_OF_DATE DATE NOT NULL,
SCENARIO_SET STRING NOT NULL DEFAULT 'N/A',
INDEX INT NOT NULL DEFAULT 0,
SCENARIO STRING NOT NULL DEFAULT 'N/A',
primary key (AS_OF_DATE, SCENARIO_SET, SCENARIO)
);
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 Scenarios.csv present in the folders 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/Scenarios.csv @MR_INPUT_RAW/2023-09-26;
PUT file://<full path to you data folder>/2023-09-27/Scenarios.csv @MR_INPUT_RAW/2023-09-27;
PUT file://<full path to you data folder>/2023-09-28/Scenarios.csv @MR_INPUT_RAW/2023-09-28;
copy into SCENARIOS from @MR_INPUT_RAW pattern='./Scenarios..csv.gz' FILE_FORMAT = CSV_GZIP;
If the default value is marked as empty, it means that the default value is 'null' for nullable fields, and that a value needs to be explicitly set for non-nullable fields.
↩︎