Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Lakshmanudui
Contributor II
Contributor II

How to find sum(Flag) against P_Code

Hi All,

I have fields like P_Code, flag and Date.

If I am trying to do sum(Flag) against P_Code then it will get wrong result because of each date have P_Code.

But My requirement is to get the sum(flag) against the P_Code. I am trying to use below expression.

Sum(Aggr(Only(Distinct Flag), P_Code))

If I am trying do sum of flag then it will take all P_Code data.

Can you please suggest me how to do sum(flag) against the P_Code and how to eliminate P_Code duplicates.

 

Thanks & Regards,

Lakshman 

Labels (1)
1 Reply
BrunPierre
Partner - Master
Partner - Master

Try below.

=Sum(DISTINCT {$<P_Code= {“=Count({1} P_Code) = 1”}>} Flag)