Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am trying to find a function QlikView to format a character string.
For example:
Transforming "H * / 2Q_?*Z6" to "H2QZ6".
That is to say, I want to keep only the letter and number in the character string
Hello,
Using KeepChar and PurgeChar functions will work for you:
=PurgeChar('H / 2Q_?*Z6', '/ _?*')
Or
=KeepChar('H / 2Q_?*Z6', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789')
Hope that helps
From the manual:
KeepChar( s1, s2 )
Returns the string s1 less all characters not contained in string s2.
Example:
keepchar( 'a1b2c3' , '123' ) returns '123'.
In your case: =KeepChar('H * / 2Q_?*Z6','ABCDEFGHIJK:LMNOPQRSTUVWXYZ0123456789');
Jonathan
Hello,
Using KeepChar and PurgeChar functions will work for you:
=PurgeChar('H / 2Q_?*Z6', '/ _?*')
Or
=KeepChar('H / 2Q_?*Z6', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789')
Hope that helps