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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
bhavvibudagam
Creator II
Creator II

How to load Last 9 days data

Hi Experts,

Can any one please help me on this.

In a folder daily with corresponding date one excel file will be updated.

From those excel file names I have extracted the date like below.

When I have run the script on tomorrow then one more date will be added. But here I have to restrict only Last 9 days data.

Thanks in advance.

1 Solution

Accepted Solutions
shiveshsingh
Master
Master

Try this

T:

LOAD Date

FROM test_data.xlsx

(ooxml, embedded labels, table is Sheet1);

NoConcatenate

W:

load *

Resident T;

drop table T;

max:

load max(Date) as max_date

Resident W;

let vMAX = peek('max_date',0,'max');

NoConcatenate

Final:

load *

Resident W

where Date> Date('$(vMAX)'-9,'DD-MM-YYYY');

DROP TABLE W;

View solution in original post

1 Reply
shiveshsingh
Master
Master

Try this

T:

LOAD Date

FROM test_data.xlsx

(ooxml, embedded labels, table is Sheet1);

NoConcatenate

W:

load *

Resident T;

drop table T;

max:

load max(Date) as max_date

Resident W;

let vMAX = peek('max_date',0,'max');

NoConcatenate

Final:

load *

Resident W

where Date> Date('$(vMAX)'-9,'DD-MM-YYYY');

DROP TABLE W;