How to get total alarm duration and occurrences by alarm

Okay, here’s how I did it…

My parent query is a SQL query: SELECT distinct displaypath FROM alarm_events where displaypath <> ""
I wanted to limit this to the dozen alarms I added a display path to – obviously you’ll change this query to suit your needs.

My child query is an alarm journal query, where the displaypath filter is {displaypath}

My table is set up like the attached screen shot, with Top N sorting, using a sorting key of alarm_journal.total.activeDurationMS / 60 / 1000 (ignore the warning that comes up), limited to the top 5 results. You can add some number formatting to the Active Minutes column if you don’t want to see the fractional portion of the minutes.