# Matching values in Table A between two values in Table B

Hello everyone!

I have a question regarding matching values between two tables.
I have Table A with the shipping zone corresponding to 3 char Postal Codes splitted in two columns.
in the first column it’s the beginning of the 3 char Postal Code range and in the second one it’s the end of the 3char Postal Code range.
In Table B, I have all Postal Code and their 3 char equivalent.

I need to find for each range of the 3 char postal code of Table A, the Postal Code corresponding in Table B in order to fill the gap between T0A and T0G lets say. So T0B, T0C, T0D… in order to be able to match both tables to have every shipping zone for every 3 char Postal Code.

I hope it is clear enough and I provide small example to illustrate.

TableA:
Zone,“POSTAL CODE RANGE BEGINNING”,“POSTAL CODE RANGE END”
D13,“T0A”,“T0G”
D15,“T0K”,“T0L”
D15,“T0P”,“T0V”
D13,“T1A”,“T1C”
D13,“T1H”,“T1K”
D15,“T1W”,“T1X”
D12,“T2A”,“T3N”
D12,“T3R”,“T3T”
D13,“T4A”,“T4B”

TableB:
POSTAL_CODE,“3 CHAR POSTAL CODE”
A0A 0A0,“A0A”
A0A 0A1,“A0A”
A0A 0A2,“A0A”
A0A 0A3,“A0A”
A0A 0A4,“A0A”
A0A 0A5,“A0A”
A0A 0A6,“A0A”
A0A 0A7,“A0A”
A0A 0A8,“A0A”

Thank you very much!!

I am thinking about taking each values of POSTAL CODE RANGE BEGINNING and POSTAL CODE RANGE END of TableA to create flow variables and mark it as the beginning and ending condition of the loop.
Then in the body of the loop I would perform a join for each range with the 3 CHAR POSTAL CODE of TableB.
But I don’t know how to do it Im still struggling with the loop exercises of the L2-DS training…

Thank you for your help!

Possible solution is here. Join by date range – KNIME Community Hub
It done for dates range.

1 Like

Thank you for you answer!
I did exactly as the example you provide to me and its works!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.