Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis with Variable Dates and an Operation

I have the following variables:

1. vLatestWeek

2. vWeeksAgo

3. vBeginWeek

Is it possible to write in an expression using these variables to sum up all the weeks from the LatestWeek to however WeeksAgo? without having to use the BeginWeek?

To further this, both of the expression below are functional but don't give the answer I need. I believe it's a combination of the two but my syntatical permutations are not working. Any help is much appreciated! Thanks in advance!

Sum({< Weeks = {'$(=$(vmaxweek) - $(vweeksago))'} >} Sales)

Sum({<Weeks={">=$(vbeginweek)< $(vlatestweek)"}>}Sales)



1 Solution

Accepted Solutions
johnw
Champion III
Champion III

Hard to be sure of syntax without being able to check it, plus the variable names in your two sums are inconsistent both with each other and with the variables you listed in the post. But I'm guessing this:

sum(<Weeks={">=$(=$(vlatestweek)-$(vweeksago)) <$(vlatestweek)"}>} Sales)

View solution in original post

2 Replies
johnw
Champion III
Champion III

Hard to be sure of syntax without being able to check it, plus the variable names in your two sums are inconsistent both with each other and with the variables you listed in the post. But I'm guessing this:

sum(<Weeks={">=$(=$(vlatestweek)-$(vweeksago)) <$(vlatestweek)"}>} Sales)

Not applicable
Author

Thank you! this worked perfectly.