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: 
Anonymous
Not applicable

Set analysis?

Hi

I have a table that looks a bit like this:

Year, Month, "No of employees"

2015, 10, 100

2015, 11, 102

2015, 12, 104

2016, 01, 103

2016, 02, 106

2016, 03, 108

2016, 04, 105

2016, 05, 110

2016, 06, 107

2016, 07, 111

2016, 08, 107

and so on

For example: If I select month 02,03 and 04 in a listbox I want QlikView to sum the no of emloyees for month 01 and 04! (103 and 105 for the year 2016) and if I select month 08,09,10,11 qlikview should take the no employees for month 07 and 11 and sum it up.

Hope someone can help me 🙂

Best regards

Anders

1 Solution

Accepted Solutions
sunny_talwar

For this example you have posted, this seems to be working:

=Sum({<Month = {$(=Num(Max(Month), '00')), $(=Num(Min(Month)-1, '00'))}>}[No of employees])

View solution in original post

4 Replies
sunny_talwar

For this example you have posted, this seems to be working:

=Sum({<Month = {$(=Num(Max(Month), '00')), $(=Num(Min(Month)-1, '00'))}>}[No of employees])

Anonymous
Not applicable
Author

Perfect! Thanks

Best regards Anders

Anonymous
Not applicable
Author

Hi

Another thought....

If I want to make a selection from 201509 to 201602 i will get a month that is = 00 and it will not work.

I want QV to use 201508 and 201602 for the calculation.

How can i solve that with a set analysis?

Anders

sunny_talwar

You are absolutely right and that is why I don't like to use numbers and I prefer using Date fields (such as YearMonth in your case) here. Do you have this as date in your original application or numbers?

Get the Dates Right

Dates in Set Analysis

Why don’t my dates work?