Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Removing Numeric characters

Hello All,

In dimension, I have data as follows,

1718-021-A

1718-021-AA

1718-021-A1

1718-021-AA1

1712-021-B

1718-021-B1

My final requirement is to get the data as follows,

1718-021-A

1718-021-AA

1718-021-A

1718-021-AA

1712-021-B

1718-021-B

Removing all numeric characters from the field.

Labels (1)
5 Replies
tresB
Champion III
Champion III

If it's about removing numerics from last substring, one solution could be like:

Left(YourStringField,FindOneOf(YourStringField,'-',-1)) & Purgechar(SubField(YourStringField,'-',-1),'0123456789')

krishna789
Creator II
Creator II

mayankraoka
Specialist
Specialist

Also you can refer below blog for better understanding

PurgeChar and KeepChar Functions

Regards,

Mayank

jonathandienst
Partner - Champion III
Partner - Champion III

Or this:

Left(Field, Index(Field, '-', -1)) & PurgeChar(SubField(Field, '-', -1), '0123456789')

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
arvind_patil
Partner - Specialist III
Partner - Specialist III

Hi,

Please find below:

T:

LOAD * Inline [

Data

1718-021-A

1718-021-AA

1718-021-A1

1718-021-AA1

1712-021-B

1718-021-B1

];

NoConcatenate

T1:

LOAD *,

SubField(Data,'-',1)&'-'&SubField(Data,'-',2)&'-'&purgechar(SubField(Data,'-',3) ,'0123456789') as [Final Data]

Resident T;

DROP Table T;

Thanks,

Arvind Patil