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: 
vikasshana
Creator II
Creator II

Qlikview expression to get particular weeks total

Hi,

I've the below table along with the qlikview document(personal edition). I'm using master calendar in my load script.

Table:

---------------   

ValueDateAmount
A01/01/2018100
A02/01/2018140
A03/01/2018230
A04/01/2018460
A10/01/2018220
A11/01/2018120
A12/01/2018234
A13/01/2018430
A16/01/2018111
A17/01/2018345
A18/01/2018230
A23/01/2018235
A24/01/2018120
A25/01/2018420

Now my requirement is i'm looking for an expression which returns only particular weeks sum of amount. Example if I define only first week in the expression then the sum will be '930' because 01/01/2018,02/01/2018,03/01/2018,04/01/2018 is from week1.

1 Solution

Accepted Solutions
sunny_talwar

Lol, I think you really don't want to review your set analysis basics...

=Sum({<Week = {"$(=Min(Week))"}>}Amount)

View solution in original post

5 Replies
sunny_talwar

May be this

=Sum({<Week = {1}>}Amount)

vikasshana
Creator II
Creator II
Author

That's working perfect Sunny, thanks for that. If is select or not select 1st week it is returning the sum amount for week 1.

3.png

in this expression we are defining 1 manually and now my requirement is instead of defining the value manually it has to dynamically, i mean if we select 1-2018 in WeekYear list box the output has to be 930, if we select 2-2018 in WeekYear list box the value has to change to 1004 and so on.

sunny_talwar

Lol, I think you really don't want to review your set analysis basics...

=Sum({<Week = {"$(=Min(Week))"}>}Amount)

vikasshana
Creator II
Creator II
Author

Haha, lot's happening in my mind and couldn't recollect...

Thanks for that mate and is working fine.

sunny_talwar

Take a step back and get the basics right. I don't think anybody minds helping you out with simplest of questions, but do this for your own learning is what I am trying to suggest