Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to identify fields that only contain [A-Z] characters

Dear All

I have a column in my data set called Name - this should contain names so values should be characters [A-Z] but unfortunately there are entries such as  special characters or numbers.

How can I check if the value only contains characters [A-Z} please?

Thank you

JazzyK

4 Replies
sunny_talwar

May be like this

If(Len(Trim(PurgeChar(Lower(Name), 'abcdefghijklmnopqrstuvwxyz'))) > 0, 'Contain Special Characters or Numbers', 'Doesn't contain Special Characters or Numbers') as Flag

atoz1158
Creator II

Hi Jasmit

If you want to clear the field then in your load script try using the following

KeepChar(Name,'ABCDEFGHIJKLMNOPQRSTUVWXYZ') as Name

If you need to keep Spaces then add a space into the list of Characters to keep, also if you wish to keep the lowercase letters as well then added those, the below version will also keep the spaces and lowercase letters.

KeepChar(Name,'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ') as Name

Regards

Adrian

Anonymous
Not applicable
Author

Thank you. That worked perfectly...

atoz1158
Creator II

Hi Jasmit

To help others if this has now answered your question please mark the correct reply and set it as answered.

Regards

Adrian