Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

alexvalqlik
New Contributor II

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.

Tags (1)
4 Replies
MVP
MVP

Re: Load qvd

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

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
New Contributor II

Re: Load qvd

Thank you so much.

alexvalqlik
New Contributor II

Re: Load qvd

Thank you so much.

Community Browser