Hi Lisa,
The attached picture has a field [code] that has some dashes in it.
The field [code_1] removes the first dash from [code]
The field [code_2] removes the first dash from [code_1]
Sticking to standard functions only, so that it can be used for any SQL compliant database.
The expression for code_1 is:
IF ( POSITION ( '-' ; code ) > 0 )
THEN ( SUBSTRING ( code ; 1 ; POSITION ( '-' ; code ) - 1 ) + SUBSTRING ( code ; POSITION ( '-' ; code ) + 1 ))
ELSE ( code )
and the one for code_2 is:
IF ( POSITION ( '-' ; code_1 ) > 0 )
THEN ( SUBSTRING ( code_1 ; 1 ; POSITION ( '-' ; code_1 ) - 1 ) + SUBSTRING ( code_1 ; POSITION ( '-' ; code_1 ) + 1 ))
ELSE ( code_1 )
Hope this helps.
//Henk
------------------------------
HENK CAZEMIER
------------------------------
Original Message:
Sent: Fri September 13, 2019 02:41 PM
From: Lisa Cahill
Subject: Removing Characters
------------------------------
Lisa
------------------------------
#CognosAnalyticswithWatson