-
Notifications
You must be signed in to change notification settings - Fork 26
Useful SQL Query Collection #43
Comments
Here's the query I ran to extract the 2018 data to get a few hours of jams city-wide to do a post-event analysis in Carto so we can improve traffic flow the next year.
Data extracted: Animated map of results: Non animated version of 2017 data: |
Below is a query for re-timing analysis to use in Power BI. You can find the Power BI template in my comments here #28. The date/time field is set to Eastern Standard Time, but can be changed by updating 'EST' with whatever time zone you need. You can update the time group field based on what your traffic team says if peak hours. At the bottom in the where statement you can change the to and from dates you want to pull data. You can also change the range for latitude and longitude. The amount of time this takes to run varies on what changes you make in the where statement. It also depends on your computer and network connection speeds.
|
Post as comments here sample SQL queries that you find useful. Make sure to:
code
markdown formatting, eg using ``` around the SQLDB Testing Example
Not that useful but shows off some joins and runs quickly.
A quick query to select weather hazard alerts joined with road type and returns the latitude and longitude of the location. Take a few seconds to run if you have some new recommended indexes setup.
The text was updated successfully, but these errors were encountered: