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: 
Not applicable

How to Auto Load Excel Sheet by time specific.

Hi QV,

I've a folder that contains excel sheet which keep coming every night. I have to use only the Excel Sheet automatically by 02.15 PM.

Here is my source folder.

Can you help me write in the script to just pull files from a certain time period maybe?

2-5-2015 9-59-25 AM.png

Can anyone help me on this please?

9 Replies
tresesco
MVP
MVP

Use filetime() to get modification time. Try like:

Load

          *

From  yourpath\*.xls where filetime()>yourtime;

Not applicable
Author

Hi Tresesco,

this is my source path. Help me out.

**************************************

FROM

(txt, codepage is 1252, embedded labels, delimiter is '\t', msq);

***********************************************

tresesco
MVP
MVP

Try like:

FROM

(txt, codepage is 1252, embedded labels, delimiter is '\t', msq) where hour(filetime())>2;

Not applicable
Author

Hi,

It is reading all the excel sheet which ever earlier than 02 PM. I just want to load the only excel sheet with in that time frame. Only one excel sheet. Could you help me on this please?

Ex:  1.45PM to 2.15 PM

tresesco
MVP
MVP

where frac(filetime())>time#('1:45', 'h:mm') and frac(filetime())<time#('2:15', 'h:mm')

Modified.

manojkulkarni
Partner - Specialist II
Partner - Specialist II

Use something like

FOR each File in filelist('SourcePath')

T:

LOAD

FileBaseName() As fname,

FileTime() AS filtime

FROM [$(File)] ;

NEXT File

Let vMaxDate = Peek('filtime', -1, 'T');

Not applicable
Author

Hi,

It is not loading any records. Just 0 records loaded showing.

tresesco
MVP
MVP

Hope you understood the logic. There might be some basic glitch in your code segment, try to find that with trial and error.

Not applicable
Author

Hi Manoj,

how to try your login? Help me out.

**************************************

FROM

(txt, codepage is 1252, embedded labels, delimiter is '\t', msq);

***********************************************