Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi ,
I am facing an issue .
we have an some target which are defined at weekly level and activity are performed to reach that target .
IF we have sum(target)<count(activities performed) then we rae calculating It as hit .
For this I am creating a table using below code
Hit: load Week_No, Month, Year, if(sum(Activity_Target)<count(ActivityId) or count(ActivityId)<> 0,1,0 )as HitRate Resident Activity_Fact Group by Week_No , Month,Year
But the issue is when both the target and activity is zero it count activity as 1 and put it as hit .
How do I alter the code to remove as a hit when value for both is 0
if( alt(sum(Activity_Target)<count(ActivityId),0)<>0 or count(ActivityId)<> 0,1,0 )as HitRate