When I put only formula for 'no-touch' rate is shows correct value (if 1 out of 3 cases meets criteria then it returns 33%). But if I add no of activities (total: 37) it changes to 46% (calculates no of activities within case that fulfils criteria and divides by all). Any tips how to come up with no of activities (37) in column A and correct ratio per case (33%) in B? Thanks in advance for any guidelines.
***
AVG(
CASE
WHEN PU_COUNT("VBAP","_CEL_O2C_ACTIVITIES"."USER_TYPE","_CEL_O2C_ACTIVITIES"."USER_TYPE" IN ('A','B','C')
AND "_CEL_O2C_ACTIVITIES"."ACTIVITY_EN" IN ('X','Y','Z')) = 0
THEN 1.0
ELSE 0.0
***
Case A # of Activities No Touch
A 17 yes
B 10 no
C 10 no