Copy link to clipboard
Copied
Hi Experts,
I have a requirement as follows.The below sheet shows the value from 1.a to 9.a
When I select High in 1.a then the value should be 1.4 and when selecting 2.a as medium then it should multiply the value of SD 2 (15* 1.a weight), similarly for other questions too.
1.a | Reason1 | High | NA | NA | High - Weight = 1.4 |
2.a | Reason2 | Major | 100 | 100 | Major (100) - System will be unavailable for 1 or more business days during operating hours |
3.a | Reason3 | SBU | 15 | 20 | Enterprise (20) - Weight = 1.4; More than 50% of population is affected, 2 or more SBU's are affected, 2 or more locations |
4.a | Reason4 | Several Features | 6 | 21 | Extensive (15 * 3.a Weight) - Changes on the user interface including change in screen flow/major functionalities. Training required. |
5.a | Reason5 | Yes Major | 21 | 21 | Yes Major (15 * 1.a Weight) - Degradation >= 20% |
6.a | Reason6 | Yes Minor | 2 | 5 | Yes Major (5) - Multiple documents |
7.a | reason7 | No | 0 | 12 | Yes Major (15) - Multiple HP Applications |
8.a | Reason8 | Yes | 0 | 100 | Yes (0) - Low |
9.a | Reason 9 | No | 0 | 100 | Yes (100) - High |
Based on this questions the impact should be calculated. If the score of above questions are then the Risk field should be High if value is between 80-100 .
Change Category | Major |
| ||||||||||||||||
IT Area | Max Rating | Total Rating | Impact Rating |
|
| |||||||||||||
Team 1 | 379 | 144 | High | |||||||||||||||
A New field to be created which captures the risk value.
Copy link to clipboard
Copied
Do you have a specific question, or do you expect us to write your entire script for you?
Copy link to clipboard
Copied
Hi
I need the logic of the script.
Copy link to clipboard
Copied
You place the value of the fields to be used in the average into an array. Next filter out unwanted data element if needed, like empty elements. Now sum the elements of the array. Divide the sum of the elements in the array by the number of items in the array and assign the result to the field for the result;
A function like will compute the average of the values in an array of values.
function average(data){
// computes the average of the values within an array;
var sum = data.reduce(function(sum, value){
return sum + value;
}, 0);
var avg = sum / data.length;
return avg;
} // end function average;
The above is the JavaScript syntax for the computation. I assume you understand how to get field values and add the values to an arraty. If needed you can use the array filter method or prototype to remove unwanted data elements.
Copy link to clipboard
Copied
You need to create a custom calculation to sum the values and count the number of items to be used in the calculation, not all "averages" use the total number of entries, and divide the sum by the number items used or needed for computing the average as long as that number is not zero
There a number of JavaScript sites that provide user written functions for calculating various statistics.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more