Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
khaoula_agazzar01
Contributor
Contributor

How to remove leading zeros from a string

Hello Guys,

I need to remove zeros from the left of the string '000005674505'.

I want to have in results:'5674505'.

Can you help me please?

thank you .

Labels (1)
2 Solutions

Accepted Solutions
gthuiz
Contributor III
Contributor III

The method is to format the string as a number using NUM()

NUM(000005674505,'#,##0')

If the formatting is not required, then no need to have the second parameter.

View solution in original post

gthuiz
Contributor III
Contributor III

You could use the IsNum() function.

IF(IsNum(VALUE),
NUM(VALUE,'#,##0'),
VALUE)

View solution in original post

4 Replies
gthuiz
Contributor III
Contributor III

The method is to format the string as a number using NUM()

NUM(000005674505,'#,##0')

If the formatting is not required, then no need to have the second parameter.

khaoula_agazzar01
Contributor
Contributor
Author

thank you for the solution. the real problem is that i have some rows where the information is like 000005674505 and others like 'GH54673045'. I don't know if there is a way to say if it is numeric then NUM(000005674505,'#,##0') ?

gthuiz
Contributor III
Contributor III

You could use the IsNum() function.

IF(IsNum(VALUE),
NUM(VALUE,'#,##0'),
VALUE)

Leiro
Contributor II
Contributor II

Hi!

For me what works is num(num#(some_number,'#0') ).

Converts '000005555' to 5555.