diff options
Diffstat (limited to 'sql')
| -rw-r--r-- | sql/dawn.sql | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/dawn.sql b/sql/dawn.sql index 6f256c54..1fdfdb1f 100644 --- a/sql/dawn.sql +++ b/sql/dawn.sql @@ -1199,7 +1199,7 @@ $$ LANGUAGE plpgsql; CREATE OR REPLACE VIEW bowdst_index AS SELECT as_of_date, p_index, p_series, maturity, admin_notional, admin_clean_nav FROM ( -SELECT as_of_date, substring(security_description_1 FROM '(IG|HY|EU|XO)')::index_type AS p_index, +SELECT as_of_date, substring(security_description_1 FROM '(IG|HY|EU|XO)(?:R|VER)?(?:\.| )(?:[0-9]{2})')::index_type AS p_index, substring(security_description_1 FROM '(?:IG|HY|EUR|XOVER)(?:\.| )([0-9]{2})')::smallint as p_series, maturity_date AS maturity, (CASE WHEN coupon_rate=0 THEN current_notional ELSE -current_notional END) AS admin_notional, @@ -1208,7 +1208,7 @@ SELECT as_of_date, substring(security_description_1 FROM '(IG|HY|EU|XO)')::index FROM bowdst_val WHERE security_description_1 LIKE '%CCP%' WINDOW w AS (PARTITION BY as_of_date, - substring(security_description_1 FROM '(IG|HY|EU|XO)')::index_type, + substring(security_description_1 FROM '(IG|HY|EU|XO)(?:R|VER)?(?:\.| )(?:[0-9]{2})')::index_type, substring(security_description_1 FROM '(?:IG|HY|EUR|XOVER)(?:\.| )([0-9]{2})')::smallint, maturity_date) ) AS ss WHERE row_number=1; |
