1 Reply Latest reply: Oct 19, 2010 2:15 PM by Karl Pover RSS

    Load only specified tables

      Hey All,

      I am wondering if there is someway to only load specific tables into a QVD. I have a text file that has the Table Name I want to load and a variable Y/N that is yes this should be loaded or no this should not be loaded. I want to be able to call the name of a specific table in my load, but I do not know of a command that simply calls a table and then that table has the values of how it will be loaded. Here is some of my code so far:

      LOAD [Data Load],
      [Load (Y/N)]
      FROM load.txt (ansi, txt, delimiter is '\t', embedded labels, msq);

      Let RowCount = NumMax(NoOfRows('TextLoad'),0)-1;

      For i = 0 to '$(RowCount)'
      Let TempLoadVal = peek('Load (Y/N)', $(i), 'TextLoad');
      Let TempDataField = peek('Data Load', $(i), 'TextLoad');
      if TempLoadVal = 'Y' then

      \\\\Call the Table Load where the table is = TempDataField (ie ExampleTable = TempDataField)


      Load RecordNum as Index,
      [Attribute 1] as Attr1,
      [Attribute2] as Attr2

      I would want to be able to load or call ExampleTable if the value from the txt file read Y. Is there any way to do this or is there a better way to go about this?



        • Load only specified tables
          Karl Pover

          Doug, Here's an example using a variable to load from various MSSQL databases that the user defines in QlikView in a list defined in the variable "bds." The same method should apply for dynamic tables and using the loop and peek() that you are using and you just call the table with a $(TempDataField). The double quotes might be necessary. Regards.


          //******************************Business Partners Catalog***************************************FULL/PARTIAL RELOAD
          for each bd in $(bds);
          ADD LOAD '$(bd)' as Database, '$(bd)'&'_'&CardCode as LineID,
          CardCode, CardName, LicTradNum, GroupCode, Address, ZipCode, Phone1, Fax, CntctPrsn, City, Country, Balance, CardType,
          DebPayAcct, Territory, State1, State2, ExtraDays, CredLimit, SlpCode;
          SQL Select T0.CardCode as CardCode, T0.CardName, T0.GroupCode as GroupCode, T0.LicTradNum, T0.Address, T0.ZipCode, T0.Phone1,
          T0.Fax, T0.CntctPrsn, T0.City, T0.Country, T0.Balance, T0.CardType, T0.DebPayAcct, T0.Territory, T0.State1, T0.State2,
          T1.ExtraDays, T1.CredLimit, T0.SlpCode
          FROM "$(bd)".dbo.OCRD T0 JOIN "$(bd)".dbo.OCTG T1 on T0.GroupNum = T1.GroupNum;
          next bd