Grouping/sum for relevance

Not sure if there is an easy way to sum/group results? I’m drawing a blank.

For example, say I have the following results:

MS13-081, 7
MS13-081, 7
MS13-081, 7
MS13-081, 8
MS14-057, 65
MS14-057, 3
MS14-057, 65

How can I get it to just return

MS13-081,29
MS14-057,133

How are you getting those results in the first place? It might be easier to go up a level and then just get the “MS##-###” values repeated, and then use the unique values inspector to count them.

What James said is correct, as if you can avoid having to jump through these hoops in the first place it will make your life easier.

Sadly, this relevance requires using two instances of the ‘results’ within the relevance. Once in the inner part to get the sums of the totals for each patch and initially at the end(beginning?) of the relevance, to provide the unique list of keys for the pair.

Q: (it, (sum of items 1 of items 1 of it of (it, (“MS13-081”, 7;“MS13-081”, 7;“MS13-081”, 7;“MS13-081”, 8;“MS14-057”, 65;“MS14-057”, 3;“MS14-057”, 65) ) whose (item 0 of it = item 0 of item 1 of it) of it)) of unique values of it of items 0 of (“MS13-081”, 7;“MS13-081”, 7;“MS13-081”, 7;“MS13-081”, 8;“MS14-057”, 65;“MS14-057”, 3;“MS14-057”, 65)

A: MS13-081, 29
A: MS14-057, 133

1 Like

You might be able to avoid the recursion if you revisit the query that generated the original results. I don’t have access to the console right now, but I’d imagine something like

(preceding texts of firsts " " of name of it, names of applicable computers of it) of fixlets of bes sites whose (name of it = “Enterprise Security”)

would give you something like

MS13-012, computer1
MS13-012, computer2
MS15-002, computer3
MS15-002, computer4
MS15-002, computer5
1235421, computer2

That shouldn’t return the fixlets that have no relevant computers. You could limit that to the MSXX-XXX fixlets via

(preceding texts of firsts " " of name of it, names of applicable computers of it) whose (exists matches(regex("(^MS[[:digit:]]{2}-[[:digit:]]{3})") of item 0 of it) of fixlets of bes sites whose (name of it = "Enterprise Security") 

From there, you can count the number of each result

(it, multiplicity of it) of unique values of items 0 of (preceding texts of firsts " " of name of it, names of applicable computers of it) whose (exists matches(regex("(^MS[[:digit:]]{2}-[[:digit:]]{3})") of item 0 of it ) of fixlets of bes sites whose (name of it = "Enterprise Security")
2 Likes