system.kanoa.cmms.getPreventiveMaintenanceCompliance(startDate, endDate)
Computes preventive maintenance (PM) compliance metrics for a specified date range, measuring how well scheduled/preventive work orders were completed on time versus late or overdue. It is typically used to populate a PM compliance KPI (often expressed as a percentage of PM work orders completed within their scheduled window) on a maintenance-performance dashboard, helping teams track adherence to their preventive maintenance program and identify periods of slipping compliance.
Parameters
startDate DateTime: Start date
endDate DateTime: End date
Returns
pmCompliance pyDataset
Example
# Populate a PM compliance KPI tile with data from the last 180 days
startDate = system.date.addDays(system.date.now(), -180)
endDate = system.date.now()
data = system.kanoa.utilities.convertDatasetToJSON(system.kanoa.cmms.getPreventiveMaintenanceCompliance(startDate, endDate))
for i, row in enumerate(data):
print 'Row %i'%i
for k,v in row.items():
print k,v
break #Just limiting to returning the columns from the first record for display purposes
>>>
Row 0
PM_OnTimePct 0.0
PM_WorkOrderCount 103
PM_CompletedCount 2
PM_CompletionPct 1.94
PM_OpenCount 101
>>>