Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi ... I want to load the below field, 'SALES_NUMBER', but excluding the string 'AB' wherever it exists.
222100
223190
AB224190
AB225190
So output should be :
222100
223190
224190
225190
Try
KeepChar(SALES_NUMBER, '0123456789') as SALES_NUMBER
KeepChar() is the function, misspelled it intially
Try
KeepChar(SALES_NUMBER, '0123456789') as SALES_NUMBER
KeepChar() is the function, misspelled it intially
if you want only numbers try this
keepchar(SALES_NUMBER,'0123456789')
use KeepChar() instead of KeepChart() as suggested by Sunny
Hahahaha I don't see KeepChart()
Just kidding, I saw my mistake and fixed it
or try like this at script level, if it is in fixed format:
if(istext(mid(SalesField),1,2), mid(SalesField,3,len(SalesField)), SalesField) as SalesField
I was also kidding, Becoz I knew that before putting my comment for you, you would have been updated that
Try this way also
LOAD *,PurgeChar(COLA,'ABCDEFGHIJKLMNOPQRSTUVWXYZ') AS KleenField;
LOAD * Inline
[
COLA
222100
223190
AB224190
AB225190
];
Regards
Anand
Thank you all. I used the first solution ie the keepchar function and it worked nicely.
What if now however I only wanted to pick up values which included the AB string ? So my output would return only the following :
AB224190
AB225190