Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Date Arithmetic
    Let us assume that one of the projects where you are a PM has completed. Now, you want to compare which of your resources, took more days to complete the task due to which the project's deadline was not met. For this, you need the Actual (Finish) date of the task and the deadline of the project. Then, subtract these values and you will get the results. Since, these two fields are dates, you cannot perform direct operation on them.  You need to first convert them to a number and then perform the operations. Create a formula field for task and get the variable for the two fields i.e  Actual (Finish) (entity.actualFinish) date of the task and Project's deadline (entity.project.deadlineCalendar). Then, the formula will look like:
    ${(entity.project.deadlineCalendar.time.time - entity.actualFinish.time.time)/86400000}

    When you write ".time.time" it means that the date field is first converted to milliseconds for both the fields, then the subtraction is done. The result is again in milliseconds which needs to be converted again in days and hence, it is divided by 86400000. This gives the extra or less days taken by the resources to complete the task due to which the deadline was affected.

  • Define your own health indicators
    Your company may have a different logic on how a budget/schedule status for your task/project is calculated and so you do not wish to use the one provided by us. Lets take an example that you actually want the schedule status to show the status depending on the baseline dates; instead of the projected dates. Then,

    your formula will look like:


      a) You need to create a formula field which will have the below formula
      b) The Output type of the custom field will be Text
      c) Attach the custom field to 'Task' or the entity for which you want to create the custom field.
      d) The field references like entity.projectedFinishCalendar.time.time, entity.baselineFinish.time, etc can be taken from the Field References tab.

    Code Block
    ${set ("label", 'Unknown')}

    
    ${set ("label", entity.projectedFinishCalendar.time.time <= entity.baselineFinish.time && entity.percentComplete!=100 ? 'On Time' : label)}

    
    ${set ("label", entity.percentComplete!=100 && Date.now().time > entity.baselineFinish.time ? 'Overdue' : label)}

    
    ${set ("label", entity.projectedFinishCalendar.time.time > entity.baselineFinish.time && Date.now().time < entity.baselineFinish.time ? 'At Risk' : label)}

    
    
    ${set ("color", 'Neutral')}

    
    ${ set ("color", label eq 'On Time' ? '#008000' : color)}

    
    ${ set ("color", label eq 'At Risk' ? '#FFA500' : color)}

    
    ${ set ("color", label eq 'Overdue' ? '#FF0000' : color)}

    
    
    <span style="display:inline-block;width:10px;height:10px;background-color:${color} ;border-radius:5px;"></span>&#160;${label}

...