Calculate the urgency of a task from two variables

I am trying to calculate a formula for calculating the urgency of a set of arbitrary tasks based on the number of days before the "deadline" and completion of the% task.

So far I have a "function" that gives an idea:

U = ((dd * 25) - (100 - cp))

Where: 
dd = Day difference from deadline to current date (in an integer value)
cp = current completion % (in an integer value - in increments of 5 currently)

This gives me a linear function, and function 25 indicates a 25% progression of the task.

So, on any given day:

Where U <0 task is urgent
Where U =0 task is on schedule
Where U >0 task is ahead of schedule
(The actual display on if a task is on schedule (within a range) would be handled separately)

Are there any other methods for calculating the urgency of a task, from the difference of two dates and a weighted variable? From current answers: Using differences start date, end dateand current date, and also% completion to calculate urgency

U cp > 75% U, cp < 75%. - ?

MySQL javascript, , U. , ( , ) U, , .

, ( ):

((((((end_date - now) / (end_date - start_date)) * 100) * (100 - cp)) * 10) * -1)

rule of three , 10, , float. -1, , , ( : , , ) , , , , . , -, ( ) .

, MySQL, IFNULL (- )

IFNULL( *function* ,-200)

-200, ( )

+5
1

, :

  • - - .
  • - ,
  • -

:

var rest = estimated / 100 * (100 - done);

if(due < rest) {
    state = 'behind';
}
if(due == rest) {
    state = 'on';
}
if(due > rest) {
    state = 'ahead';
}

, , , " ", , , rest < due + 0.5 && rest > due - 0.5 , .

+2

All Articles