Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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().
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.
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.