• Thanks for the reply..

    I Have written my own logic which is below...

    In this logic... I'm unable to do much for the missing month Between Actual and Forecast series..

    The Logic is Actual till the current and forecast From the Current month till the last month of the data present in the database. Actual n Forecast cummulate the values..

    Is there any solution for Missing Between Actual and Forcast

    Declare @date DATETIME

    Set @date = GETDATE()

    DECLARE @metric TABLE(mdate DATETIME, value FLOAT, item VARCHAR(100),item_name VARCHAR(150))

    INSERT INTO @metric

    SELECT m.mdate,m.value, mt.item_name,

    CASE WHEN mt.item_name = 'Planned Commitment' THEN 'Planned Commit'

    WHEN mt.item_name = 'Actual Commitment' AND mdate < @date THEN 'Actual Commit'

    WHEN mt.item_name = 'Forecast Commitment' AND mdate > @date THEN 'Actual Commit'

    WHEN mt.item_name = 'Planned Expenditure' THEN 'Planned Expen'

    WHEN mt.item_name = 'Actual Expenditure' AND mdate < @date THEN 'Actual Expen'

    WHEN mt.item_name = 'Forecast Expenditure' AND mdate > @date THEN 'Actual Expen'

    END AS ITEM_NAME

    FROM View_Metric_Template mt

    INNER JOIN View_Metric_Instance mi ON mt.metric_template_id = mi.metric_template_id

    INNER JOIN fn_Metrics(null, null) m ON m.metric_instance_id = mi.metric_instance_id

    WHEREmt.item_id = m.template_item_id

    AND mi.linked_project_id = 'fs000080000jbf28mna0000000'

    AND mt.locale_id = N'en'

    AND mt.template_name = 'PS - Commitment Expenditure'

    AND mt.item_name IN ('Planned Commitment','Actual Commitment','Forecast Commitment','Planned Expenditure','Actual Expenditure','Forecast Expenditure')

    SELECT mdate AS mdate1,

    REPLACE(RIGHT(CONVERT(VARCHAR(9), mdate, 6), 6), ' ', '-') AS mdate,

    CASE item WHEN 'Planned Commitment' THEN 'Plan Comit'

    WHEN 'Actual Commitment' THEN 'Actual Comit'

    WHEN 'Forecast Commitment' THEN 'Forecast Comit'

    WHEN 'Planned Expenditure' THEN 'Plan Expen'

    WHEN 'Actual Expenditure' THEN 'Actual Expen'

    WHEN 'Forecast Expenditure' THEN 'Forecast Expen'

    END AS item_name,

    value,

    (SELECT SUM(value) FROM @metric WHERE item_name= m1.item_name AND mdate <= m1.mdate) AS Cummulative_Value

    FROM @metric m1

    ORDER BY mdate1, item desc