Skip to main content
Announcements
Happy New Year! Cheers to another year of collaboration, connections and success.
cancel
Showing results for 
Search instead for 
Did you mean: 
samuel_brierley
Creator
Creator

joining 2 tables with a strange criteria

Hi all,

first off thanks for any help

i have 2 tables as described below

Table1

Asset,Lat, Long

Table2

Area, Lat1,Lat2,Long1,Long2

Table1 describes the location of an asset

Table2 descrobes an area

i want table 3 to be

Table3

Asset, Area

my thinking is of some kind of only/match/lookup statement that takes to lat/long for each asset and says return me the area where

Lat > Lat1 and

Lat < Lat2 and

Long > Long1 and

Long < Long2



hopefully that all makes sense,


oh and one more thing, the areas will never overlap

2 Replies
Gysbert_Wassenaar

Something like this

Temp:

LOAD * FROM Table1;

Join(Temp)

LOAD * FROM Table2;


Result:

LOAD Asset,Area

FROM Temp

Where Lat > Lat1 and Lat < Lat2 and Long > Long1 and Long < Long2

;


Drop Table Temp;


talk is cheap, supply exceeds demand
samuel_brierley
Creator
Creator
Author

Thanks for the help, i will give it a try and mark as correct