• Arno Ho (7/11/2014)


    Hi,

    Your algorithm is faster than mine but it does not fully meet my expectations

    We need to calculate the hours scheduled and that is really the hours worked by each agent.

    -> 11/07/2014 the agent has 7h45 to do and really did 7h32

    With the current method I calculated once the 2 numbers (expected and realized).

    With the proposed method, I do two queries: one for expected and for real

    Observing customer data I found that the share of days and forced absences were very low: 5%. But this systematic calculation consumed much time.

    1 / I added a field to the table officers to indicate those constraints holders and for those with absences

    2 / I will update this field (a few seconds)

    3 / I loop agent (too complex to review the whole process in the state)

        I calculate for each

      

        3.1/ expected for daily attendance. I record the results (expected , real= expected )

        3.2/ if the agent has constraints then I calculate the scheduled day forced. I update (column expected=new expected, real=new expected)

        3.3/ if the agent absences, I realized the Cacule for days of absence. I update (column real only)

    It's divise the SQL time by 2 and there's less impact on the log

    Thank's for your help

    Arno

    Not exactly sure how it doesn't meet your requirements other than I don't display the always expected 450 minutes. That is actually a static value if there are no absences based on the data you provided. The rest you state above doesn't appear to be anything you specified in your requirements.