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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Abadawi
Contributor
Contributor

Interval Match for Coordinate System

Hello,

I am trying to create a dashboard that does an automatic location lookup based on a coordinate system using intervalmatch. 

For example, I have a location with the following coordinates: X,Y = (5.3,4.1)

And I have a lookup table that contains all the coordinates with different location names:

X_Start, X_End, Y_Start, Y_End, Location

1, 2, 0, 2, Entrance

2, 4, 2, 3,  Aisle

4,6,3,5, Driveway

When I do my interval match for the given coordinates, I would want the output to be "Driveway". 

 

Here is the script I used but it didn't really work.

MatchX:
IntervalMatch([XCOORDINATE])
LOAD
X_START,
X_END
Resident
Intervals;

Left Join(T2)
LOAD DISTINCT
XCOORDINATE,
X_START,
X_END,
autonumber(X_START&'|'&X_END&'|'&'X_KEY') as X_KEY
Resident MatchX;
drop tables MatchX;

MatchY:
IntervalMatch(YCOORDINATE,X_KEY)
LOAD
Y_START,
Y_END,
X_KEY
Resident Intervals;

Left join (T2)
Load distinct * Resident MatchY;

Drop tables MatchY, Intervals;

I also tried this solution which didn't work either::
https://community.qlik.com/t5/QlikView-App-Dev/Match-Coordinates-in-between-2-values/td-p/345344

 

@hic  @lucas4bi  any help would be appreciated! I am stuck.

Labels (1)
1 Reply
hic
Former Employee
Former Employee

Perhaps like this:

Points:
Load 
X & '|' & Y as PointID,
Inline
[Point,X,Y
A1,5.3,4.1
A2,5.3,5.1
B1,1.3,1.1
B2,1.3,2.1];
 
Areas:
Load 
X_Start & '|' & X_End & '|' & Y_Start & '|' & Y_End as AreaID,
Inline
[X_Start, X_End, Y_Start, Y_End, Location
1, 2, 0, 2, Entrance
2, 4, 2, 3,  Aisle
4,6,3,5, Driveway];
 
tmpIntervals:
IntervalMatch (X)
Load X_Start, X_End Resident Areas;
 
Join (tmpIntervals)
IntervalMatch (Y)
Load Y_Start, Y_End Resident Areas;
 
Intervals:
Left Keep (Points)
Load
X & '|' & Y as PointID,
X_Start & '|' & X_End & '|' & Y_Start & '|' & Y_End as AreaID
Resident tmpIntervals;
 
Drop Table tmpIntervals;