### Portfolio Waterline Ranking Selector

book

calendar_today

#### Products

Clarity PPM SaaS Clarity PPM On Premise

#### Issue/Introduction

The Portfolio Contents are ranked and displayed in a ranking order on the Waterlines tab.  The Portfolio, by default, will not have any Ranking Rules defined.  This guide explains how the Portfolio content investments are ranked when no rules are defined, when multiple investments generate the same or matching ranking score and when ranking rules are defined.

### How the Score is calculated when No Ranking Rules are defined

The contents of the Portfolio are stored in a Portfolio Investment table.  The default ranking uses the Portfolio Investment Status in descending order, the Portfolio Investment Schedule Finish Date and then the Investment ‘code’ value.

### How the Score is calculated when Investments have Matching Scores

With ranking rules, the ultimate tie breaker is the primary key of the Portfolio Investment table as the default sort order is not used. However, it is always a best practice to define tie breaker attributes in the Ranking Rule definitions.

### How the Score is calculated based on defined Ranking Rules

The score is calculated by normalizing each optimization parameter on each investment item to a value between 0 and 10.

The formula to normalize is as follows:

normalizedValue = ((value - min) / (max - min)) * 10

value = the optimization parameter value on the instance

min = the minimum value of the optimization parameter of all instances in the set to be ranked

max = the maximum value of the optimization parameter of all instances in the set to be ranked

Once the optimization parameter value on the instance has been normalized, the Rankinig Rule ‘Attribute Weighting’ (weight) value and the Ranking Rule ‘Ranking Method’ (optimizeHigh) value are applied to get the final score of that parameter on the instance.

This is done using the following calculation:

parameterScoren = weight * (optimizeHigh ? normalizedValue : (10 - normalizedValue))

The final score for the investment instance is the sum of all the calculated optimization parameter scores.

finalScore = SUM(parameterScore1 + parameterScoren)

### Calculation Notes

There are few scenarios that need to be called out in this scoring:

• If the min = max then the optimization parameter's score will just be the weight.
• If there is only one optimization parameter and it is optimized high then the value of that parameter is the score for the optimization parameter.
• Lookups are supported. The administrator must set up a numeric enumeration on the lookup codes. This is done in the UI using the Lookup weighting values link within the Ranking Rule definition. If no enumeration is set up, the score for the lookup will be 0.
• Date attributes are supported. The value of the date attribute is the Julian day value as computed by the application date Java class. The routine creates the Julian day using this algorithm, where the year, month and day are standard numbers from a Java calendar instance:
` if (year == 0 && month == 0 && day == 0) return 0;`
` if (year < 82) year += 2000  else if (year < 100) year += 1900;`
` if (month > 2) month -= 3  else {month += 9; year--;}`
` int c = year / 100;`
` int ya = year - 100 * c;`
` return ((146097 * c) >>> 2) + ((1461 * ya) >>> 2) + (153 * month + 2) / 5 + day - 693900;`

## A Portfolio Example

A portfolio with 10 investments is created.  Ranking Rules are defined to the portfolio as follows:

<Please see attached file for image> Here we want to rank the investments according to their alignment and priority values, giving more weight to the alignment value. A higher alignment value generates scores higher than a lower alignment value. A lower priority value generates scores higher than a higher priority value.

Here is how the example investments are defined with their alignment and priority values.

<Please see attached file for image> Looking at the first investment and applying the formulas for calculating the scores for each optimization parameter we get the following

‘Development’ investment

parameterScore = weight * (optimizeHigh ? (((value - min)/(max - min)) * 10) : (10.0 - (((value - min)/(max - min)) * 10)))

Alignment parameterScore = 6.0 * (((4 - 2) / 15 - 2)) * 10) = 9.2308

Priority parameterScore = 2.0 * (10.0 - ((( 3 - 1) / (10 - 1)) * 10)) = 15.5556

finalScore = 9.2308 + 15.5556 = 24.7864

Running the rules over the entire portfolio yields the following ranked investments. Notice how the weighted alignment drives the ranking with similar alignment values being driven by the lower priority value.

<Please see attached file for image> ## Logging the Scores

The Rank Selector will write the ranking scores of the Ranked Items along with the portfolio investment contents primary key ID to the application log file if you enable the following category in the Logs, Edit Configuration page:

1. Login to the System Administration application (CSA) or navigate to ‘security.logs’ page
2. Click ‘ADD CATEGORY’ button
3. In the new row type ‘com.ca.clarity.ranking.RankSelector’ into the ‘Other Name’ field
4. Appender = STDOUT (app-ca.log)
5. Priority = Debug
6. Additive = unchecked (false)
7. Click ‘SAVE’ button
8. Go into the Portfolio, Waterlines Tab page
9. Click on the ‘Ranking Rules’ icon in the ribbon menu, click ‘Run Ranking Rules’
10. Open the standard output application log file and see a message with the ranking score

DEBUG 2014-11-20 18:39:30,161 [http-bio-80-exec-4499] ranking.RankSelector (clarity:admin:6423073__1AC10E59-D835-4792-989E-33115B62C688:pfm.runRankingRules) Score for ranked item with pk = 5015087 is 24.786324786324787

The ‘pk = 5015087’ cooresponds to the internal record id of the Portfolio Contents Investments table.

To obtain the name of the investment, use the following query:

SELECT CODE, NAME, ODF_OBJECT_CODE Investment_Type

FROM INV_INVESTMENTS

WHERE ID = (SELECT INVESTMENT_ID FROM PFM_INVESTMENTS WHERE ID = 5015087) ;

#### Environment

Release: ESPCLA99000-13.2-Clarity-Extended Support Plus
Component:

#### Attachments

1558720697460000056516_sktwi1f5rjvs16vrj.png get_app
1558720695511000056516_sktwi1f5rjvs16vri.png get_app
1558720693530000056516_sktwi1f5rjvs16vrh.png get_app