I created the following percentage KPI:
select (select count(*) from workorder where (woclass = 'WORKORDER' and siteid = '500' and (status = 'CLOSE' or status = 'FMCOMP') and reportdate >= trunc(sysdate, 'MM') and istask = 0 and (worktype = 'PM' or worktype = 'PMCAL'))) / (select count(*) from workorder where (woclass = 'WORKORDER' and siteid = '500' and (status = 'READYTW' or status = 'WAPPR' or status = 'WSCH' or status = 'WPLAN' or status = 'COMP' or status = 'INPRG' or status = 'CLOSE' or status = 'FMCOMP') and reportdate >= trunc(sysdate, 'MM') and istask = 0 and (worktype = 'PM' or worktype = 'PMCAL'))) *100 from dummy_table
It is returning 0. The first select statement on its own returns 31, and the 2nd returns 418. So, in theory this entire statement should return 7.4. Not sure what is wrong with this.