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: 
shawnklar
Contributor III
Contributor III

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
CELAMBARASAN
Partner - Champion
Partner - Champion

Try with Num function

Num(SAKNR , '0000000000') AS SAKNR

Hope it helps

View solution in original post

6 Replies
alexandros17
Partner - Champion III
Partner - Champion III

write:

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

Hope it helps

CELAMBARASAN
Partner - Champion
Partner - Champion

Try with Num function

Num(SAKNR , '0000000000') AS SAKNR

Hope it helps

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

LOAD

Dim1,

Dim2,

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

FROM DataSource;

Regards,

Jagan.

MK_QSL
MVP
MVP

Num(example,'0000000000') as example

arjunkrishnan
Partner - Creator II
Partner - Creator II

Hai Peter.

Try It This One

Num(SAKNR,'0000000000')

shawnklar
Contributor III
Contributor III
Author

Thank you.

All of your solutions help me.

This is really a great community

Peter