Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

peschu123
Not applicable

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 -

Tags (2)
1 Solution

Accepted Solutions
sivarajs
Not applicable

Re: Cutting off leading zeros

try using num(fieldname)

5 Replies
sushil353
Not applicable

Re: Cutting off leading zeros

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
Not applicable

Re: Cutting off leading zeros

try using num(fieldname)

er_mohit
Not applicable

Re: Cutting off leading zeros

num(num#( OrderNo))

hope it helps

Not applicable

Re: Cutting off leading zeros

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

peschu123
Not applicable

Re: Cutting off leading zeros

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 -