How indicator scores are calculated in APM module.

RajatChoudhary
Giga Contributor

In Application portfolio management module, we have a scoring profile and in that scoring profile there are 10 indicators. I need to know how the various values are calculated.Such as:

Normalised Value

Application weight

Target minimum

Target maximum 

Indicator Score 

I refered one SNOW Doc normalisation of indicators, but my calculated value and value present in indicator score table are not matching. 

Any help is highly appreciated. 

Thanks in advance. 

 

1 ACCEPTED SOLUTION

RajatChoudhary
Giga Contributor

Indicator name: Application New problems

Indicator description: Created script for problem count attached to Business applications.

find_real_file.png

Logics and formulas used: Below script is used to calculate the weight(Application Indicator script o/p)

 var results = {};

 var applications = [];

 var problemCount = 0;

 

 var applicationsGr = new GlideRecord("cmdb_ci_business_app");

 applicationsGr.addQuery('active', true);

 applicationsGr.query();

 

 //for each application get Problem count at business service level

 while (applicationsGr.next()) {

                problemCount = 0;

               

                var gr = new GlideAggregate('problem');

                gr.addQuery('cmdb_ci_business_app', applicationsGr.getUniqueValue());

                gr.addEncodedQuery("opened_atBETWEEN"+startDate+"@"+endDate);

                gr.addAggregate('COUNT');

                gr.query();

               

                if(gr.next()) {

                problemCount = gr.getAggregate('COUNT');

                }

                 

                var appInfo = {};

                    appInfo.appId = applicationsGr.getUniqueValue();

                    appInfo.weight = problemCount;

                    applications.push(appInfo);

                }

 results.applications = applications;

 results;

Then this weight is used to calculate the Normalized value using below OOB job Load Application Indicators and compute Application Scores (function:new sn_apm.APMScoreUtils().populateAppScores();) having below logic:

if (minWeight == maxWeight || appWeight >= maxWeight) {

    normalizedValue = 10;

} else if (appWeight <= minWeight) {

    normalizedValue = 1;

} else {

    normalizedValue = (((((appWeight - minWeight) / (maxWeight - minWeight))) * 9) + 1); //{(((X - Xmin)/(Xmax - Xmin)) * 9 ) + 1}

}

}

 

if (indicatorGr.direction == 'minimize') {

    normalizedValue = (10 - normalizedValue) + 1;

}

Generated Indicator score :

find_real_file.png

Calculated Indicator score:

Application Id:10680

Application weight(from the highlighted script): 2

Reasons: There are two records of Application id 10680 in problems table in m1 2020.  

find_real_file.png

Note: If the Target maximum and Target minimum are not set, then the maximum value within the range of applications is taken as the target maximum value. Similarly, the minimum value within the range of applications is taken as the target minimum value.

Target Minimum: 0

Target Maximum: 3

Normalized value:2/3*9+1=(As direction is minimized)10-7+1=4

Indicator Score: 0.4

Application profile weightage is then applied on the Normalized value to derive the Indicator Score:

Normalized Value * Weightage as in application score profile %

=4* (10%)=0.4

10% as there are 10 indicators in Global scoring profile and each has weightage of 10%.

View solution in original post

3 REPLIES 3

RajatChoudhary
Giga Contributor

Indicator name: Application New problems

Indicator description: Created script for problem count attached to Business applications.

find_real_file.png

Logics and formulas used: Below script is used to calculate the weight(Application Indicator script o/p)

 var results = {};

 var applications = [];

 var problemCount = 0;

 

 var applicationsGr = new GlideRecord("cmdb_ci_business_app");

 applicationsGr.addQuery('active', true);

 applicationsGr.query();

 

 //for each application get Problem count at business service level

 while (applicationsGr.next()) {

                problemCount = 0;

               

                var gr = new GlideAggregate('problem');

                gr.addQuery('cmdb_ci_business_app', applicationsGr.getUniqueValue());

                gr.addEncodedQuery("opened_atBETWEEN"+startDate+"@"+endDate);

                gr.addAggregate('COUNT');

                gr.query();

               

                if(gr.next()) {

                problemCount = gr.getAggregate('COUNT');

                }

                 

                var appInfo = {};

                    appInfo.appId = applicationsGr.getUniqueValue();

                    appInfo.weight = problemCount;

                    applications.push(appInfo);

                }

 results.applications = applications;

 results;

Then this weight is used to calculate the Normalized value using below OOB job Load Application Indicators and compute Application Scores (function:new sn_apm.APMScoreUtils().populateAppScores();) having below logic:

if (minWeight == maxWeight || appWeight >= maxWeight) {

    normalizedValue = 10;

} else if (appWeight <= minWeight) {

    normalizedValue = 1;

} else {

    normalizedValue = (((((appWeight - minWeight) / (maxWeight - minWeight))) * 9) + 1); //{(((X - Xmin)/(Xmax - Xmin)) * 9 ) + 1}

}

}

 

if (indicatorGr.direction == 'minimize') {

    normalizedValue = (10 - normalizedValue) + 1;

}

Generated Indicator score :

find_real_file.png

Calculated Indicator score:

Application Id:10680

Application weight(from the highlighted script): 2

Reasons: There are two records of Application id 10680 in problems table in m1 2020.  

find_real_file.png

Note: If the Target maximum and Target minimum are not set, then the maximum value within the range of applications is taken as the target maximum value. Similarly, the minimum value within the range of applications is taken as the target minimum value.

Target Minimum: 0

Target Maximum: 3

Normalized value:2/3*9+1=(As direction is minimized)10-7+1=4

Indicator Score: 0.4

Application profile weightage is then applied on the Normalized value to derive the Indicator Score:

Normalized Value * Weightage as in application score profile %

=4* (10%)=0.4

10% as there are 10 indicators in Global scoring profile and each has weightage of 10%.

Hi Rajat,

 

Can you help me how total weight is being calculated?  Should it not match with total application wight?

RajatChoudhary
Giga Contributor

After lots of RND I found that how Application overall score and Indicator scores are calculated in APM ServiceNow..