Here is the query of the report:
DECLARE @v1_TrusteeScope nvarchar(max)
SET @v1_TrusteeScope = N'%TrusteeScope%'
SELECT COUNT(DISTINCT CAST(i.[Guid] as varchar(40))) [Number of Computers],
a1.[Name] [Product Name],
--mkd.[KnownAs] [Manufacturer],
a1.Version [Product Version]
FROM dbo.vComputer i
JOIN dbo.ScopeMembership sm
ON sm.[ResourceGuid] = i.Guid
AND sm.[ScopeCollectionGuid] IN (SELECT * FROM dbo.fnGetTrusteeScopeCollections (@v1_TrusteeScope))
JOIN dbo.vSWAntivirusWindows a1
ON a1.[_ResourceGuid] = i.Guid
--JOIN dbo.ManufacturerKnownAsDefault mkd
--ON a1.[Name] LIKE mkd.[KnownAs] + '%'
JOIN dbo.CollectionMembership cm
ON cm.ResourceGuid = i.[Guid]
JOIN dbo.vCollection it
ON it.Guid = cm.CollectionGuid
WHERE 1 = 1
AND i.[System Type] LIKE 'Win%'
AND LOWER (i.[Name]) LIKE LOWER ('%Computer Name%')
AND i.Domain LIKE '%Domain%'
AND LOWER (it.[Guid]) LIKE LOWER ('%Filter%')
GROUP BY
a1.[Name],
--mkd.[KnownAs],
a1.Version
UNION ALL
SELECT COUNT(DISTINCT CAST(i.[Guid] as varchar(40))) [Number of Computers],
ISNULL (dbo.fnLocalizeString ('No Virus Protection','21086963-e60d-4386-8343-b1c6c9d2be2e','%_culture%'),
dbo.fnLocalizeString ('No Virus Protection','21086963-e60d-4386-8343-b1c6c9d2be2e','en')) [Product Name],
--NULL [Manufacturer],
NULL [Product Version]
FROM dbo.vComputer i
JOIN dbo.ScopeMembership sm
ON sm.[ResourceGuid] = i.Guid
AND sm.[ScopeCollectionGuid] IN (SELECT * FROM dbo.fnGetTrusteeScopeCollections (@v1_TrusteeScope))
JOIN dbo.CollectionMembership cm
ON cm.ResourceGuid = i.[Guid]
JOIN dbo.vCollection it
ON it.Guid = cm.CollectionGuid
WHERE 1 = 1
AND i.Guid NOT IN
(
SELECT a1._ResourceGuid
FROM dbo.vSWAntivirusWindows a1
)
AND i.[System Type] LIKE 'Win%'
AND LOWER (i.[Name]) LIKE LOWER ('%Computer Name%')
AND i.Domain LIKE '%Domain%'
AND LOWER (it.[Guid]) LIKE LOWER ('%Filter%')
HAVING COUNT(DISTINCT CAST(i.[Guid] as varchar(40))) > 0
ORDER BY
COUNT(DISTINCT CAST(i.[Guid] as varchar(40))) DESC