Home / Blogs
Business Scenario: In General companies would set some targets to be achieved for their employees and based on the targets they achieve their rating would be decided.
For eg – For a sales executive, the target could be set based on the number of the products he sales –
Target Rating
2000 1
4000 2
6000 3
8000 4
10000 5
If the employee has achieved target say for eg. 3000, then how will we calculate the rating?
There are two ways for this – Interpolate Method and Step Method
Interpolate Method – This is SF recommended one. In this method system will calculate the rating automatically on proportionately for actual achievement.
Step Method – In this, the rating will be calculated based on the threshold value or based on the base target field.
In one Goal template we can either use interpolate method or step method but not both.
Metric Lookup Table
<field-definition id="metric-lookup-table" type="table" required="false" detail="true" viewdefault="on" showlabel="true" field-show-coaching-advisor="false" cascade-update="push-down" default-calc-type="interpolate" linearity="true">
<field-label>Metric Lookup Table</field-label>
<field-description>Metric Lookup Table</field-description>
<table-row-label>Metric Lookup</table-row-label>
<table-column id="achievement" type="number" required="false” cascade-update="push-down">
<column-label>Target Level</column-label>
<column-description>Target Level</column-description>
</table-column>
<table-column id="description" type="text" required="false" cascade-update="push-down">
<column-label>Description</column-label>
<column-description>Description</column-description>
</table-column>
<table-column id="rating" type="number" required="true" cascade-update="push-down">
<column-label>Rating</column-label>
<column-description>Rating</column-description>
</table-column>
<rating-scale default="true">
<rating-scale-id>EmpowerIT Madhav Rating Scale</rating-scale-id>
</rating-scale>
</field-definition>
Define actual achievement and Rating fields
<field-definition id="actual-achievement" type="number" required="false" detail="false" viewdefault="on" showlabel="true" field-show-coaching-advisor="false" cascade-update="push-down">
<field-label>Actual</field-label>
<field-description>Actual</field-description>
</field-definition>
<field-definition id="rating" type="number" required="false" detail="false" viewdefault="on" showlabel="true" field-show-coaching-advisor="false" cascade-update="push-down">
<field-label>Rating</field-label>
<field-description>Rating</field-description>
</field-definition>
Field Permission
<field-permission type="read">
<description><![CDATA[Everyone may read all public goal fields for everyone.]]></description>
<role-name><![CDATA[*]]></role-name>
<field refid="actual-achievement"/>
<field refid="rating"/>
</field-permission>
<field-permission type="write">
<description><![CDATA[The owner and manager may write to all fields for the employee's goals]]></description>
<role-name><![CDATA[E]]></role-name>
<role-name><![CDATA[EM]]></role-name>
<field refid="metric-lookup-table"/>
<field refid="actual-achievement"/>
</field-permission>
Plan Layout
<column weight="2.0">
<field refid="metric-lookup-table"/>
</column>
<column weight="1.0">
<field refid="actual-achievement"/>
</column>
<column weight="1.0">
<field refid="rating"/>
</column>
Custom Goal Score Calculations in Goal Plan
Based on the user need we may have to do some calculations in our goal plan.
For eg: If we have to calculate goal score as weight * rating we have to edit the xml code as follows -
Field Definition
<field-definition id="goal-score" type="number" required="false" detail="true" view default="on" show label="true" field-show-coaching-advisor="false" cascade-update="regular">
<field-label>Score</field-label>
<field-description> Goal Score </field-description>
<default-value>0.0</default-value>
<field-format>#.#</field-format>
</field-definition>
Note: Add the below calculation and mapping code after the permissions
Calculation
<calculator id="goalScore">
<![CDATA[(weight/100)*rating]]>
</calculator>
Map the Calculation with the rule
<auto-population field="goal-score" mode="auto">
<rule><calculated-result calculator-id="goalScore"/></rule>
</auto-population>
<calculator id="goalScore">
<![CDATA[(weight/100)*rating]]>
</calculator>
<auto-population field="goal-score" mode="auto">
<rule><calculated-result calculator-id="goalScore"/></rule>
</auto-population>
Add <goal-score> to field “Read”permissions
<field refid="goal-score"/>
Add <goal-score> to plan layout
<column weight="1.0">
<field refid="goal-score"/>
</column>
Note: Add a new goal then we will be able to see the change what we made