Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
don_qlikview
Creator
Creator

Question on Count based on 2 fields

Hi All,

I am having a situation where i am unable to figure out the expression for Count based on 2 fields. I am trying to create a pie chart with Status as dimension and in the expression, i have to calculate the count of Status on a distinct [CD Key] and the max date. I tried to use Aggr(), several combinations of Count and distinct. Can any one help out?

Thanks in advance.

2 Replies
Kushal_Chawda

try this

=count({<Status={'A'}, Date={"$(=date(max(Date))"}>} distinct [CD Key])

sunny_talwar

But this might not work if the max date is different for each Status... if that's true than may be this

Count(DISTINCT Aggr(If(Date = Max(TOTAL <Status> Date), [CD Key]), Status, Date))