Skip to content

Commit 3d2bca0

Browse files
committed
removed mid space removal on postcode
1 parent da2b132 commit 3d2bca0

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

deployment_extracts/systemc/live/ssd_deployment_individual_files/systemc_sqlserver_v1.3.5_1_20251110.sql

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,10 +1056,12 @@ SELECT
10561056
pa.START_DTTM,
10571057
pa.END_DTTM,
10581058
CASE
1059-
-- Some clean-up based on known data
1060-
WHEN REPLACE(pa.POSTCODE, ' ', '') = REPLICATE('X', LEN(REPLACE(pa.POSTCODE, ' ', ''))) THEN '' -- clear pcode of containing all X's
1061-
WHEN LOWER(REPLACE(pa.POSTCODE, ' ', '')) = 'nopostcode' THEN '' -- clear pcode of containing nopostcode
1062-
ELSE REPLACE(pa.POSTCODE, ' ', '') -- remove all spaces for consistency
1059+
WHEN REPLACE(pa.POSTCODE, ' ', '') = REPLICATE('X', LEN(REPLACE(pa.POSTCODE, ' ', '')))
1060+
THEN '' -- clear postcode containing all X's
1061+
WHEN LOWER(REPLACE(pa.POSTCODE, ' ', '')) = 'nopostcode'
1062+
THEN '' -- clear 'nopostcode' strs
1063+
ELSE
1064+
LTRIM(RTRIM(pa.POSTCODE)) -- keep internal space(s)
10631065
END AS CleanedPostcode,
10641066
(
10651067
'{' +
@@ -1096,10 +1098,12 @@ WHERE pa.DIM_PERSON_ID <> -1
10961098
-- pa.START_DTTM,
10971099
-- pa.END_DTTM,
10981100
-- CASE
1099-
-- -- Some clean-up based on known data
1100-
-- WHEN REPLACE(pa.POSTCODE, ' ', '') = REPLICATE('X', LEN(REPLACE(pa.POSTCODE, ' ', ''))) THEN '' -- clear pcode of containing all X's
1101-
-- WHEN LOWER(REPLACE(pa.POSTCODE, ' ', '')) = 'nopostcode' THEN '' -- clear pcode of containing nopostcode
1102-
-- ELSE REPLACE(pa.POSTCODE, ' ', '') -- remove all spaces for consistency
1101+
-- WHEN REPLACE(pa.POSTCODE, ' ', '') = REPLICATE('X', LEN(REPLACE(pa.POSTCODE, ' ', '')))
1102+
-- THEN '' -- clear postcode containing all X's
1103+
-- WHEN LOWER(REPLACE(pa.POSTCODE, ' ', '')) = 'nopostcode'
1104+
-- THEN '' -- clear postcode containing 'nopostcode'
1105+
-- ELSE
1106+
-- LTRIM(RTRIM(pa.POSTCODE)) -- keep any internal space(s), just trim ends
11031107
-- END AS CleanedPostcode,
11041108
-- (
11051109

0 commit comments

Comments
 (0)