Looking for some tips/assistance, or just someone to tell me if what I'm trying to do is not possible 
I've built out a very simple Custom SWQL resource that we've added to our Dashboard to let us know when monitored devices miss a ping. Due to a few odd internal networking issues, we've found this to be highly useful - we can see when a bunch of disparate devices all miss one or several pings due to a blip, but don't miss enough to generate an actual down alert for said devices. That SWQL is as follows:
SELECT n.caption, ToLocal(rt.DateTime) as DateTime, rt.PercentLoss
FROM Orion.ResponseTime RT
inner join orion.nodes N
on rt.nodeid = n.NodeID
where rt.percentloss not like '0'
and rt.datetime >= Addhour(-1, getutcdate())
and n.status not like '2'
Occasionally this list gets a little chatty. I'm looking at a way to still have this resource on our dashboard, but only show the # of devices at a given Facility that have logged a missed ping. The query below does this just fine; However, I'm looking to make the results 'clickable', and have those links return a break-out of the devices at the facility that dropped a ping within the past hour (similar to the first query but only showing devices from the clicked facility).
SELECT ncp.FacilityName, ncp.facilitynumber, count(*) as DevicesDroppedPings
FROM Orion.ResponseTime RT
inner join orion.nodes N
on rt.nodeid = n.NodeID
inner join orion.NodesCustomProperties ncp
on n.nodeid = ncp.nodeid
where rt.percentloss not like '0'
and rt.datetime >= Addhour(-1, getutcdate())
and n.status not like '2'
group by ncp.Facilityname, ncp.facilitynumber
order by devicesdroppedpings desc
I'm not quite sure how to make that happen. Any thoughts? Also open to suggestions on making these queries more efficient! For the record, this is NPM 12.1.