Hi All , I am facing one issue. I am doing the attrition Report. and calculating Attrition Rate. Attrition rate = (Number Of Attrition or Number Of Employee Left * 100)/ (Actual Employees + New Joined)/100 In that report i am giving the Valid From date filter for a particular month and i am getting the count of the employees who are all employed. Means the employees whose employee status is "Employed". But similarly the employees who left (The employees whose status is "Terminated") for these employees i am not getting the count of these employees. . Only '0' is coming for any month filteration. Any help is appreciated. Thanks in advance. And this is the job code i have written static void attritionReport(Args args) { HcmWorker hcmworker, hcmworker1; HcmEmployment hcmemployment, hcmemployment1; ITTI_Attrition_Temp attritiontemp, attritiontemp2; HcmWorkerStatus workerStatus = HcmWorkerStatus::Terminated; int counter1=0, counter2=0 ; utcdatetime now = DateTimeUtil::utcNow(); utcdatetime maxDateTime = DateTimeUtil::maxValue(); utcDateTime date1 = DateTimeUtil::newDateTime(1\7\2015, 0); utcDateTime date2 = DateTimeUtil::newDateTime(31\7\2015, 0); while select hcmemployment join hcmworker where hcmemployment.Worker == hcmworker.RecId { if( hcmemployment.ValidFrom >= date1 && hcmemployment.ValidFrom <= date2 && hcmworker.workerStatus()== HcmWorkerStatus::Employed) { counter1++; attritiontemp2.ITTI_NoOfEmployees = counter1; } else if(hcmemployment.ValidTo <= now && hcmworker.workerStatus() == HcmWorkerStatus::Terminated && hcmemployment.RecId != 0) { counter2++; attritiontemp2.NumberOfLeftEmployees = counter2; } } info(strFmt("%1, %2" , counter1, counter2)); attritiontemp2.insert(); } In the above code, and in the above date filter range total 6 employees are there. 5 are employed and 1 is Terminated. I am getting 5. But not getting Terminated employee count Instead of 1 , zero is coming in the info.
*This post is locked for comments