Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator III
Creator III

Nearest distance calculation

I have the X and Y coordinate in the Pos.txt file with a PosID field and

X and Y coordinate in the Dod.txt file with an ID field.

My goal is to consolidate this two-tables into one table based on the X and Y coordinate.

So, what ‘PosID’ falls under what ‘ID’ based on the nearest X & Y coordinates of the PosID to the X & Y coordinates of the ‘ID’ field? is the condition to achieve this goal.

Any Help is highly appreciated.

Thanks & Regards,

1 Solution

Accepted Solutions
Highlighted
Creator
Creator

Hi Shan

I found a few posts about similar calculations and I've applied them to an app that demonstrates what I hope you're after.

The crucial part of the calculation is the Distance Calculation which is done using a Macro.

If found reference to that here distance between two coordinates

Your requirement is a bit different to that example as you want to group certain locations under others based on distance. My app shows how to do that. It ended up being simpler than I thought.

Hope this helps.

DistanceFromID.PNG

View solution in original post

2 Replies
Highlighted
Creator
Creator

Hi Shan

I found a few posts about similar calculations and I've applied them to an app that demonstrates what I hope you're after.

The crucial part of the calculation is the Distance Calculation which is done using a Macro.

If found reference to that here distance between two coordinates

Your requirement is a bit different to that example as you want to group certain locations under others based on distance. My app shows how to do that. It ended up being simpler than I thought.

Hope this helps.

DistanceFromID.PNG

View solution in original post

Highlighted
Creator III
Creator III

Hi Duncan,

Thank you so much for the solution! It works great.

Regards,