Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Limit records to the last week?

I have started creating an application but have been asked to limit the records to only data from the last 7 days (which will then automatically update everyday), does anyone know how to do this ?

7 Replies
Anonymous
Not applicable
Author

Did you want an incremental update or the application should always only have last 7 days? Assuming, it is the later and your DB Oracle, you could put the following in your SQL statement:

SQL select * from yourtable where yourdatecolumn >= trunc(sysdate) -7

Regards,

Dinesh.

Not applicable
Author

incremental would be the best for this situation

Not applicable
Author

Hello,

there are more then one possibilitie to reduce data. One is to do it in an expression of a chart using SET analysis similar to this

=sum( {<MyDateField= {"<=$(=data(today()-7))}">} Value)

This has to done then in every chart-expression you want to reduce the data to the last seven days.

Another possibilty is to reduce data during the load. Advantage is you need not to program it in every expression but only once in the script. Disadvantage is: what if someone needs to compare actual data with previous week, last month, prev. year .....

HtH

Roland

Not applicable
Author

wot statement wud I use in the load

thanks by the way

Not applicable
Author

Hi,

something like

Load .... From .... Where MyDateField <= date(today()-7);


Note: Take care of the correct matching between the date-formats.

RR

montubhardwaj
Specialist
Specialist

Load A,

B,
C,

Date

From abc

where Date >=Date(today()-7);

Not applicable
Author

Upps,

Thx Sharma, you are right with ">=".

RR