1 Reply Latest reply: May 27, 2011 5:33 PM by Gabriela Morales RSS

    How to exclude data in load based on another QVD?

      Is there a way to exclude data being loaded from one QVD based on values in another QVD?  Sample code is below.  What I am trying to do is when I load the DetailTable, exclude records that have certain values in masterCategory.  masterDetailLink and detailLink can be used for the lookup.

       

      For example, if detailLink (which corresponds to masterDetailLink) exists in the Master.qvd file with a value of 'M' or 'R' for masterCategory, then the record should not be loaded from the Detail.qvd file.  If the masterCategory is anything other than 'M' or 'R', it should be loaded.

       

      Any help is much appreciated!

       

       

       

      MasterTable:
      LOAD
           masterCode,

           masterDetailLink
           masterCategory
      FROM
      [C:\QVD\Master.qvd]
      (qvd)

      DetailTable:
      LOAD
         
          detailCode,
          detailName,
          detailValue,

          detailLink as masterDetailLink

         
      FROM
      [C:\QVD\Detail.qvd]

        • How to exclude data in load based on another QVD?

          Hi,

           

          For this you can use the function exists(), it should be something like this:

           

          MasterTable:
          LOAD
               masterCode,

               masterDetailLink
               masterCategory
          FROM
          [C:\QVD\Master.qvd]
          (qvd)

           

          DetailTable:
          LOAD   
              detailCode,
              detailName,
              detailValue,

              detailLink as masterDetailLink   
          FROM
          [C:\QVD\Detail.qvd]

          where not exists(masterDetailLink);

           

          Hope this helps

           

          Regards!