Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set analysis with previous week data issue

I need a reference date which eqauls last week in my set ananlysis.

Like for example:

sum({$<ReferenceDate = {'24/07/2016'}>} _Saldo) - sum({$<VervallenSegmStatus = {'Actueel'}, ReferenceDate = {'24/07/2016'}>} _Saldo)

But the date which is now fixed should be able to change.

Like for example:

sum({$<ReferenceDate = {"week(ReferenceDate) -1"}>} _Saldo) - sum({$<VervallenSegmStatus = {'Actueel'}, ReferenceDate = {"week(ReferenceDate) -1"}>} _Saldo)

So the code in bold is not working at the moment.

Can someone help me with this problem?

Thanks!

1 Solution

Accepted Solutions
Not applicable
Author

You can discard my last question. I solved the problem.

Instead of using ReferenceDate, I made a ReferenceWeek in my script like this:

week(ReferenceDate) as ReferenceWeek

and then I used following expression:

=sum({$<ReferenceWeek = {"$(=ReferenceWeek -1)"}, ReferenceDate = >} _Saldo)

With this code I got it working!

View solution in original post

3 Replies
Not applicable
Author

use this


ReferenceDate - 7


or


weekstart(ReferenceDate -7)

Not applicable
Author

Hello Rodrigo,

Thanks for your answer!

But can you give me some more information because I can't get it working.

So you mean {"week(ReferenceDate) -7"} ? Because like this it doesn't work.

Not applicable
Author

You can discard my last question. I solved the problem.

Instead of using ReferenceDate, I made a ReferenceWeek in my script like this:

week(ReferenceDate) as ReferenceWeek

and then I used following expression:

=sum({$<ReferenceWeek = {"$(=ReferenceWeek -1)"}, ReferenceDate = >} _Saldo)

With this code I got it working!