system.kanoa.cmms.getMaintenanceMTBFByAsset(paramsDict)
Returns MTBF grouped by asset filtered by the given parameters
Parameters
paramsDict Dictionary
| - assetId | Integer | Not required |
| - endDate | DateTime | End date |
| - startDate | DateTime | Start date |
Returns
mtbfByAsset pyDataset
Example
# Compute MTBF by asset for the previous calendar month
paramsDict = {
'startDate': system.date.addDays(system.date.now(), -90),
'endDate': system.date.now()
}
data = system.kanoa.utilities.convertDatasetToJSON(system.kanoa.cmms.getMaintenanceMTBFByAsset(paramsDict))
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
MTBF_Days 14.0
MTBF_Minutes 20242.0
lastFailureDate 2026-05-11 18:51:30.73
firstFailureDate 2026-05-11 18:51:30.73
assetId 901
assetPath Kanoa Box Co\Box Plant\Packaging\Box Line 1
intervalCount 1
assetName Box Line 1
failureCount 1
>>>