Assume that we have a project with the following data.
...
Formula | Output (In Browser) | Explanation |
---|---|---|
${entityme.id * 10} | 12340 | Id is multiplied by 10. |
entityme.id * 10 | entity.id * 10 | Not enclosed in ${} and hence copied to the output verbatim. |
${10* 10} | 100 | Formulas need not use variables. |
<b>${entityme.name}</b> | Test Project | You can use html tags. |
${entityme.name + 100} | ERR! | Cannot perform arithmetic on String type. |
<a href="http://mywikiserver/${entity.id}">Wiki Link</a> | Wiki Link | If you use a Wiki, you can create hyperlinks to pages in your Wiki. Notice that we have simply used the HTML Anchor tag to generate a hyperlink. |
${entityme.abcd} | ERR! | Formula contains error. No variable entity.abcd exists. |
${formatDate(entityme.start)} | Jan 10, 2011 | Formats the start date as per the user's date format style. |
${entityme.actualCost > (entityme.estimatedCost * .9) ? 'Cost Alert!' : 'Cost Ok'} | Cost Alert! | If...then.. logic |
${formatCurrency(entityme.budget)} | $ 5,000 | Assuming your currency symbol is $ |
...
- Accessing a custom field attached to Client in a formula attached to Task.
Let us say that you have a requirement to flag all tasks in a project where the custom field of client is rated as 1 as your 'High' priority tasks, 2 as 'Normal' tasks and 3 as 'Low' priority tasks. There is a custom field for Client which rates the client as 1 or 2 or 3 depending on the client's value to your business. The custom field is called 'Rating' and has a formula key 'client_rate'. Now, you need to create a custom formula field on task. Let us name this 'Task Importance'. The formula will look like this :
${entityme.project.client.client_rate == 1 ? (High) : ' ' || entityme.project.client.client_rate == 2 ? (Normal): ' ' || entityme.project.client.client_rate == 3 ? (Low) :' '}
Now if display 'Task Importance' column in a task report and you will know the importance of the task and can follow up accordingly.
Date Arithmetic
the task which impacted the project's deadline.
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 completetheir task.
of
For this, you need the Finish(Actual) date(me.actualFinishCalendar) of the task and the
Deadlineplanned finish date of the
project. Then, subtract these values to get the resultstask (me.finishCalendar).
dates
Since, these two fields areof type date, you cannot perform
directa direct operation on them. You need to
firstconvert them to a number and then perform the
operations. Create a formula field attached to task and get the field reference for the two fields i.e Finish (Actual) (entity.actualFinish) date of the task and Project's deadline (entity.project.deadlineCalendar). The formulaoperation. So, the formula will look like:
entity
${(me.
projectfinishCalendar.
deadlineCalendar.time.time -
entityme.
actualFinishactualFinishCalendar.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. The result is the extra or less days taken by the resources to complete the task. The PM can pick this custom field as a column in a task report to see the differenceDefine your own health indicators
Your company may have a different logic on how a budget/schedule status for your task/project is calculated. 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. To create such a field, do the following:
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. ${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> ${label}Code Block