Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
tinkerz1
Creator II
Creator II

how to find the top 3 comments in a field by date

Hi,

I am trying to find the top 3 Reason fields to put into a straight table by date and only if product is not blank; and also a further selection if the TYPE is A,B or C

So the table would look like

Date:                   Top 3 Reasons                  Rank             

01/01/2007         Comment A                       1                   

01/01/2007         Comment B                       2                    

01/02/2007         Comment C                       3                        

01/02/2007         Comment B                       2                   

01/02/2007         Comment A                       3                    

01/03/2007         Comment B                       1                   

01/03/2007         Comment D                       2                    

01/03/2007         Comment E                       3                  

=AGGR(IF(RANK(COUNT({1<[TYPE]={'A','B','C'},[Product]={'=LEN([Reasons])>0'}>}[Product]))=2,Count([Product])),Month,[Product])

But I can't seem to return the text part of product, I only want to see the top 3 comments for each month.

How do I do this in Set Analysis?

10 Replies
tinkerz1
Creator II
Creator II
Author

Just added an example QVW:

How do I rank the top 3 comments for colors 'Blue','Green','Red' and excluding 'Ring' products, using set analysis?

really struggling getting the top 3 comments by count back for each month in a straight table.

Thanks.