SENSI_LADDERS
The SENSI_LADDERS table contains the definition of sensitivity ladder shifts. The ladder shift vectors are present in the SENSI_LADDERS_VECTOR table.
Column Name | Type | Not Null | Cube Field | Default Value1 | Description |
---|---|---|---|---|---|
AS_OF_DATE | DATE | Y | Timestamp (at close of business) for the data. | ||
RISK_CLASS | STRING | Y | N/A | The risk class for which the ladder scale is defined. | |
SHIFT_TYPE | STRING | Y | R | The type of the scale (‘A’ for absolute, ‘R’ for relative). |
Unique Key
Columns |
---|
AS_OF_DATE |
RISK_CLASS |
Incoming Joins
Source Table | Source Columns | Target Columns |
---|---|---|
SENSI_LADDERS_VECTOR | AS_OF_DATE RISK_CLASS |
AS_OF_DATE RISK_CLASS |
Table creation script
Snowflake
Table creation
create OR REPLACE table SENSI_LADDERS(
AS_OF_DATE DATE NOT NULL,
RISK_CLASS STRING NOT NULL DEFAULT 'N/A',
SHIFT_TYPE STRING NOT NULL DEFAULT 'R',
PRIMARY KEY(AS_OF_DATE,RISK_CLASS)
);
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 LadderDefinition.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/LadderDefinition.csv' @MR_INPUT_RAW/2023-09-26;
PUT 'file://<full path to you data folder>/2023-09-27/LadderDefinition.csv' @MR_INPUT_RAW/2023-09-27;
PUT 'file://<full path to you data folder>/2023-09-28/LadderDefinition.csv' @MR_INPUT_RAW/2023-09-28;
copy into SENSI_LADDERS from (
select
$1 as AS_OF_DATE,
ifnull($2, 'N/A') as TENOR_LABELS,
ifnull($3, 'R') as SHIFT_TYPE
from @MR_INPUT_RAW (pattern => '^.LadderDefinition..csv$' , FILE_FORMAT => 'CSV_FORMAT')
);
-
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. ↩︎