Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
QlikView_99
Contributor III
Contributor III

Regextest

Hello All,

I'm having trouble in getting an alphanumeric word from a string, i have a column with addresses and i need to know whether the last word in that whole string is a pincode. so last word in the below column after ", " is a pincode.

Cannon Street, 25 Walbrook, London, EC4N 8AF
27 Poultry (Meet By Turkish Bank In Princes Street), London, EC2R 8AJ
1-7 Snowsfields, LONDON, SE1 3SU
The Grove, Chandlers Cross, RICKMANSWORTH, WD3 4TG
1 Solution

Accepted Solutions
StarinieriG
Partner - Specialist
Partner - Specialist

You could test with len

If(Len(SubField(SubField(field,',',-1),' ',-1)=3,'Pincode','Missing')

But you have to be sure about len

View solution in original post

5 Replies
StarinieriG
Partner - Specialist
Partner - Specialist

Hi

try to use this expression

 

SubField(SubField(field,',',-1),' ',-1)

QlikView_99
Contributor III
Contributor III
Author

No, I want to test if there is a pincode in the address in some cases the address columns are in the below way.

 

Cannon Street, 25 Walbrook, London, EC4N 8AF
27 Poultry (Meet By Turkish Bank In Princes Street), London, EC2R 8AJ
1-7 Snowsfields, LONDON
The Grove, Chandlers Cross, RICKMANSWORTH
*st Pancras Eurostar

 

StarinieriG
Partner - Specialist
Partner - Specialist

You could test with len

If(Len(SubField(SubField(field,',',-1),' ',-1)=3,'Pincode','Missing')

But you have to be sure about len

QlikView_99
Contributor III
Contributor III
Author

What if i want to specify the length between some range for suppose i want to get the for some pincodes are 3 digits and some are 4, could you please help me with this?

StarinieriG
Partner - Specialist
Partner - Specialist

If(Len(SubField(SubField(field,',',-1),' ',-1)=3 or Len(SubField(SubField(field,',',-1),' ',-1)=4,'Pincode','Missing')