Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
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)