Former Member

# Time Type Counting

Dear Experts,

I created a PCR to count the number of times the employee left early from work and add 1 in time type as per the attached file. The question is is it possible after 6 months this time type to return as 0 again and to start to count from the beginning.

Thanks,

Capture kabli.PNG (23.0 kB)
10|10000 characters needed characters exceeded

### Related questions

Posted on Dec 15, 2013 at 04:45 AM

Hi Omar,

You can control month and day in your time evaluation and rest the counter.

You can read current month / day in two ways.

HRS=BCURDY

HRS=BCURMO (Return current period from time evaluation period)

or

VARSTCURMO (Return current period from time evaluation period)

VARSTREDAY (Return current day from time evaluation period) or VARSTRDYnn (nn is a period from V_T549Q)

Regards,

Omid

10|10000 characters needed characters exceeded
• Omid Daghdar Former Member

Hi Omar,

What you would do this PCR?

If you put 1 for "Save as day balance" and "Cumulate in period balance" in time type definition in V_T555A system will reset it to 0 first of each period. So you have to put 1 in "Transfer prev. period" and restart it first day on 7th month.

Write a simple PCR and control 7th month and 1st day like what you have done in your PCR. Just make sure put this PCR before the PCR your counting early leave to make sure you will restart counter before use it for next 6 months.

You can set counter 0 like this: HRS=0 ADDDBZT0LZ (Z at end of ADDDB will initiate your time type)

Regards,

Omid

• Posted on Dec 14, 2013 at 07:11 PM

Create a second Time Type that will add 1 for each day of the year (HRS=Lxxxx HRS+1 ADDDB xxxx), and that resets itself after reaching 183.

Use that second Time Type to zero out the cumulative result of Time Type ZTOL when 183 was reached yesterday.

10|10000 characters needed characters exceeded
• Rémi Corriveau Former Member

For the "Left Early Counter Period", try the following

D HRS=Lxxxx HRS?183

* D HRS=Lxxxx HRS?0

* = D HRS=DZTOL HRS?0

* = * HRS=1 ADDDBxxxx (create counter because ZTOL exists today)

* = = (do nothing because counter not started and no ZTOL today)

= D HRS=DZTOL HRS?0

= * HRS=1 ADDDBxxxx (reset counter to 1, counter was183 days and ZTOL exists today)

= = (do nothing because counter was183 days and no ZTOL today)

And in pcr ZTOL, I would replace HRS=1 ADDMBZTOL by a decision on last xxxx in relation to 183.

For return value * use HRS=Lxxxx HRS+1 ADDDBZTOL, while for return value = use HRS=1 ADDDBZTOL.

• Former Member
Posted on Dec 18, 2013 at 11:28 AM

Hi Experts,

I really need a solution for the above case ASAP.