Forum Discussion
ReadTheIron
3 years agoHelper III
Count repeats in a time frame
I have two tables, one of failures, one of repairs, related on EquipmentName. I'm trying to find out if a given piece of equipment failed in the year after it was repaired. RepairTable Equipment...
- 3 years ago
ReadTheIron , New column in repair table
In next 1 year =
var _cnt = countx(filter(FailureTable, FailureTable[EquipmentName] =RepairTable[EquipmentName] && FailureTable[FailureDate] >=RepairTable[RepairDate] && FailureTable[FailureDate] <= RepairTable[RepairDate] +365) ,FailureTable[EquipmentName])
return
if(isblank(_cnt), "No", "Yes")
amitchandak
3 years agoSuper User
ReadTheIron , New column in repair table
In next 1 year =
var _cnt = countx(filter(FailureTable, FailureTable[EquipmentName] =RepairTable[EquipmentName] && FailureTable[FailureDate] >=RepairTable[RepairDate] && FailureTable[FailureDate] <= RepairTable[RepairDate] +365) ,FailureTable[EquipmentName])
return
if(isblank(_cnt), "No", "Yes")
ReadTheIron
3 years agoHelper III
Clear and elegant! Thank you!