Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Unique Weekly Average

I need a weekly average givng me a count of people doing presentations.  My current expression counts each person unique and only sums distinct people over the filtered time period.  How do I write my expression to count people unique each week then give me an average of those individual week counts??

The Thursday field is my week ending date.

Below is my current expression:

count({DidAPresentation = {'Yes'}>} distinct EmployeeName)/count(distinct Thursday)

Thanks for the help!

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Try adding EmployeeName to your aggr dimensions:

= sum( aggr( count({<DidAPresentation = {'Yes'} >} distinct EmployeeName), EmployeeName, Thursday)) / count (distinct Thursday)

If your chart dimensions are in order of EmployeeName and Thursday (or if you don't use Thursday as dimension in your chart).

View solution in original post

4 Replies
swuehl
MVP
MVP

talleyrobyn,

I think you could use advanced aggregation, aggr() function, to achieve what you want.

I assume that you have a week ending date associated to each presentation record. If not, I would suggest that you create e.g. a continuous week number field from the presentation date that you probably have.

The expression could look similar to

= sum( aggr( count({<DidAPresentation = {'Yes'} >} distinct EmployeeName), Thursday)) / count (distinct Thursday)

Hope this helps,

Stefan

Not applicable
Author

Thanks Stefan.  The expression worked at the total level.  However, at the dimenison level of employee's it did not work to give me an average per employee.  I

Thanks!

swuehl
MVP
MVP

Try adding EmployeeName to your aggr dimensions:

= sum( aggr( count({<DidAPresentation = {'Yes'} >} distinct EmployeeName), EmployeeName, Thursday)) / count (distinct Thursday)

If your chart dimensions are in order of EmployeeName and Thursday (or if you don't use Thursday as dimension in your chart).

Not applicable
Author

Thanks that worked perfectly!  I greatly appreciate your help.