Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Calculating the distamce between 1000s of points in the same table

flojosx
7 - Meteor

Hi Alteryx Community,

 

I would like to calculate the distance between 1000s of points (in rows) in a table.The points are records from GPS Telematics data, with each point representing a point on a road that a car travelled on. The points are spatially distributed and I applied a buffer. I now like to have a workflow that calculates the distance between row 0 and row +1, as in the distance between the current and following row data going through the entire table.

 

I have these data:

Record ID, Long, Lat, Date (UTC format) , Time (UTC format), Direction (Degrees), Vehicle ID

 

Anyone have any ideas?Even partial solutions? Thank you!

 

5 REPLIES 5
RodL
Alteryx Alumni (Retired)

Many Alteryx users don't realize therre are spatial functions available for use in an expression.

Use a multi-row formula tool with something like the following...

 

ST_Distance(ST_CreatePoint([Row-1:Longitude],[Row-1:Latitude]),ST_CreatePoint([Longitude],[Latitude]),"Mi")

flojosx
7 - Meteor

Great! Thank you!

RodL
Alteryx Alumni (Retired)

Just realized that I didn't configure the expression correctly. I had "Row-1:" in the second point for the Latitude.

I've modified my post to correct this. Smiley Embarassed

flojosx
7 - Meteor

I noticed that and adapted it to my configuration. Thank you for correcting it for other users though. Thanks again.

MAAbdullahAlMubarah
8 - Asteroid

Kindly If the data is not confidential could you share it in this thread or in private? 

Labels