Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

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
thonipad
Contributor III

Limit records to the last week?

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

Limit records to the last week?

incremental would be the best for this situation

Not applicable

AW:Limit records to the last week?

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

AW:Limit records to the last week?

wot statement wud I use in the load

thanks by the way

Not applicable

AW:Re: AW:Limit records to the last week?

Hi,

something like

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


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

RR

montubhardwaj
Contributor III

AW:Re: AW:Limit records to the last week?

Load A,

B,
C,

Date

From abc

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

Not applicable

AW:Re: AW:Re: AW:Limit records to the last week?

Upps,

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

RR

Community Browser