Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
peschu123
Partner - Creator III
Partner - Creator III

Cutting off leading zeros

Hi,

I have a problem with some fields, having leading zeros.

For example a field like OrderNo..

In source 1 the OrderNo. looks like: 00001234567, 00012345678

In source 2 the OrderNo. looks like: 1234567, 12345678

Qlikview don't seem to have a problem with that, but is there a solution to cut off the leading zeroes or to define a lenght e.g. of 14 and fill with zeros?

Or is it unnecessary to care about this?

Thanks for any advice.

- PS -

1 Solution

Accepted Solutions
sivarajs
Specialist II
Specialist II

try using num(fieldname)

View solution in original post

5 Replies
sushil353
Master II
Master II

Hi,

if you want to make the orderno in same format then try Repeat function:

Below is the sample scirpt:

T1:

load * Inline

[

value

1234567

12365547

];

T2:

LOAD

Repeat(0,14-len(value))&value as testvalue

Resident T1;

and other way is using NUM(value): it will remove the zero's.

HTH

Sushil

sivarajs
Specialist II
Specialist II

try using num(fieldname)

er_mohit
Master II
Master II

num(num#( OrderNo))

hope it helps

Not applicable

pick(wildmatch(OrderNo,'1*'),'1*') as OrderNo_new

peschu123
Partner - Creator III
Partner - Creator III
Author

Hi vishwaranjan,

thank you for your reply!

I didn't had time to check the solutions, yet. But when I interpret your solution right, than this does not work with 00007654321? "12345678" was just an example the "orderno" can begin with any number...

Anyway, num(fieldname) did the trick.

Thank you very much for the fast replies.

- PS -