Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Remove leading zero from Text field?

Hello there!

Can anyone tell me how I can remove leading zero's from a Text field?

I have a Text column where the data looks like:

Header 1
Text
ABC
0001
02
TR01

I would like a function that picks up the leading zero values in the above column and remove it.

How can we do that please?

1 Solution

Accepted Solutions
jonasheisterkam
Partner - Creator III
Partner - Creator III

if(isnum(Field),Text(num(Field)),Field) as Field

View solution in original post

3 Replies
consenit
Partner - Creator II
Partner - Creator II

Hi there.

Try something like this:

Table1:

LOAD IF(IsNum(Header1), NUM(NUM#(Header1)), Header1) as Header1;

LOAD * Inline

[

  Header1

  Text

  ABC

  0001

  02

  TR01

];

Kind regards,

Ernesto.

jonasheisterkam
Partner - Creator III
Partner - Creator III

if(isnum(Field),Text(num(Field)),Field) as Field

Not applicable
Author

Thank you so much both!