Calculating Percentage of Time Above a Threshold in Specific Time Periods Using PI Performance Equation

Guys,

A client asked us to create a calculation tag in the PI Performance Equation with the following logic: for example, the tag

KPI_VC_T6005.PV

 

should calculate the percentage of time the tag

T6005.PV

remained above 645 during the periods (07:00-15:00, 15:00-23:00, and 23:00-07:00). Could you help me understand how I can implement this logic in the PI Performance Equation? I’ve never worked with this type of calculation in a tag before.