How to get total alarm duration and occurrences by alarm

Hmm. Looking closer, this is a bit tricky. First, the alarm journal component doesn’t let you bind to the full list of alarms – just the dataset for the selected alarm. But it does have an ‘alarms’ property, which is a dataset of the displayed alarms. Just like the getDataset() method of the list from the system.alarm.queryJournal() script function.
So, first you have to get the alarms into a bindable dataset. A custom dataset property ‘alarmData’ on your table with an objectScript() expression can retrieve that unbindable property:objectScript('binding.target.parent.getComponent("Alarm Journal").alarms', now(1000))Then you can process that dataset into a descending list of frequencies by binding the table’s ‘data’ property with the view() expression:view("Select Source, len(EventState) As Times "+ "Where EventState==0 "+ "Group By Source "+ "Order By -Times", {Root Container.Table.alarmData})The view() expression function doesn’t have a LIMIT clause yet. I’ll add that to my to-do list. :slight_smile:
The durations are even more tricky. Let me think about that.