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

Find Postcode in string address

I would like to get postcode from the string of address

AddressPostcode
1 G LORONG DELIMA 17, ISLAND GLADES, 11700 GELUGOR, PULAU PINANG11700
1 JALAN 5/36 SEKSYEN 5 BANDAR RINCHING 43500 SEMENYIH SELANGOR43500
1 & 2 LOT 2000 JLN JAM  BU BATU 71/2 MERU 42200 KLANG SELANGOR42200

 

Result is Postcode column.

Postcode is a fixed number of digit, anyway to get this 5 digits number from string of text?

Labels (1)
1 Reply
tresesco
MVP
MVP

One way could be like:

 

 

Load
	*,
	SplitBySpace as PostcodeFinal
	Where Len(SplitBySpace)=5 and IsNum(SplitBySpace);
	
Load  *,
	SubField([Address	Postcode], ' ') as SplitBySpace
	Inline [
Address	Postcode
1 G LORONG DELIMA 17, ISLAND GLADES, 11700 GELUGOR, PULAU PINANG
1 JALAN 5/36 SEKSYEN 5 BANDAR RINCHING 43500 SEMENYIH SELANGOR
1 & 2 LOT 2000 JLN JAM  BU BATU 71/2 MERU 42200 KLANG SELANGOR
] (delimiter is '|')