Okay, the calculation for the Defect Extent score is based on the right character of the code. The score increases as the letter 'increases', so we can calculate a score from that letter. In the first version, we take the ASCII code of the right character - for example, the ASCII code for the letter "E" is 69. We wanted that to be 5, so we subtracted 64 from that code:
Now, we want E to score 3, so we could simply change the number subtracted from the ASCII code, to 66, so that E scores 3:
But now - the letter A has an ASCII code of 65, so this revised formula would return -1 for code SA. So we need to modify slightly, so that the score returned is never lower than 0:
This is the corrected formula for the change to your Defect Extent scoring.
The UDF version of this would then become:
An alternative approach, in the UDF, which may make it simpler for you to adjust the logic / scores, would be to explicitly state each Defect Extent value, and assign a score manually:
I hope you followed all that!! Shout if you need further help with it.
Bookmarks