aboutsummaryrefslogtreecommitdiffstats
path: root/sql/dawn.sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql/dawn.sql')
-rw-r--r--sql/dawn.sql2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/dawn.sql b/sql/dawn.sql
index 4986c349..9c462284 100644
--- a/sql/dawn.sql
+++ b/sql/dawn.sql
@@ -2965,7 +2965,7 @@ SELECT cds.fund, account_code AS fcm, cds.security_id, max(security_desc) AS sec
SUM(cds.notional * (CASE WHEN protection='Buyer' THEN 1 ELSE -1 END)) AS notional FROM cds
WHERE swap_type='CD_INDEX' AND trade_date<=start_from AND maturity > start_from
GROUP BY cds.security_id, maturity, cds.folder, cds.fund, account_code) a
-LEFT JOIN portfolio_folder_mapping pfm ON a.folder::text=pfm.clean_folder
+LEFT JOIN portfolio_folder_mapping pfm ON replace(a.folder::text, 'SER_', '')=pfm.clean_folder
LEFT JOIN index_maturity_markit imm ON (a.SECURITY_id, a.maturity) = (imm.redindexcode, imm.maturity) WHERE active AND a.notional !=0;
end;
$function$