Leasing

Leasing Case Study and SQL Recipe Book

Leasing companies (particularly banks and fleet‑leasing providers) retain ownership of the vehicle or equipment while the client merely rents its use, so they absorb the asset‑related risk throughout the contract. 

To protect residual value, enforce contractual limits (mileage, geography, maintenance), and streamline full‑service obligations, they rely on Navixy.  Real‑time GPS data, sensors based diagnostics, and behavioural analytics let them verify usage conditions, automate service scheduling, detect mechanical issues early, calculate penalties or excess‑kilometre fees, and, when necessary, immobilise or recover the asset—all of which secures their investment, reduces operational cost, and enhances customer transparency across the entire lease lifecycle.

Navixy IoT Query will help to organize any kind of analytics at every stage of the leasing contract. A leasing contract passes through several predictable phases: Onboarding & Asset Setup → Operational Phase → Risk & Compliance Oversight

The following SQL recipes in your book collectively monitor every critical milestone across that lifecycle:

Lifecycle Phase
Goals & Milestones
Covered Use Cases / Recipes

Onboarding  & Asset Setup

• Register vehicle, activate insurance and driver credentials. • Import assets into the client portal with correct visibility.

Registration/Insurance Expiry Alerts – baseline dates captured. Driver License Expiry – validates drivers before release.

Preventive Maintenance Planning

• Establish recurring, mileage‑based and time‑based service schedules. • Guarantee seasonal tyre changes.

Routine Inspections by Interval – calendar‑driven tasks.  Service by Mileage Threshold – km‑driven minor/major service rules. Engine Hours Monitoring – hour‑driven service for machinery.

Contract‑Bound Usage Limits

• Enforce mileage allowances and financial caps. • Detect over‑usage early to avoid end‑term surprises.

Mileage Cap & Penalties – yearly / contract‑total kilometre policing.

Real‑time Driver & Asset Behaviour

• Protect asset value; coach drivers. • Spot misuse that voids “full‑service” coverage.

Harsh Braking. Harsh Acceleration. Sudden Turns/Cornering.

Risk & Compliance Oversight

• Keep assets inside geographic and contractual boundaries. • Retain right to disable or recover.

Geofence Exit (Country Border) – instant alert on territory breach. Ignition & Idle Detection – fuel wastage / misuse tracking.

Dashboard template

While the SQL recipes below provide complete control over leasing analytics, you can start faster with a pre-built dashboard that visualizes critical metrics across the lease lifecycle. The template eliminates building queries and visualizations from scratch. Import it, adjust parameters, and begin monitoring compliance, risk, and asset protection immediately.

The template addresses key leasing workflows: registration and insurance expiry tracking, driver license monitoring, harsh braking and acceleration detection with severity classifications, idle time analysis, and device activity monitoring.

Import the configuration into Dashboard Studio, adjust thresholds for your contracts (mileage caps, behavior severity levels, idle detection parameters), and deploy a complete monitoring workspace. This works well when teams need operational dashboards for day-to-day compliance and risk oversight without writing SQL.

Prerequisites:

  • IoT Query enabled in your environment

  • Dashboard Studio installed and accessible

  • At least 72 hours of tracking data

  • Standard schema tables populated: tracking_data_core, states, objects, vehicles, employees

Configuration after import:

After importing the template, adapt it to your specific leasing contracts and operational thresholds:

  1. Review the 72-hour default time range and adjust if your data availability differs.

  2. Set severity thresholds for driving events in the query parameters (default: 60+ km/h/s for warnings, 80+ km/h/s for critical alerts).

  3. Configure idle detection parameters (default: speed below 5 km/h, minimum 5-minute duration).

  4. Update geofence zone labels in the border crossing query if monitoring territory restrictions.

  5. Use the global time picker to analyze historical periods or focus on recent activity.

Template JSON:

To learn more about IoT Querie's dashboard app, see Dashboard Studio.

For setup assistance, contact [email protected].

Registration / Insurance Expiry Alerts

Banks must track upcoming registration and insurance expirations because they’re responsible for technical inspections, registration, and insurance. Timely alerts prevent fines and vehicle downtime.

Driver License Expiry

Although not always mandatory, offering proactive license-expiry alerts is a value-add service. Early warnings let clients renew licenses before they lapse. Please note you

Geofence Exit (Country Border)

Contracts may restrict vehicle movement to a specific territory (e.g., Serbia). Exiting that zone should instantly alert the bank so it can act (e.g., contact client, immobilize asset).

This SQL query is designed to monitor and identify when a device exits a predefined geographic zone labeled "Tallaght Depot Geofences." The process begins by collecting and ordering geographic points that define the boundary of the zone. To ensure the boundary forms a valid polygon, the first point is appended to the end of the list, effectively closing the shape. This closed set of points is then used to create a polygon representing the geographic zone, which is converted into a geography object for spatial analysis.

The query then retrieves device tracking data within a specified time range, converting raw latitude and longitude values into geographic points. It calculates whether each device point is inside or outside the predefined zone using the ST_Contains function, which checks for spatial containment. The calculated parameter pos indicates 'inside' if the point is within the zone and 'outside' otherwise. Finally, the query filters these results to detect transitions where a device moves from inside the zone to outside, using a window function to compare the current position with the previous one. This logic helps in monitoring device movements and detecting exit events from specific geographic areas. Make sure you add the correct value for the parameter: z.zone_label = 'your_zone_label'.

Routine Inspections by Time Interval

Some maintenance tasks recur on fixed time schedules. The system should flag vehicles whose next inspection/check is due within a defined interval.

Service by Mileage Threshold (Minor/Major)

Minor and major services are triggered by mileage since the last service event. When accumulated kilometers exceed the threshold, the appropriate service must be scheduled.

Please note the vst.description field should have relevant comments / description to use it for the filters in the SQL code below.

Mileage Cap & Penalties

Leasing contracts often cap mileage (e.g., 25,000 km/year). If the limit is exceeded, penalty clauses apply. The system must compare actual mileage over the contract period with the agreed limit and calculate fees.

Engine Hours Monitoring

For machinery and agricultural equipment, operating hours—not mileage—drive maintenance and billing. Engine-hour data (e.g., from CAN-Bus) must be monitored and summarized.

Harsh Braking Events

Driving behavior affects wear and contract compliance. Detecting harsh braking helps the bank attribute premature brake/tire wear to driver misuse and, if needed, shift costs.

SQL query below first calculates the speed in kilometers per hour and the time difference between consecutive data points for each device. Using this information, it then computes the deceleration rate in kilometers per hour per second. Finally, it filters and returns records where the deceleration rate is 20 km/h per second or higher, indicating significant deceleration events.

Harsh Acceleration Events

Aggressive acceleration increases wear on tires, transmissions, drivetrains, and engine mounts. Identifying these events supports coaching and potential cost recovery.

The SQL query below is designed to identify significant acceleration events from a dataset of tracking data. It first calculates the speed in kilometers per hour and the time difference between consecutive data points for each device. Using this information, it then computes the acceleration rate in kilometers per hour per second. Finally, it filters and returns records where the acceleration rate meets or exceeds a specified threshold, indicating significant acceleration events.

Sudden Turns / Cornering

Sharp turns combined with abrupt speed changes indicate risky driving. Tracking such behavior helps detect improper use of the vehicle.

This SQL query is designed to identify significant changes in direction and speed from tracking data over a specified time period. It first converts raw latitude and longitude values into decimal degrees and calculates the speed in kilometers per hour. Using the LAG function, it retrieves previous location and speed data for each device, allowing for the computation of changes over time. The query then calculates the heading change in degrees using trigonometric functions to determine the bearing between consecutive points. It also computes the change in speed between these points. Finally, the query filters the results to include only those records where the absolute change in heading is 10 degrees or more and the absolute change in speed is 5 km/h or more, identifying significant maneuvers or events in the tracking data.

Ignition & Idle Detection

Measuring idle time (ignition on, low/no speed) helps reduce fuel waste and identify misuse. Long idling periods should be reported and managed.

Last updated

Was this helpful?