Skip to main content

system.kanoa.cmms.getMaintenanceKPIDailyTrend(startDate, endDate, maintenanceTypeName)

Returns the daily maintenance KPI trend across a given date range, optionally filtered to a single maintenance type. Each row represents one day's aggregated maintenance metrics, making this suitable for plotting a time-series trend line rather than a single-point summary. It is typically used to drive a trend chart on a maintenance dashboard, such as daily work order volume or completion rate over time.


Parameters

startDate DateTime: Start date
endDate DateTime: End date
maintenanceTypeName String: Can be null


Returns

kpiDailyTrend pyDataset


Example

# Plot the daily preventive maintenance KPI trend for the last 60 days
startDate = system.date.addDays(system.date.now(), -60)
endDate = system.date.now()
maintenanceTypeName = "Preventive"

data = system.kanoa.utilities.convertDatasetToJSON(system.kanoa.cmms.getMaintenanceKPIDailyTrend(startDate, endDate, maintenanceTypeName))

for i, row in enumerate(data):
print 'Row %i'%i
for k,v in row.items():
print k,v

break
>>>
Row 0
MTTA_Minutes 0.0
ScheduleCompliancePct None
workOrderCount 1
MeanWait_Minutes 0.0
completedCount 0
MeanCycleTime_Minutes None
cancelledCount 0
MTTR_Minutes None
openCount 1
KPI_Date 2026-05-29 00:00:00.0
>>>