Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
BARC’s The BI Survey 19 makes it official. BI users love Qlik. GET REPORT
Highlighted
AH
Contributor 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
duncanblaine
Contributor

Re: Nearest distance calculation

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
duncanblaine
Contributor

Re: Nearest distance calculation

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

AH
Contributor III

Re: Nearest distance calculation

Hi Duncan,

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

Regards,