Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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])
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])
Perfect! Thanks
Best regards Anders
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
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?