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: 
stephbzr
Contributor III
Contributor III

Remove the first zero from a string

Hello,

I can't process a string the way I want. Here is an illustration of what I want:

0695b00000YEddBAAT.png

I tried var.rep_finesspre.replaceFirst("^0*", "") in my tMap (or replaceAll). I also tried tReplace with "0_" and replace with "". But the result is not what I expect, I want to remove the first zero from a string when there are numbers behind it. My variable is of type string

Labels (4)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Hello,

With your use case, you'd better get your String length firstly and then remove the first zero from a string.

Please have a look at my screenshots for details. Hope it helps0695b00000YEm90AAD.png0695b00000YEm95AAD.png 

Best regards

Sabrina

View solution in original post

1 Reply
Anonymous
Not applicable

Hello,

With your use case, you'd better get your String length firstly and then remove the first zero from a string.

Please have a look at my screenshots for details. Hope it helps0695b00000YEm90AAD.png0695b00000YEm95AAD.png 

Best regards

Sabrina