Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Shani1
New Contributor

add 0 to string

Hi,

 

i have a 19 million+ rows of data which i need to adjust in load script. But don't know how.

I have prodcts serials with different lengths and i need to add '0's on left side of sales Serials so this can become 30 characters

see the example below. 

how do i do that?

SaleSerialSystemSerial
CCCC8E53616C000000000000000000CCCC8E53616C
8E536121200000000000000000000008E5361212
1 Solution

Accepted Solutions
Highlighted
Partner
Partner

Re: add 0 to string

Hello,

Please try the below code and method this will help you!

Table:
LOAD
SaleSerial,
REPEAT(0,30-LEN(SaleSerial))&SaleSerial AS SystemSerial;
LOAD * INLINE [
SaleSerial
CCCC8E53616C
8E5361212
];

This code will add 0s to the left side of the SaleSerial that you are expecting as SystemSerial.

View solution in original post

3 Replies
Highlighted
Partner
Partner

Re: add 0 to string

Hello,

Please try the below code and method this will help you!

Table:
LOAD
SaleSerial,
REPEAT(0,30-LEN(SaleSerial))&SaleSerial AS SystemSerial;
LOAD * INLINE [
SaleSerial
CCCC8E53616C
8E5361212
];

This code will add 0s to the left side of the SaleSerial that you are expecting as SystemSerial.

View solution in original post

Highlighted
Shani1
New Contributor

Re: add 0 to string

Thanks a lot, it seems to work 

 

Highlighted
Partner
Partner

Re: add 0 to string

You are welcome