Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
shawnklar
New Contributor II

Field with leading zeros

I have a (probably) simple problem:

In SAP, I have two tables. The first gives me the account number field (SAKNR) 10 digits, in the second between six and nine points.
I want the SAKNR field generally have 10 digits and leading zeros.
example:
0000628461
0000047933
not
628461
47933
I tried it with the num # statement, but that does not work somehow.

Can someone please help me?
Thank you.

Peter

1 Solution

Accepted Solutions

Re: Field with leading zeros

Try with Num function

Num(SAKNR , '0000000000') AS SAKNR

Hope it helps

6 Replies

Re: Field with leading zeros

write:

Repeat('0', 10 - len(SAKNR)) & SAKNR as SAKNR

Hope it helps

Re: Field with leading zeros

Try with Num function

Num(SAKNR , '0000000000') AS SAKNR

Hope it helps

MVP
MVP

Re: Field with leading zeros

Hi,

Try like this

LOAD

Dim1,

Dim2,

Text(Repeat('0', 10 - len(SAKNR)) & SAKNR) as SAKNR

FROM DataSource;

Regards,

Jagan.

MVP
MVP

Re: Field with leading zeros

Num(example,'0000000000') as example

arjunkrishnan
Contributor

Re: Field with leading zeros

Hai Peter.

Try It This One

Num(SAKNR,'0000000000')

shawnklar
New Contributor II

Re: Field with leading zeros

Thank you.

All of your solutions help me.

This is really a great community

Peter

Community Browser