--------------------------------------------------------
--  DDL for View V_EVA_VG
--------------------------------------------------------
CREATE OR REPLACE VIEW "V_EVA_VG" (
  "M_PROJECT_ID", "M_REPORT_ID", "M_TASK", "M_MONTH", "COSTS_ACTUAL_CUM_TASK", "BL_COSTS_PLANED_CUM_TASK", "EV_CUM", "SV_CUM", "CV_CUM", "SPI_CUM", "CPI_CUM")
AS 
  SELECT
    PROJECTID M_PROJECT_ID,
    REPORTID M_REPORT_ID,
    TASK M_TASK,
    TIMESLICE M_MONTH,
    CML_AC COSTS_ACTUAL_CUM_TASK,
    CML_PC_BL BL_COSTS_PLANED_CUM_TASK,
    EV EV_CUM,
    SV SV_CUM,
    CV CV_CUM,
    SPI SPI_CUM,
    CPI CPI_CUM
  FROM DT827_CONDENSED
  WHERE DENSITYRATIO = 2 -- = VG
    AND EXISTS (SELECT 1 FROM DT823 s WHERE s.DI008413 = PROJECTID AND s.DI008416 = REPORTID AND s.DI041716 IS NOT NULL) -- status report has a corresponding baseline
;/
