SCENARIOS

The SCENARIOS table contains the VaR and ES scenario descriptions.

Column Name Type Not Null Cube Field Default Value1 Description
AS_OF_DATE DATE Y Indicates the date of the file.
INDEX INT Y 0 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.
SCENARIO STRING Y [Risk].[Scenario Sets] N/A Non technical name for rounding method.
SCENARIO_SET STRING Y [Risk].[Scenarios] N/A 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;


  1. 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.  ↩︎