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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Comparing the first 2 digits of postal code to another colomn

Hello everyone,

 

I'm a beginner on talend and I will apprecitate if someone can help me with this...

 

How to match the first 2 digits of a postal code ex: 69000 to another column containing the value 69. Then only show row where these values match. (Excel file with the full data attached)

 

Example of the data below:

 

5 TELMAT INFORMATIQUE 69000 LYON 66 pyrenees-orientales
5 TELMAT INFORMATIQUE 69000 LYON 67 bas-rhin
5 TELMAT INFORMATIQUE 69000 LYON 68 haut-rhin
5 TELMAT INFORMATIQUE 69000 LYON 69 rhone
5 TELMAT INFORMATIQUE 69000 LYON 70 haute-saone
5 TELMAT INFORMATIQUE 69000 LYON 71 saone-et-loire
5 TELMAT INFORMATIQUE 69000 LYON 72 sarthe
5 TELMAT INFORMATIQUE 69000 LYON 73 savoie

 

Thanks in advance

 

Labels (2)
1 Solution

Accepted Solutions
akumar2301
Specialist II
Specialist II

But Why your input is cross joined with Region Code ? 

Anyways , Try tFilterrow (Use advance Option) with expression ( to check if  col3 starts with Col5 )

StringHandling.INDEX(input_row.col3 + "",input_row.col5 + "") == 0

 

You could use regex expression also.

 

 

 

 

View solution in original post

4 Replies
TRF
Champion II
Champion II

If postalCode is defined as an integer, use a tFilterRow to get rows where the values is between 69000 and 69999.
If string, extract first 2 digits first then tFilterRow to get expected result.
Anonymous
Not applicable
Author

Thank you for your response,

 

I don't think you got my question right, please take a look on the attacked excel file file.

The 69000 was just an example, so actually there are several postal codes and several departementIDs that starts with varoius ranges of numbers and characters which needs to be matched, am not sure if tFilterRow can be usful in this case. 

akumar2301
Specialist II
Specialist II

But Why your input is cross joined with Region Code ? 

Anyways , Try tFilterrow (Use advance Option) with expression ( to check if  col3 starts with Col5 )

StringHandling.INDEX(input_row.col3 + "",input_row.col5 + "") == 0

 

You could use regex expression also.

 

 

 

 

Anonymous
Not applicable
Author

Many thanks Abhishek it works just fine 0683p000009MACn.png