CAST Engineering Dashboard - Information - How to calculate variation displayed in INVESTIGATION VIEW

Purpose

This page explains how to calculate variation displayed in INVESTIGATION VIEW :

Applicable in CAST Version

ReleaseYes/No
8.3.x
8.2.x
8.1.x
8.0.x
7.3.x
7.2.x
7.0.x

Applicable RDBMS

RDBMSYes/No
Oracle Server
Microsoft SQL Server
CSS2
CSS1

Details

Formula :

Variation in % = (grade of cur snapshot - grade of prev snapshot) / grade of prev snapshot * 100

Example :

Grade for Health Factor Technical Quality Index in previous snapshot:

Grade for Health Factor Technical Quality Index in current snapshot:

If Grade in previous snapshot is 2.53 & the grade in the current snapshot is 2.15 then the calculation of variation in the current snapshot according to the formula will be

(2.15-2.53)/2.53*100 = -15.01 %

For getting the values,  grade of curent snapshot and grade of previous snapshot perform the following steps:

  1. Identify the metric id from table metric_description:

SELECT metric_id,         metric_description  FROM   dss_metric_descriptions  ORDER  BY metric_description


    For example If we search for the metric id of Robustness, we find:  
   ![](https://doc-data.castsoftware.com/TG/attachments/566528935/566528936.png)
2. Once you get <metric\_id>, you can run the following query to get the values associated to the latest and previous snapshot:

   ```sql
SELECT O.object_name, 
       R.snapshot_id, 
       T.metric_name, 
       S.snapshot_name, 
       R.metric_num_value 
FROM   dss_metric_results R, 
       dss_metric_types T, 
       dss_snapshots S, 
       dss_objects O 
WHERE  R.snapshot_id = S.snapshot_id 
       AND R.metric_id = T.metric_id 
       AND R.snapshot_id IN (SELECT DISTINCT snapshot_id 
                             FROM   dss_snapshots) 
       AND T.metric_id = <metric_id> 
       AND R.object_id = O.object_id 
       AND R.object_id = 3 
       AND R.metric_value_index = 0 
ORDER  BY T.metric_name, 
          R.snapshot_id DESC

 For example if we search for the grade of curent snapshot and grade of previous snapshot of robustness, we find:

Notes/comments

Related Pages