Skip to main content

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld 2023, a live, in-person thrill ride. Save $400 before Dec 31st: REGISTER NOW!
cancel
Showing results for 
Search instead for 
Did you mean: 
alexvalqlik
Contributor III
Contributor III

Load qvd

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.

4 Replies
swuehl
MVP
MVP

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;

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);

alexvalqlik
Contributor III
Contributor III
Author

Thank you so much.

alexvalqlik
Contributor III
Contributor III
Author

Thank you so much.