Getting Started with Adobe After Effects - Part 6: Motion Blur
First Time? You can support us by signing up. It takes only 5 seconds. Click here to sign up. If you already have an account, click here to login.

TSQL Challenge 77 - Transforming monthly resource efforts into weekly actuals

9   Comments   

Unsubscribe from Notifications
  • All the effort amounts in the monthly periods beyond the last period must be added into the period corresponding to the planned finish date.

    There can be gaps in the monthly period sequence.

    truncate table TC77_Activity
    truncate table TC77_Effort
    
    INSERT INTO TC77_Activity(TaskID,Planned_Start,Planned_Finish)
    SELECT 1,'2012-02-19','2012-04-09'
    
    INSERT INTO TC77_Effort(TaskID,ResID,Period,Amount)
    SELECT 1,1,1,100.0 UNION ALL
    SELECT 1,1,2,100.0 UNION ALL
    SELECT 1,1,5,100.0
    

    I assume that period 5 must be added to april (not included in TC77_Effort), not to march (period 2).

    commented on Mar 7 2012 12:51AM  .  Report Abuse This post is not formatted correctly
    castling
    96 · 2% · 562
  • That's correct. The effort past the last period must go into the last period, whether that period has data or not. Thus you should get:

    1   1	2012-02-19	2012-02-01	9.1
    1   1	2012-02-26	2012-02-01	63.6
    1   1	2012-03-04	2012-02-01	27.3
    1   1	2012-03-04	2012-03-01	12.9
    1   1	2012-03-11	2012-03-01	22.6
    1   1	2012-03-18	2012-03-01	22.6
    1   1	2012-03-25	2012-03-01	22.6
    1   1	2012-04-01	2012-03-01	19.4
    1   1	2012-04-01	2012-04-01	11.1
    1   1	2012-04-08	2012-04-01	77.8
    1   1	2012-04-15	2012-04-01	11.1
    
    commented on Mar 7 2012 2:21AM  .  Report Abuse This post is not formatted correctly
    dishdy
    17 · 10% · 3262
  • How about efforts before the planned_start ?

    commented on Mar 7 2012 4:32AM  .  Report Abuse This post is not formatted correctly
    perolesen
    1554 · 0% · 12
  • There can be effort before the planned start - in a certain sense. This can happen for the week in which the planned start falls. But you should calculate the actual weighted by the number of days in that first week on or after the planned start date. For example, if the planned start is 2012-04-06 and the planned finish is 2012-05-25 then the first week is the week ending 2012-04-08 and only 3 days are involved. In this case, ther first period occupies 25 days and thus you must allocate 3/25 of the monthly effort as an actual to that first week. The same reasoning must be applied to the planned finish date.

    Thus the first week goes from 2012-04-02 to 2012-04-08 and it makes it look like there are actuals before the planned start date. But we weighted the actual to compensate for this.

    An even more special case is when the planned start and planned finish fall in the same month. For example, 2012-04-06 to 2012-04-20. This means the number of days in that month are only 15 and the first week gets 3/15, the second week gets 7/15 and the third week gets 5/15 of the monthly effort amount.

    commented on Mar 7 2012 5:00AM  .  Report Abuse This post is not formatted correctly
    dishdy
    17 · 10% · 3262
  • So if the plannedstart is 2012-04-06 and the plannedfinish is 2012-05-25 then there can be no effort in period 3 - and if there is, we can just skip this?

    And another question. Can Activities be in more than 1 year? If so how should a case with an activity with a plannedstart 2012-01-01 and a plannedfinish 2013-01-31 handle efforts is period 1?

    commented on Mar 8 2012 3:04AM  .  Report Abuse This post is not formatted correctly
    perolesen
    1554 · 0% · 12
  • Yes, there could be a monthly effort amount in period 3 (June). And your job is to put it into period 2 (May) and then do the weekly distribution.

    I don't understand your second question. Where exactly is the problem with an interval that's longer than 1 year? A period always refers to a month. Period 1 would be Jan-2012. Period 13 would be Jan-2013. There is no difference in handling such a case compared with one where the interval is less than a year.

    commented on Mar 8 2012 3:36AM  .  Report Abuse This post is not formatted correctly
    dishdy
    17 · 10% · 3262
  • Thanks for you answer. The reason for my question was that when I read the assignment, I only read "A period always refers to a real calendar month ..." and skipped this part "... with period 1 being the month of the planned start date".

    I will make a small change in the submission.

    commented on Mar 8 2012 4:05AM  .  Report Abuse This post is not formatted correctly
    perolesen
    1554 · 0% · 12
  • In the original sample data, how come Amount in the expected result is greater than the Amount in the Effort table? Bug?

    11.1 1 2012-03-04 2012-03-01 48.9 12.1 1 2012-03-11 2012-03-01 61.1

    Amount for Period 3 (March) is 50, but the expected result adds up to 110.

    commented on Mar 21 2012 5:11AM  .  Report Abuse This post is not formatted correctly
    Peso
    99 · 2% · 527
  • The challenge description states that any amounts that go beyond the last period must be placed into the last period. Thus 60 in period 4 is placed in period 3.

    commented on Mar 21 2012 6:18AM  .  Report Abuse This post is not formatted correctly
    dishdy
    17 · 10% · 3262

Your Comment


Sign Up or Login to post a comment.

Managed Windows Shared Hosting by OrcsWeb

Copyright © Rivera Informatic Private Ltd.