Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
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