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

Last week set analysis

How can i use the Weekstart function within a set analysis, so that only the data for last week is included? (I do not mean the last 7 days, i mean the preceding working week.) In this case, I can't adjust my master calendar so have to make do with the CalendarDate field.

This is my expression

=sum({$<Book={"EM MATCH"}>}PRICE)

I can't get my head round the correct syntax

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

Check enclosed file showing last week data only...

View solution in original post

30 Replies
santharubban
Creator III
Creator III

Hi try this,

=sum({$<Book={"EM MATCH"},w_date = {'$(= weekstart(w_date))'}>}PRICE)

Not applicable
Author

I assume i substitute my CalendarDate field for w_date?

=sum({$<Book={"EM MATCH"},CalendarDate = {'$(= weekstart(CalendarDate))'}>}PRICE)

this did not work

Not applicable
Author

I am unclear how your suggestion would apply to the previous working week, which is what I need

Not applicable
Author

I assume a -1 needs to be added to specify the previous week. Although this still doesn't work!

=sum({$<Book={"EM MATCH"},CalendarDate = {'$(= weekstart(CalendarDate),-1)'}>}PRICE)

rustyfishbones
Master II
Master II

Hi Alex,

Can you share part of the App, or some of the Data?

Al

MK_QSL
MVP
MVP

=SUM({$<Book={'EM MATCH'},[YourDateField] = {'>=$(=WeekStart(Today()-7))<=$(=WeekEnd(Today()-7))'}>}PRICE)

Not applicable
Author

Alan, ignoring the Book field, its just a CalendarDate field and an amount field (aka PRICE)

There are multiple amount entries for each date

Not applicable
Author

That didn't seem to work Manish

MK_QSL
MVP
MVP

What is the format of your Date Field?