Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
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)