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

Log reader

Hi,

i have this logreader that I downlaoded from the resource library. how can I make it so that it only loads last weeks data instead of reading everything in the logfile driectory?

cheers

6 Replies
richard_chilvers
Specialist
Specialist

I'm sure you could dabble in the script, but I seem to think there are selection criteria in the front-end to filter the period you look at ?

Not applicable
Author

Yes sure theres a period to filter on. But I'm not interested in logfiles from wayback and also it just consumes time to load them all. Therefor I was wondering if you could set a where statement in scipt to only get the last weeks logfiles or so,,,

avinashelite

Try like this

LET vMaxDate: '=max(date_created)';

LET vFirstOfLast7: '=max(date_created,6)';

LOAD *

from table_name

where date>vFirstOfLast7;

Not applicable
Author

Could you specify more? My Datecolumn is called "Date"

Anonymous
Not applicable
Author

Could this work?

LET FromDate = Today()-7;

LET ToDate = Today()-1;

Directory;

LOAD Date,

     Num

FROM

TableIndata.txt

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

WHERE Date >= $(FromDate) AND Date <= $(ToDate);

You can manipulate FromDate and ToDate as you like, in this case today's entries would not be included (which may not be what you want but I just wanted to include both conditions).

avinashelite

could you please share the sample data ..so that it will helpful to give the correct solution