4 Replies Latest reply: Sep 20, 2016 1:13 PM by Stefan Wühl RSS

    missing data on load

    Robert Winkel

      Trying to limit data pull with where statement

      it works with just this Where FGName = 'Bria Management'

      But when I add the AND nothing comes over or it errors out

       

      [FacGroupDefs]:
      LIB CONNECT TO [pharmoresql production (pharmore_rwinkel)];
      LOAD FGID,
        FGName;

      SQL SELECT  FGID,
        FGName
      FROM "Fac"."dbo"."FacGroupDefs"

      Where FGName = 'Bria Management'
      AND FGName = 'Carr'
      AND FGName = 'DAAS Management';

       

        • Re: missing data on load
          Stefan Wühl

          A single input record can't show different values in a field at once. I think you are looking for an OR logic;

           

           

          Where FGName = 'Bria Management'

          OR FGName = 'Carr'

          OR FGName = 'DAAS Management';



          edit:

          Alternatively, you can use Match():

           

          ...

          WHERE Match(FGName, 'Bria Management','Carr','DAAS Management');

            • Re: missing data on load
              Sunny Talwar

              Just to clarify the OP, the Where Match statement will go in the preceding load statement rather than the SQL Select statement

               

              [FacGroupDefs]:
              LIB CONNECT TO [pharmoresql production (pharmore_rwinkel)];
              LOAD FGID,
                FGName

              WHERE Match(FGName, 'Bria Management','Carr','DAAS Management');
              SQL SELECT  FGID,
                FGName
              FROM "Fac"."dbo"."FacGroupDefs";

               

              But this would require to bring in unnecessary data through SQL which you will remove in the preceding load. So, I think it would be better to restrict in your SQL statement using OR method that Stefan has pointed out or use another similar approach.

            • Re: missing data on load
              ishan Bhatt

              Hi Robert,

               

              Use OR instead of AND in Where condition.

               

              Ishan