• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 537
  • Last Modified:

Change progress value


I have a progress value on my Goals and as tasks are completed, my Goal Completion value increases.

Goal Completion value should be affected by how long the duration of the task is and not by how many tasks there are within a goal.

eg. task that is 40 minutes would increase the progress more than a task that is only 10 minutes
and if there is lets say 10 tasks required to fulfil the goal then each task should not be
10% each as that wouldn't take into the duration of each task.

The duration per task task is in the format of 00:00:00  (hours, minutes, seconds)

I believe some kind of algorithm might be suitable, I did come up with a design that looks like this:

(see attached image)


Priority (supposed to mean order from highest to lowest)
so tasks that has the highest duration which will receive the highest number from the middle column.
The column on the left (supposed to mean number of tasks to fulfil goal).

Maybe I have confused you as it not well thought out.
At this stage, I don't have a magic formula.
So far my only solution is to keep writing down every possibility (middle column)
for x amount of tasks with x amount different sort order.

Thanks, any comments.

  • 4
  • 4
  • 2
4 Solutions
Geert GOracle dbaCommented:
priority and duration are 2 separate ideas
that's why your are getting wrong results

every task should have a priority and a duration
typically a duration exists of 3 types of time for the work:
  > setup time
  > process time
  > cleanup time

sample of creating a table with 4 legs:
  > setup time for 4 legs : (get wood, get paint, get paintbrush ...)
  > process time for single leg: mill leg into shape, paint, add accessories
  > cleanup time: store paint, clean brush

  > setup time for table top: get extra varnish, get extra brush
  > process time: cut table top in correct  size
  > cleanup: clean brush, store paint

afterwards you still have the assembly time

you can add priority to this: all setup, tabletop first, 2 legs first, partial assembly, 2 legs next, partial assembly, cleanup

see the differences between duration and priority ?
What is your input data ? As far as I understand, you need to set the 3rd column, that is a weight (mathematical) list for each task duration
from that, you can of course determine the Count (col1) and Col 2 is the same values expressed as %age of total time.

Col2 values from Col3 =>
first, calc total Weight : S := Sum ( Col3(i) )
Then Col2 (i ) = Col3 (i) / S *100

let's say you have Col3 values as an array of integer, and you want Col2 values as an array of float :

 TIntegerArray=Array of Integer; // integer Weigth of each task
 TDoubleArray=Array of Double;   // float %age of each task / total goal duration
procedure CalcTasksToGoalPercentage(TaskWeights:TIntegerArray;Var TaskGoalPercent:TDoubleArray);
 for i:=0 to High(TaskWeights) do S:=S+TaskWeights[i];
 for i:=0 to High(TaskWeights) do TaskGoalPercent[i]:=TaskWeights[i]/S*100;

Open in new window

Then you can calc the total goal duration, given each task completeness (%age, so also TDoubleArray)
function GetTotalGoalCompletion(TaskGoalPercent,TaskCompleteness:TDoubleArray):Double;
 for i:=0 to High(TaskWeights) do Result:=Result+TaskGoalPercent[i]*TaskCompleteness[i]/100; // adjust 2 %age multiplication by dividing/100

Open in new window

Geert GOracle dbaCommented:
i still say this is a design flaw
never use priority to indicate duration
priority has nothing to do with duration and vice versa
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

the term 'priority' is badly chosen, granted, but I think I understand the concept that is hidden behind what he says. 'Relative Importance' (workload-wise) would be better.
Look at the 3rd column compared to 2nd, for ex.
Line 2 : 1, 1 => Sum = 2 => 50% 50%  : Both task have same importance, so when you complete one, you acheive 50 % of total
all lines having a number of tasks of equal importance follow that same rule.
Line 10 : 1, 2, 1, 2 => Sum=6 => 1/6 , 2/6 , 1/6, 2/6
Line 6 : 1,2, 3, 4 => Sum=10 => 10, 20 , 30 , 40
=> That is exactly what the algo I proposed is doing.

Other lines are not giving same values as my algo, but close
Ex : Line 3 : 1, 2 => 33 , 66 instead of 40, 60
Line 5 : 1, 2, 2, 3 => Sum=8 => 12.5 , 25 , 25 , 37.5

AivsCoder said
At this stage, I don't have a magic formula.

He is not very sure of what he wants, which is why he is a bit confused and confusing, but is data suggests he needs some weighted mean distribution (see mathematical definition : http://en.wikipedia.org/wiki/Weighted_mean )
Geert GOracle dbaCommented:
i'll rephrase:

how long does it take you to paint 2 walls ?
please give me the result in percentage
if you know the length of the walls, and assume they have same height (or want to bother with it to calc surface), then you can evaluate the percentage of time it will take
AivsCoderAuthor Commented:
Thanks once again.

AivsCoderAuthor Commented:
Hey there,

Sorry yeah my design was terrible.
Spoke to my gf last night about it and was provided an excel solution which I used to recreate the design in Delphi. After looking at the answers, the answer epasquier provided was spot on.

Yes your right, the term priority was badly chosen. In fact, the design was terrible and I realised it later through the simplicity of it done in excel. :-)

One thing I had realised later that the stored TotalGoalCompletionValue had to be in seconds and not in percentage because if I later added a new task relating to that subgoal, it would have affected what each TasksToGoalPercentage value. So instead, only stored the seconds and recreated TotalGoalCompletionValue when needed.

Thanks heaps guys,
Sorry for the confusion.

Geert GOracle dbaCommented:
epasquier ... that's just it ...
i didn't mention the size of the surfaces

there was something missing in the equation ... it looks like Aivscoder found too something was missing
Look better at the data, Geert. It would seem you do not read very carefully my explanations either.

YES, GRANTED, Aivs definitions/questions where faulty. But with his data column 3 and 2, I found a relation between those that could be calculated (or close). So I decided that it was what he wanted, whatever the way he wanted to call it : get the %age of each task completion (toward total goal completion) with only a rough evaluation of each task importance compared to the other.
This importance is you walls Length or Area - You didn't have to mention it in the question, it was in the data.
You don't need to know anything else beyond that to get the relative %ages of each tasks.
Of course you will need another value to get the DURATIONs (either the first task real completion time once done, or before that the total time estimated that can be amended with the progress of the project)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 4
  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now