Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

remove 0

Hi,

I have data like following.

How can i remove all the 0 before the real digits?

Thanks.

000000001234

000000334456

000000043467

1 Solution

Accepted Solutions
matt_crowther
Luminary Alumni
Luminary Alumni

Nick,

num() seems to work with me - not against SAP data though.

As a 'ye haw!!' cowboy workaround I'd try something like the following in the load script to chop the field down to size:

right(Number,len(Number)-(FindOneOf(Number,'123456789'))+1)

Hope that helps,

Matt

@QlikviewBI

View solution in original post

14 Replies
sivarajs
Specialist II
Specialist II

use floor(fieldname) or num(fieldname)

Not applicable
Author

Hi,

you can also try

purgechar(000000001234,'0')

sivarajs
Specialist II
Specialist II

@keeruthi   Purgechar is not a good idea because

000001234-->1234

0000012034-->1234

You'll get wrong value

Not applicable
Author

@Siva,

   tht's wht he wants right??

"How can i remove all the 0 before the real digits?" --to remove zero's before the digits..,

i understood the problem in that way  🙂

Not applicable
Author

Hi All,

Good ideas ! n

Non works though.

Any other ways?

CELAMBARASAN
Partner - Champion
Partner - Champion

Try with Num(FieldName)

Not applicable
Author

This is strange...

i created a test qvw, with some inline data, n i type in the data pattern.

then i apply num(), it works !

BUT, when i extract the code form SAP. and i do num(). it doesn't.

nor... floor(num()) or purgechar(num()) or num(num())

anymore advises?

matt_crowther
Luminary Alumni
Luminary Alumni

Nick,

num() seems to work with me - not against SAP data though.

As a 'ye haw!!' cowboy workaround I'd try something like the following in the load script to chop the field down to size:

right(Number,len(Number)-(FindOneOf(Number,'123456789'))+1)

Hope that helps,

Matt

@QlikviewBI

CELAMBARASAN
Partner - Champion
Partner - Champion

May be SAP adds some char to the string data

Try this

Num(KeepChar(FieldName,'0123456789'))

Hope it may solves the problem

Celambarasan