Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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
Specialist
Specialist

Did you tried Exist function in the script?

Anonymous
Not applicable
Author

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
Specialist
Specialist