Hi
Can any one help me to convert mention swql query into COUNT instead of "TOP 10" with last 3 hours time frame so that it can be use in Modern Dashboard KPI Widget.
SELECT TOP 10 n.Caption,n.CustomProperties.ATM_Branches AS CustomProperties_ATM_Branches,n.CustomProperties.City AS CustomProperties_City,n.CustomProperties.Regions AS CustomProperties_Regions,aggSub1._count AS Orion_Events_EventType_count
FROM Orion.Nodes n
LEFT JOIN (
SELECT i.NetworkNode,i.InstanceSiteId
, count(i.EventType) AS _count FROM Orion.Events i
GROUP BY i.NetworkNode,i.InstanceSiteId
) aggSub1 ON aggSub1.NetworkNode=n.NodeID AND aggSub1.InstanceSiteId=n.InstanceSiteId
WHERE (n.CustomProperties.ATM_Branches LIKE 'atm branches%' AND $aggSub1._count = 14)