Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

fpedrosa
New Contributor II

Load if File already not Loaded

Hi,

On a daily basis i have to load a File which contains several records. This file i keep in a Control Table. I would like to know how can i check if the file was already loaded, and if so, will not load the file contents.

I have the following:

/* records in table A may repeat */

[Table A]

Concatenate (Table A)

Load

     codjogador,

     name,

     birthday,

     deposit,

     cashout

      $(vFile) as FileName,

from [$vFile]

(XmlSimple, table is [ficheiro/registos_jogador/jogador]);

[TB_ETL_CONTROL]:

Concatenate (TB_ETL_CONTROL)

LOAD *,

    Timestamp(Now(1),'YYYY/MM/DD hh:mm:ss') as ETL_TIMESTAMP,

        ComputerName() as ETL_COMPUTER,

        ClientPlatform() as ETL_PLATFORM,

        DocumentName() as ETL_APP,

        OSUser() as ETL_USER,

        GetCollationLocale() as ETL_LOCALE

        INLINE

    [ETL_CTRL_PROC, ETL_FILENAME,

    'ETL - JGDR' , '$(vFile)'];


What i would need to do is check if $(vFile) is already upoaded on TB_ETL_CONTROL and if not then upload it to TABLE A.


Thanks in Advance,


Francisco

3 Replies
isingh30
Contributor III

Re: Load if File already not Loaded

Did you tried Exist function in the script?

fpedrosa
New Contributor II

Re: Load if File already not Loaded

Hi,

I tried with the Exist function but since [Table A] can have repeated records and since the filename will be in different records i can't use exist function.

My idea, is if there's a way to do something similar to:

if  [Filename exists in TB_ETL_CONTROL] then

    Load File

end if

isingh30
Contributor III

Re: Load if File already not Loaded

Community Browser