Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Note: You may notice some temporary visual or styling issues in the Community. Our vendor is actively investigating.
cancel
Showing results for 
Search instead for 
Did you mean: 
MikeJones
Creator
Creator

Filter panes and distinct calculations are a pain

Hi,I wish to count the distinct number of days a user_name has worked each week via using a filter pane.  When I choose no user_name, I wish the table to show for the week the number of distinct user_names for the week.

Table dimension is WeekStart([Date-LiveDate.autoCalendar.Date]

Using Sum(Aggr(Count(DISTINCT user_name), [Date-LiveDate.autoCalendar.Date])) and I choose a user_name from a filter pane it gives me the correct result.  For example, choosing Mike Jones who works 4 days a week, gives me 4 for WB 24 March 2025. 

When I choose no filter, I want the calculation to show the number of distinct user_names for WB 24 March 2025.  Using the above formula gives 104, when the total number of distinct user_names for the said week was 24.

Labels (5)
3 Replies
marcus_sommer

The dimensionalities aren't suitable because it's mixing a week with a date. Therefore I suggest you used a native week-field as object-dimension and within the aggr().  

MikeJones
Creator
Creator
Author

Hi Marcus, thank you for your response.  I am not very experienced with Qlik and I have tried 

Sum(Aggr(Count(DISTINCT user_name), [Date-LiveDate],WeekStart([Date-LiveDate]))) and it shows as 0.

marcus_sommer

The dimensions within the aggr() must be native fields - no expressions. In general should calculated dimensions be avoided - all essential logic belonged into the data-model.