Hello,
I need to set up two columns to calculate some KPIs for a report.
The first one will show the status based on Case statement and date difference:
(select
case when DATEDIFF(day,WFD_AttDateTime3,getdate()) >0 then 0
when DATEDIFF(day,WFD_AttDateTime3,getdate()) = 0 then 1
else 2
end)
The second column should pick the number of instances that have the conditions
DATEDIFF(day,WFD_AttDateTime3,getdate()) = 0
DATEDIFF(day,WFD_AttDateTime3,getdate()) < 0
and then divide by the number of total instances by month.
Since this is kind of dynamic, I think that putting this calculation on the report side would be best, but I don't know how to configure the second condition.
Any thoughts?
Thank you! :)