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

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
lmonincx
Creator II
Creator II

Removal Leading zero's

Hi,

I am getting from the source a field wich is filled up with zero's infront of the actual value, i would like to remove all the leading zero's is there a way to do that?

Example: 00004 should become 4

0004A should become 4A

00040 should become 40

Thanks for any help!

Labels (1)
1 Solution

Accepted Solutions
Not applicable

Hi,

Check this below link.

http://community.qlik.com/forums/p/17456/68339.aspx#68339

This should help you.

- Sridhar

View solution in original post

4 Replies
Not applicable

Hi,

Check this below link.

http://community.qlik.com/forums/p/17456/68339.aspx#68339

This should help you.

- Sridhar

lmonincx
Creator II
Creator II
Author

Great that helped a lot , the only issue remaining with this is that in case there was a space in the original field this is now filled with a zero.

i.e. 00018 BIJ is now displayed as 180BIJ.

Many thanks!

Linda

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Linda,

your codes are, indeed, very creative. Usually you wouldn't expect a space in the middle of a code. Well, that only means that you need one more replace round. Found a character that is definitely not part of your codes (I'll use ~ for example) and first covert spaces to ~, then get rid of zeros, and then convert ~ back into spaces. Something like this:

replace(replace(ltrim(replace( replace( ltrim(OldCode), ' ', '~'), '0', ' ')), ' ', 0), '~', ' ')

Oleg
Ask me about Qlik Sense Expert Class!
Anonymous
Not applicable

beautiful