From 6a90cc4b32ab3a26f6fc29f200fd62f6b9ff168f Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Thu, 26 Oct 2017 14:31:37 -0400 Subject: [PATCH] add maps --- map_rm_template.pgsql | 91 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 90 insertions(+), 1 deletion(-) diff --git a/map_rm_template.pgsql b/map_rm_template.pgsql index a15bf58..631bc57 100644 --- a/map_rm_template.pgsql +++ b/map_rm_template.pgsql @@ -30,7 +30,7 @@ FROM $j$::jsonb , 1) ) x; -*/ + DELETE FROM tps.map_rm where target = 'Parse Descr'; INSERT INTO tps.map_rm @@ -60,4 +60,93 @@ FROM } $j$::jsonb , 2) +) x; + + +DELETE FROM tps.map_rm where target = 'Extract OBI'; +INSERT INTO +tps.map_rm +SELECT * +FROM +(VALUES + ('PNCC', 'Extract OBI', + $j$ + { + "name":"Extract OBI", + "description":"pull out whatever follows OBI in the description until atleast 3 capital letters followed by a colon are encountered", + "defn": [ + { + "key": "{Description}", + "field": "obi", + "regex": "OBI:(.*?)(?=[A-Z]{3,}?:|$)", + "flag":"", + "retain":"y" + } + ], + "function":"extract", + "map":"no", + "where": [ + { + "Transaction":"Money Transfer DB - Wire" + }, + { + "Transaction":"Money Transfer CR-Other" + }, + { + "Transaction":"Intl Money Transfer Debits" + }, + { + "Transaction":"Money Transfer DB - Other" + }, + { + "Transaction":"Money Transfer CR-Wire" + } + ] + } + $j$::jsonb + , 2) +) x; +*/ +DELETE FROM tps.map_rm where target = 'Extract RFB'; +INSERT INTO +tps.map_rm +SELECT * +FROM +(VALUES + ('PNCC', 'Extract RFB', + $j$ + { + "name":"Extract RFB", + "description":"pull out whatever follows RFB in the description until atleast 3 capital letters followed by a colon are encountered", + "defn": [ + { + "key": "{Description}", + "field": "rfb", + "regex": "RFB:(.*?)(?=[A-Z]{3,}?:|$)", + "flag":"", + "retain":"y" + } + ], + "function":"extract", + "map":"no", + "where": [ + { + "Transaction":"Money Transfer DB - Wire" + }, + { + "Transaction":"Money Transfer CR-Other" + }, + { + "Transaction":"Intl Money Transfer Debits" + }, + { + "Transaction":"Money Transfer DB - Other" + }, + { + "Transaction":"Money Transfer CR-Wire" + } + ] + } + $j$::jsonb + , 2) ) x; \ No newline at end of file