Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Uploads getting stuck in the virus scanner. We are investigating.
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor II
Contributor II

Stumped by Aggr

Help needed here. I am working with a single flat table in my data model containing three columns: 

ServiceDateMonthName (dual, timestamp is 1st millisecond of month)
%PatientId
%EncounterId

In QS, I have a straight table that displays the distinct %PatientId count and distinct %EncounterId count by month. In the same table, I have the following aggregation expression:

Count(Aggr(Count(distinct %EncounterId),%PatientId))

(This is not what I am trying to calculate, but it demonstrates the problem simply.) In this expression, I would expect the aggr() array to have value for each distinct %PatientId. However, this does not match with distinct %PatientId count:

 

Capture.PNG

Note that there are no filters active. However, when I limit the data in the app to a single month, the values are magically in agreement:

 

Capture3.PNG

I must be missing something obvious. Suggestions?

Labels (1)
1 Solution

Accepted Solutions
Highlighted
Creator III
Creator III

That means you wanted to add Year - month on your aggr calculation as well ... 

View solution in original post

2 Replies
Highlighted
Creator III
Creator III

That means you wanted to add Year - month on your aggr calculation as well ... 

View solution in original post

Highlighted
Contributor II
Contributor II

Brilliant! Now I understand.... Thanks for the quick response, it works!