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

Announcements
Discover how organizations are unlocking new revenue streams: Watch 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

30 Replies
Not applicable
Author

Yes, that should work, but it would not update automatically. But even with a binary load, you could add variables in the script.

MK_QSL
MVP
MVP

Check enclosed file...

Not applicable
Author

The figure is wrong Manish. The expression for last week (7th - 11th April) should produce the result 72,110

MK_QSL
MVP
MVP

as per the logic your have given, it is right.... i have tasted and uploaded it.

Let us have clarification of your logic.

IF(PURCHASE_SALE='P',-NOMINAL,NOMINAL)*PRICE/100)

Not applicable
Author

Strange. Let me investigate

Your help is greatly appreciated

MK_QSL
MVP
MVP

Check enclosed file showing last week data only...

Not applicable
Author

Dirk,

using your eexpression

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


I have no field called 'Week'. How are you defining this?

Not applicable
Author

Finally got the answer

=sum({$<Book={"EM EUROBONDS VOL MATCH"}>}IF(week(CalendarDate)= week(Today())-1,(IF(PURCHASE_SALE='P',-NOMINAL,NOMINAL)),0)*PRICE/100)

MK_QSL
MVP
MVP

Dear Alex,

Can you please check the answer you are getting using your above mentioned formula?

Also, let me know the answer by formula given to you by myself.

I have used myone and yourone and the result is same !

Not applicable
Author

The formula above gives me the correct result. Your formula returned a blank value