How can I get the sum of all data in my Query using Session Relevance?

I have a report that returns info on individual computers along with counts of the numbers of Applicable (remediated + relevant), Installed (remediated), and outstanding (relevant) windows patches connected to those computers and also filters the computers by computer group.

( id of item 0 of it, (name of item 0 of it | "<none>") & "<br>" & (device type of item 0 of it | "<none>"), concatenation "<br>" of values of results from (bes property "User Name") of item 0 of it as string | "<none>", ((preceding text of first " " of operating system of item 0 of it) as string & "<br>" & (following text of first " " of operating system of item 0 of it) as string) | "<none>", concatenation "<br>" of (ip addresses of item 0 of it as string) | "<none>", ((((day_of_week of it) as three letters) & ", " & ((month of it) as three letters) & " " & ((day_of_month of it) as two digits) & ", " & ((year of it) as string) ) of date (local time zone) of it & html "<br>" & (if ((hour_of_day of it) <= 12) then (if ((hour_of_day of it != 0 )) then ((two digit hour of it) & ":" & (two digit minute of it) & ":" & (two digit second of it) & " AM") else ((12 as string) & ":" & (two digit minute of it) & ":" & (two digit second of it) & " AM") ) else ((if (((hour_of_day of it) - 12) < 10) then ((0 as string) & (((hour_of_day of it) - 12) as string))else (((hour_of_day of it) - 12) as string)) & ":" & (two digit minute of it) & ":" & (two digit second of it) & " PM")) of time (local time zone) of it ) of last report time of item 0 of it, item 2 of it, (item 2 of it) - (item 1 of it), item 1 of it, ( if (item 2 of it = 0) then ("N/A") else ((100 - (item 1 of it as floating point / item 2 of it as floating point * 100)) as integer as string & "%25") )) of ( item 0 of it, number of results (item 0 of it, elements of item 1 of it) whose (relevant flag of it), number of results (item 0 of it, elements of item 1 of it) whose (remediated flag of it or relevant flag of it) ) of ( (elements of item 0 of it), item 1 of it ) of ( ( set of items 0 of ( subscribed computers of bes sites whose (name of it = "Enterprise Security"), it) whose (id of item 0 of it = id of item 1 of it) of members of bes computer groups whose (name of it = "Laptops") ), ( set of fixlets whose ( globally visible flag of it = TRUE and ( exists source severity whose ( it is not "" and it does not contain "N/A" and it does not contain "Unspecified" ) of it ) and (source release date of it) > date "01 Jan 2000" and exists results whose (remediated flag of it or relevant flag of it) of it and exists actions of it ) of bes sites whose (name of it = "Enterprise Security") ) )

I want to make a separate version of this report that only returns the sums of all the patch counts from the previous report, so that the end result will be a single row of data with just three columns each containing the combined total of the patch counts from the previous report.

This is what I’ve tried so far…

( sum of item 1 of it, sum of ((item 1 of it) - (item 0 of it)), sum of item 0 of it ) of ( number of results (item 0 of it, elements of item 1 of it) whose (relevant flag of it), number of results (item 0 of it, elements of item 1 of it) whose (remediated flag of it or relevant flag of it) ) of ( (elements of item 0 of it), item 1 of it ) of ( ( set of items 0 of ( subscribed computers of bes sites whose (name of it = "Enterprise Security"), it) whose (id of item 0 of it = id of item 1 of it) of members of bes computer groups whose (name of it = "Laptops") ), ( set of fixlets whose ( globally visible flag of it = TRUE and ( exists source severity whose ( it is not "" and it does not contain "N/A" and it does not contain "Unspecified" ) of it ) and (source release date of it) > date "01 Jan 2000" and exists results whose (remediated flag of it or relevant flag of it) of it and exists actions of it ) of bes sites whose (name of it = "Enterprise Security") ) ) 

But the numbers that it returns are still grouped by the individual computers and is still returning multiple rows (one row for each computer). Computers still need to be apart of the query because the report needs to be filtered by computer group, so how can I decouple the results from the individual computers to get the sum of everything?

And before you ask, this is for making charts.

This query is already kind of complicated, hard to unwrap. It would be easier to unpack if you provided how to get the set of computers you care about and the set of patches you care about separately from the rest.

This would be much faster if done by just getting the totals and not doing the query by computer individually.

If using Web Reports, you can actually filter computers outside of the query itself, which is kind of neat.

Otherwise, I would look at what it takes to just get the number of relevant patches that meet the criteria of bes computers first, then you could use bes computers whose() to filter it to a particular group.