4 Replies Latest reply: Jun 24, 2016 6:18 PM by Alex Valverde RSS

    Load qvd

    Alex Valverde

      Good afternoon,

      I want to load data from a qvd referring to another qvd but I error.

      the load is:

       

      [KNA1_CLI]:

      LOAD

          KUNNR AS KUNAG,

          LAND1 AS Pais,

          NAME1 AS Nomb_Cliente,

          NAME2 AS Nomb_Cliente2,

          REGIO AS Region,

          BRSCH AS Ramo_Ind,

          KTOKD,

          KUKLA AS Subcla,

          COUNC AS Canton,

          SPRAS,

          BRAN1 AS Subvtas_Cli,

          KTOCD,

          WERKS AS Cent_dist,

          STCDT

      FROM [lib://Qvd_Ventas/KNA1.qvd](qvd)

      where KTOKD <> 'ZREP'

      WHERE KUNAG Exists ( LOAD distinct KUNAG FROM [LIB://Qvd_Ventas/ZVTA_DIMENSION.qvd] (qvd) )

      ;

      and the error is as follows:

      Garbage after statement: [KNA1_CLI]: LOAD KUNNR AS KUNAG, LAND1 AS Pais, NAME1 AS Nomb_Cliente, NAME2 AS Nomb_Cliente2, REGIO AS Region, BRSCH AS Ramo_Ind, KTOKD, KUKLA AS Subcla, COUNC AS Canton, SPRAS, BRAN1 AS Subvtas_Cli, KTOCD, WERKS AS Cent_dist, STCDT FROM [lib://Qvd_Ventas/KNA1.qvd](qvd) where KTOKD <> 'ZREP' WHERE KUNAG Exists ( LOAD distinct KUNAG FROM [LIB://Qvd_Ventas/ZVTA_DIMENSION.qvd] (qvd) )

       

      Thank you.

        • Re: Load qvd
          Stefan Wühl

          exists() function in QV works different from SQL, it's checking the symbol table of a field on existence of a value.

           

          Try to preload your dimension QVD and then use Exists() like

           

          TEMP:

          LOAD distinct KUNAG

          FROM [LIB://Qvd_Ventas/ZVTA_DIMENSION.qvd] (qvd)

           

          [KNA1_CLI]:

          LOAD

              KUNNR AS KUNAG,

              LAND1 AS Pais,

              NAME1 AS Nomb_Cliente,

              NAME2 AS Nomb_Cliente2,

              REGIO AS Region,

              BRSCH AS Ramo_Ind,

              KTOKD,

              KUKLA AS Subcla,

              COUNC AS Canton,

              SPRAS,

              BRAN1 AS Subvtas_Cli,

              KTOCD,

              WERKS AS Cent_dist,

              STCDT

          FROM [lib://Qvd_Ventas/KNA1.qvd](qvd)

          where KTOKD <> 'ZREP'

          WHERE Exists (KUNAG, KUNNR)

          ;

           

          DROP TABLE TEMP;

          • Re: Load qvd
            Sunny Talwar

            QlikView or Qlik Sense syntax is little different then SQL... Try this:

             

            LOAD KUNAG

            From [Lib://Qvd_Ventas/ZVTA_DIMENSION.qvd] (qvd);


            LOAD

                KUNNR AS KUNAG,

                LAND1 AS Pais,

                NAME1 AS Nomb_Cliente,

                NAME2 AS Nomb_Cliente2,

                REGIO AS Region,

                BRSCH AS Ramo_Ind,

                KTOKD,

                KUKLA AS Subcla,

                COUNC AS Canton,

                SPRAS,

                BRAN1 AS Subvtas_Cli,

                KTOCD,

                WERKS AS Cent_dist,

                STCDT

            FROM [lib://Qvd_Ventas/KNA1.qvd](qvd)

            where KTOKD <> 'ZREP'

            WHERE Exists (KUNAG, KUNNR);