Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Incremental load

Need to do an incremental load,

MFD:

LOAD

    $(Emp) & '-' & ZS_FILIAL&ZS_DATA&ZS_IMPRESS AS %linkMFD,

    ZS_FILIAL as CodFilialMFD,

    ZS_ALIQICM as AliqMFD,

    ZS_CUPOM as CupomMFD,

    MID(ZS_DATA,1,4) AS Ano,

    $(Emp) & '-' & ZS_FILIAL as CodEmpFilZS,

    MONTH(MAKEDATE(MID(ZS_DATA,1,4),MID(ZS_DATA,5,2))) AS Mes,

  MID(ZS_DATA,7,2) AS Dia,

  date(MAKEDATE(MID(ZS_DATA,1,4),MID(ZS_DATA,5,2),MID(ZS_DATA,7,2))) AS Data,

  weekday(MAKEDATE(MID(ZS_DATA,1,4),MID(ZS_DATA,5,2),MID(ZS_DATA,7,2))) AS DiaSemana,

  ceil(MONTH(MAKEDATE(MID(ZS_DATA,1,4),MID(ZS_DATA,5,2))),4) AS Trimestre,

  MonthName( MakeDate(MID(ZS_DATA,1,4),MID(ZS_DATA,5,2),MID(ZS_DATA,7,2))) AS MesAno,

    ZS_ITEM AS ItemMFD,

    ZS_PDV  as PdvMFD,

    ZS_IMPRESS as ImpressMFD,

    ZS_PRODUTO AS DescProdutoMFD,

    ZS_QTDADE AS QuantidadeMFD,

    ZS_STATUS AS StatusMFD,

    ZS_TIPO   AS TipoMFD,

    ZS_VLRBASE as ValBaseIcmMFD,

    ZS_VLRICMS as ValorIcmMFD,

    ZS_VLRTOTA AS TotalMFD,

    ZS_VLRDESC AS ValorDescMFD,

    ZS_VLRUNIT AS ValorUniMFD;

SQL SELECT ZS_ALIQICM,

    ZS_CODPROD,

    ZS_CUPOM,

    ZS_DATA,

    ZS_FILIAL,

    ZS_IMPRESS,

    ZS_ITEM,

    ZS_PDV,

    ZS_PRODUTO,

    ZS_QTDADE,

    ZS_STATUS,

    ZS_TIPO,

    ZS_VLRBASE,

    ZS_VLRICMS,

    ZS_VLRTOTA,

    ZS_VLRDESC,

    ZS_VLRUNIT

//FROM SigaProdp10.dbo.SZS010;

FROM SZS$(Emp)0 SZS

WHERE

  D_E_L_E_T_ <> '*'

  AND ZS_DATA >= '20130401'

  AND ZS_DATA <='20131231';

STORE * FROM MFD into MFD$(Emp).QVD (qvd);

DROP Table MFD;

1 Solution

Accepted Solutions
Not applicable

Re: Incremental load

Thanks, found in  Incremental load in Qlikview

4 Replies
magavi_framsteg
Contributor III

Re: Incremental load

Hi Saniffer.

Have you tried lurking the forums?

Not applicable

Re: Incremental load

yeah, so I'm not getting applied to my reality

Not applicable

Re: Incremental load

Thanks, found in  Incremental load in Qlikview

fernando_tonial
Valued Contributor

Re: Incremental load

Hi, try this.

Check the code:

LET vDataInicio = Date(YearStart(Today()),'YYYYMMDD');

LET vDataFim = Date(Today(),'YYYYMMDD');

MFD:

LOAD

    $(Emp) & '-' & ZS_FILIAL&ZS_DATA&ZS_IMPRESS AS %linkMFD,

    ZS_FILIAL as CodFilialMFD,

    ZS_ALIQICM as AliqMFD,

    ZS_CUPOM as CupomMFD,

    MID(ZS_DATA,1,4) AS Ano,

    $(Emp) & '-' & ZS_FILIAL as CodEmpFilZS,

    MONTH(MAKEDATE(MID(ZS_DATA,1,4),MID(ZS_DATA,5,2))) AS Mes,

  MID(ZS_DATA,7,2) AS Dia,

  date(MAKEDATE(MID(ZS_DATA,1,4),MID(ZS_DATA,5,2),MID(ZS_DATA,7,2))) AS Data,

  weekday(MAKEDATE(MID(ZS_DATA,1,4),MID(ZS_DATA,5,2),MID(ZS_DATA,7,2))) AS DiaSemana,

  ceil(MONTH(MAKEDATE(MID(ZS_DATA,1,4),MID(ZS_DATA,5,2))),4) AS Trimestre,

  MonthName( MakeDate(MID(ZS_DATA,1,4),MID(ZS_DATA,5,2),MID(ZS_DATA,7,2))) AS MesAno,

    ZS_ITEM AS ItemMFD,

    ZS_PDV  as PdvMFD,

    ZS_IMPRESS as ImpressMFD,

    ZS_PRODUTO AS DescProdutoMFD,

    ZS_QTDADE AS QuantidadeMFD,

    ZS_STATUS AS StatusMFD,

    ZS_TIPO   AS TipoMFD,

    ZS_VLRBASE as ValBaseIcmMFD,

    ZS_VLRICMS as ValorIcmMFD,

    ZS_VLRTOTA AS TotalMFD,

    ZS_VLRDESC AS ValorDescMFD,

    ZS_VLRUNIT AS ValorUniMFD;

SQL SELECT ZS_ALIQICM,

    ZS_CODPROD,

    ZS_CUPOM,

    ZS_DATA,

    ZS_FILIAL,

    ZS_IMPRESS,

    ZS_ITEM,

    ZS_PDV,

    ZS_PRODUTO,

    ZS_QTDADE,

    ZS_STATUS,

    ZS_TIPO,

    ZS_VLRBASE,

    ZS_VLRICMS,

    ZS_VLRTOTA,

    ZS_VLRDESC,

    ZS_VLRUNIT

//FROM SigaProdp10.dbo.SZS010;

FROM SZS$(Emp)0 SZS

WHERE

  D_E_L_E_T_ <> '*'

  AND ZS_DATA >= '$(vDataInicio)'

  AND ZS_DATA <='$(vDataFim)';

LOAD * FROM MFD$(Emp).QVD (qvd);

STORE * FROM MFD into MFD$(Emp).QVD (qvd);

DROP Table MFD;

Best Regards.

Tonial.

Community Browser