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

Announcements
Note: You may notice some temporary visual or styling issues in the Community. Our vendor is actively investigating.
cancel
Showing results for 
Search instead for 
Did you mean: 
robmarr789
Contributor
Contributor

Last full week Qlikview

Hi

I am brand new to Qlikview.

I am trying to write an expression that will do the following;

SUM all sales within the last full week. This needs to roll forward in real time.

For example as of today 'last week' would include 05/03/18 - 11/03/18. The following week it will filter between 12/03/18 - 18/03/18

The fields within my source data are 'Sales' and 'DocDate'

5 Replies
fvelascog72
Partner - Specialist
Partner - Specialist

Hi,

Try:

=Sum({<Week = {'$(=Week(Today())-1)'}>}Sales)

Where Week = Week(Date)

Saludos.

robmarr789
Contributor
Contributor
Author

Sorry I'm really amateur, could you fill in the gaps with my dates

Anonymous
Not applicable

hi,

If you have the Date, then try

=Sum( {< Date = {">=$(=WeekStart(today()-(1+num(WeekDay(today())))))<=$(=WeekEnd(today()-(1+num(WeekDay(today())))))"} >} Sales)

tamilarasu
Champion
Champion

Hi Robert,

Sum({<DocDate={">=$(=WeekStart(Today(), -1))<=$(=WeekEnd(Today(),-1))"}>} Sales)

zebhashmi
Specialist
Specialist

if(week(DocDate)=Weekstart(Today()),Sum(Sales))

and

if(week(DocDate)=Week(Today())-1,Sum(Sales))