Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
eddywong71
Creator
Creator

How to count the ID in the table and keep all the row which ID occur more than one

Hi All,

I have a table like below.

ID  Month  Product   

A    Nov      Apple

A    Dec      Apple

A    Oct       Orange

 

I am using the expression 

AGGR(COUNT( DISTINCT ({Product={'Apple'}, Month=>} Month, ID)

ID  Month  Product    Count

A    Nov      Apple          2

A    Dec      Apple         

A    Oct       Orange

 

However what I want is

ID  Month  Product    Count

A    Nov      Apple          2

A    Dec      Apple          2 

 

Have anyone can help to revise my set expression 

Labels (5)
1 Reply
G3S
Creator III
Creator III

try:

aggr(count(distinct Product),ID)