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

Trouble with Set analysis

I tried finding solutions on the forum but I can't seem to find the same problem. I am having trouble with set analysis.

Probably because I am trying to count the weeks within a date selection. However de data is obviously linked to the facts. 

The expression to count weeks: 

 

count({1<Year=$::Year,Month=$::Month,Quarter=$::Quarter>}distinct YearWeek)

 

This works fine without being put into a table with dimensions. In a text box it nicely displays 5 weeks voor August 2021. 

However putting this into a table where there is only 1 order in 1 week it counts the weeks as 1 instead of 5. 

WeekOrder
1 
2Order no.
3 
4 
5 

 

The avg deliveries per week --> 1 / count({1<Year=$::Year,Month=$::Month,Quarter=$::Quarter>}distinct YearWeek) = 1 instead of the expected 0.2. how to overcome this?

 

Thanks in advance

Labels (1)
1 Solution

Accepted Solutions
jjbom1990
Creator
Creator
Author

I seem to have been able to get the desired result using Total in the expression count(TOTAL{1<Year=$::Year,Month=$::Month,Quarter=$::Quarter>}distinct YearWeek)

View solution in original post

1 Reply
jjbom1990
Creator
Creator
Author

I seem to have been able to get the desired result using Total in the expression count(TOTAL{1<Year=$::Year,Month=$::Month,Quarter=$::Quarter>}distinct YearWeek)