2 Replies Latest reply: Jun 23, 2016 6:14 AM by lebogang mashiloane RSS

    load data with when statement

    lebogang mashiloane

      Hi,

       

      I am trying to incrementally load data into a qvd from a database when the snapshot date isnt in the qvd already. I have this code:

       

      [MSXXTickets]:

      LOAD "Month",

          RegionCode,

          "Task type",

          Process,

          ServiceGroupCode,

          CountryName,

          State,

          ClientName,

          Number,

          NextStep,

          EnteredDate,

          Priority,

          SnapShotDate

          from [lib://Corporator\MSXXTickets.qvd] (qvd);

      when (select max(SnapShotDate)

      from "EDW_ManagedServices".zetl."SharedServices_CI_DW")

      not in (load "Month"from [lib://Corporator\MSXXTickets.qvd] (qvd))

      Concatenate

      SQL SELECT convert(char, "Month", 103) AS 'Month',

          RegionCode,

          "Task type",

          Process,

          ServiceGroupCode,

          CountryName,

          State,

          ClientName,

          Number,

          NextStep,

          EnteredDate,

          Priority,

          SnapShotDate

      FROM "EDW_ManagedServices".zetl."SharedServices_MSXX_Tickets_DW"

      where SnapShotDate = (select max(SnapShotDate)

      from "EDW_ManagedServices".zetl."SharedServices_CI_DW");

       

       

      STORE MSXXTickets INTO [lib://Corporator\MSXXTickets.qvd];

       

      if i cant do this is there a way to stop duplication of record. i tried using not exist(snapshotdate) and only got the database data and no qvd data.

       

      Lebo