Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

hkg_qlik
Contributor II

Scripting (Zipcode)

Hi,

I have Zipcode field as follows: 123456789. I want to divide the zip into two as follows:

Zip_5 = 12345

Zip_4 = 6789

while loading.

Thanks,

H

1 Solution

Accepted Solutions
hkg_qlik
Contributor II

Re: Scripting (Zipcode)

Thanks for your feedback.

here is what i am doing:

left(num(ZIPCODE,'000000000'),5) as ZIP_5,

right(num(ZIPCODE,'000000000'),4) as ZIP_4

Thanks,

H

4 Replies

Re: Scripting (Zipcode)

Hi,

Load data some thing like

Load

Left(Zipcode,5) as Zip_5,

Right(Zipcode,4) as Zip_4

From your source;

Ex:-

Left(123456789, 5) as Zip_5,

Right(123456789, 4) as Zip_4

Regards,

Anand

Re: Scripting (Zipcode)

HI

Try like this

Load left(123456789,5) as Zip_5 , right(123456789,4) as Zip_6 from tablename;

Hope it helps

hkg_qlik
Contributor II

Re: Scripting (Zipcode)

Thanks for your feedback.

here is what i am doing:

left(num(ZIPCODE,'000000000'),5) as ZIP_5,

right(num(ZIPCODE,'000000000'),4) as ZIP_4

Thanks,

H

Re: Scripting (Zipcode)

Hi,

From Mid( ), Left( ), Right( )

function you are able to do that like

With Mid( )

Mid(Zipcode,1,5) as Zip_5

Mid(Zipcode,6,4) as Zip_4

With Left( ) and Right( )

Left(Zipcode,5) as Zip_5,

Right(Zipcode,4) as Zip_4

HTH

Regards,

Anand

Community Browser