

hi all
i am getting error when i put device limitation (unknown Severity) . when i remove the device limitation its working fine . i will share the query below . anyone can fix . i need same result with limitation or without limitation
SELECT
COUNT([ActiveAlerts].AlertActiveID) AS [AlertCount]
, CASE [ActiveAlerts].AlertObjects.AlertConfigurations.Severity
WHEN 0 THEN 'Informational'
WHEN 1 THEN 'Warning Alerts'
WHEN 2 THEN 'Critical Alerts'
WHEN 3 THEN 'Serious'
WHEN 4 THEN 'Notice'
ELSE CONCAT('Unknown Severity: ', [ActiveAlerts].AlertObjects.AlertConfigurations.Severity)
END AS [SeverityText]
, CASE [ActiveAlerts].AlertObjects.AlertConfigurations.Severity
WHEN 0 THEN -2 -- Information
WHEN 1 THEN -3 -- Warning
WHEN 2 THEN -5 -- Critical
WHEN 3 THEN -4 -- Serious
WHEN 4 THEN -1 -- Notice
ELSE [ActiveAlerts].AlertObjects.AlertConfigurations.Severity
END AS [SeveritySort]
, CASE [ActiveAlerts].AlertObjects.AlertConfigurations.Severity
WHEN 0 THEN '#0099ff' -- Informational \"Light Blue\"
WHEN 1 THEN '#fbe04b' -- Warning \"Yellow\"
WHEN 2 THEN '#d60d47' -- Critical \"Red\"
WHEN 3 THEN '#f99d1c' -- Serious \"Orange\"
WHEN 4 THEN '#4169e1' -- Notice \"Blue\"
END AS [Color]
, [ActiveAlerts].AlertObjects.AlertConfigurations.Severity
FROM Orion.AlertActive AS [ActiveAlerts]
GROUP BY [ActiveAlerts].AlertObjects.AlertConfigurations.Severity
ORDER BY [SeveritySort]