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.

Not applicable

How to set the length of a field?

Hi,

If I have item numbers, that come in in various lengths, say, 3 to 5 characters, but I want to make them all 6 characters long, how do I do that?  I've looked everywhere but can't find any topics pertaining specifically to this, thanks for your help.

1 Solution

Accepted Solutions
marcus_sommer
Not applicable

Re: How to set the length of a field?

Try it with num(Field, '000000')

- Marcus

5 Replies
marcus_sommer
Not applicable

Re: How to set the length of a field?

Try it with num(Field, '000000')

- Marcus

alexandros17
Not applicable

Re: How to set the length of a field?

If your field name is for example myField then:

=Repeat('0',6-Len(myField )) & myField

let me know

balkumarchandel
Not applicable

Re: How to set the length of a field?

yes Marcus is correct  you will get your numbers followed by 0 (zeros)

ex for 10 you will get 000010

Not applicable

Re: How to set the length of a field?

Perfect! Worked! Thank you!

alexandros17
Not applicable

Re: How to set the length of a field?

That solution works only with numbers ...