Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
vchuprina
Specialist
Specialist

Increase speed of script

Hi All,

I want to implement incremental reload because we get a lot of files and it's take a lot of time to load all files each time.

In script I create table to load filetime,

Time:

LOAD

  Num(FileTime()) AS CreatedTime

From

[$(vFile)]

($(vExcel), no labels, table is [$(vSheetName)])

;

LET vTime = Peek('CreatedTime', 0, 'Time');

DROP Table Time;

but I can't understand why script checked each line in sheet, for example if file have 36.507 lines, script load all of them.

Untitled.png

Press LIKE if the given solution helps to solve the problem.
If it's possible please mark correct answers as "solutions" (you can mark up to 3 "solutions").
1 Solution

Accepted Solutions
Gysbert_Wassenaar

You're using a straight forward load statement with no restrictions so it will load run FileTime() once for every record. Try this instead:

Time:

FIRST 1

LOAD

  Num(FileTime()) AS CreatedTime

From

[$(vFile)]

($(vExcel), no labels, table is [$(vSheetName)])

;

LET vTime = Peek('CreatedTime', 0, 'Time');

DROP Table Time;


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

You're using a straight forward load statement with no restrictions so it will load run FileTime() once for every record. Try this instead:

Time:

FIRST 1

LOAD

  Num(FileTime()) AS CreatedTime

From

[$(vFile)]

($(vExcel), no labels, table is [$(vSheetName)])

;

LET vTime = Peek('CreatedTime', 0, 'Time');

DROP Table Time;


talk is cheap, supply exceeds demand
vchuprina
Specialist
Specialist
Author

Thank you, Gysbert. Now script works much more faster.

Press LIKE if the given solution helps to solve the problem.
If it's possible please mark correct answers as "solutions" (you can mark up to 3 "solutions").