Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
geogou1973
Creator
Creator

Remove some strings from a field

Hello,

I have a field that is the document number of the invoice.

This field will have some strings like . or / or - or etc

how can i remove from all data these strings that have come from false data entry.

I tried with the the following command

IF(FINDONEOF(DOC_PURCHASES,'.'),REPLACE(DOC_PURCHASES,'.',''),
IF(FINDONEOF(DOC_PURCHASES,'/'),REPLACE(DOC_PURCHASES,'/',''),
IF(FINDONEOF(DOC_PURCHASES,'-'),REPLACE(DOC_PURCHASES,'-',''),
IF(FINDONEOF(DOC_PURCHASES,','),REPLACE(DOC_PURCHASES,',',''),
DOC_PURCHASES))))

but in some values does not work and i don't know why.

Have anyone an idea how can i do this.

Thank you in advance.

 

Labels (1)
1 Solution

Accepted Solutions
Frank_Hartmann
Master II
Master II

what if you try using purgecharacter function?

purgechar(DOC_PURCHASES,'.-/')

View solution in original post

2 Replies
Frank_Hartmann
Master II
Master II

what if you try using purgecharacter function?

purgechar(DOC_PURCHASES,'.-/')

Kushal_Chawda

As @Frank_Hartmann  suggested you can either use purgechar function in which you can write as many junk characters that you want to remove. If single quotes itself is one of the junk character then you can use it like below

=PurgeChar(DOC_PURCHASES,chr(39)&'-.,')

If you field always going to have number value then you can use keepchar function which will automatically remove all other characters from field

Keepchar(DOC_PURCHASES,'0123456789')