Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Tell us which business and trade publications you read most regularly: RESPOND NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
ArrogantAardvark
Contributor III
Contributor III

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?

1 Solution

Accepted Solutions
jayanttibhe
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
jayanttibhe
Creator III
Creator III

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

ArrogantAardvark
Contributor III
Contributor III
Author

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