Count Expression in Visual Studio

I have this Output with Expression (HIT AND MISS)


Qty1 | Qty2 | HIT/MISS

10 10 HIT

15 14 MISS

20 20 HIT

23 23 HIT


HIT/MISS - has the Expression:

=Iif(Qty1.Value = Qty2.Value, “HIT”, “MISS”)

*now I need to COUNT the number of HIT and the Number of Items

output should be:


Qty1 | Qty2 | HIT/MISS

10 10 HIT

15 14 MISS

20 20 HIT

23 23 HIT

HIT: 3 / 4


3 hits in 4 items.

the hard part of this is that the Values are Group, meaning the 4 Values of Qty1 and Qty2 are just SUM of the Group Item.

when i used the code:

=CStr(Sum(IIF(Qty1.Value = Qty2.Value, 1,Nothing))) & “/” & CStr(Count(Qty2.Value))

the output shown counts all the Qty of the Qty1/Qty2 (i think because the items are grouped)

output:

HIT: 60 / 75

it should be:

HIT: 3/4

please help me achieve this output. thanks.

For reference, this question is already being discussed in a duplicate thread on another forum.