Totalizing bottle counts per shift with resets in between

Hello,

I need a PI AF logic that calculates bottle counts per shift from 5 am to 5pm and 5 pm to 5 am with counts reset in between. Bottle counts already exist in PI AF (tag is called 'Actual Good Units' from PLC). This tag resets up a few times during the shift with every work order change. This logic exists in the PLC but we are trying to have it on PI AF for scalability to other lines. Thank you,

Emerson