Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
hkg_qlik
Creator III
Creator III

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
Creator III
Creator III
Author

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

View solution in original post

4 Replies
its_anandrjs
Champion III
Champion III

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

MayilVahanan

HI

Try like this

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

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
hkg_qlik
Creator III
Creator III
Author

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

its_anandrjs
Champion III
Champion III

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