Calculating Distance In Magic ETL
Best Answers
-
@MichelleH has written up a great article on the community blog you can reference on how she did geospatial distance calculations using a Redshift dataflow.
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0 -
Here is a video walkthrough of how to do it:
**Check out my Domo Tips & Tricks Videos
**Make sure to any users posts that helped you.
**Please mark as accepted the ones who solved your issue.0 -
@MarkSnodgrass laid it out exactly how I did it. Keep in mind that your data can grow rapidly. For example, right now you have 400 rows, 400 x 400 = 160,000. Bumping that up to 500 takes your total rows to 250,000. So be cautious when using this type of self join.
If I solved your problem, please select "yes" above
0
Answers
-
@MichelleH has written up a great article on the community blog you can reference on how she did geospatial distance calculations using a Redshift dataflow.
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0 -
Agreed with the above. If you want to do it in Magic ETL and just need to see any distances greater than 1 mile you could do this:
- Join all 400 rows to each of the 400 rows (note this would be 160,000 rows of data)
- Compare each location to each other location using the DISTANCE() function
- You'll need the coordinates of each location to do this.
- You'll need to convert from KM to Miles by mulitplying the result by 0.621371
- Use a filter tile or filter in a card to only show those where distance > 1 mile
If I solved your problem, please select "yes" above
0 -
Here is a video walkthrough of how to do it:
**Check out my Domo Tips & Tricks Videos
**Make sure to any users posts that helped you.
**Please mark as accepted the ones who solved your issue.0 -
@ColemenWilson how do I compare each location for every location without having to write a formula for every location
0 -
You will want to change your join since you are comparing it to the same data set. Here is how I typically do it to get a row for every combination.
Use the add constants tile to create a column called JoinKey and set it to a value of 1. Do that twice. Connect them to the join tile and join on the JoinKey with an inner join. Rename columns so that you have your first and second coordinates. You will then have a row for each combination and then you can use your distance function.
**Check out my Domo Tips & Tricks Videos
**Make sure to any users posts that helped you.
**Please mark as accepted the ones who solved your issue.2 -
@MarkSnodgrass laid it out exactly how I did it. Keep in mind that your data can grow rapidly. For example, right now you have 400 rows, 400 x 400 = 160,000. Bumping that up to 500 takes your total rows to 250,000. So be cautious when using this type of self join.
If I solved your problem, please select "yes" above
0 -
Thank you guys I was able to figure it out.
0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.6K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 102 SQL DataFlows
- 626 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 754 Beast Mode
- 61 App Studio
- 41 Variables
- 693 Automate
- 178 Apps
- 456 APIs & Domo Developer
- 49 Workflows
- 10 DomoAI
- 38 Predict
- 16 Jupyter Workspaces
- 22 R & Python Tiles
- 398 Distribute
- 115 Domo Everywhere
- 276 Scheduled Reports
- 7 Software Integrations
- 130 Manage
- 127 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 11 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 110 Community Announcements
- 4.8K Archive