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: 
Aanchal
Contributor II
Contributor II

Limit top 10 By measure (Set Expression)

Dear , 

This is my set Expression

=count({<[Date Stamp] ={">=$(=Date(Today()-90,'DD-MM-YYYY'))<=$(=Date(today(),'DD-MM-YYYY'))"}>}[Color Priority])

for total no. of colour instances   i have to show top 10 . 

i used this expression 

=Aggr(Rank(count({<[Date Stamp] ={">=$(=Date(Today()-90,'DD-MM-YYYY'))<=$(=Date(today(),'DD-MM-YYYY'))"}>}[Color Priority])) <=10,[Color Priority])

Its not working . Please Suggest.

Labels (1)
15 Replies
SunilChauhan
Champion II
Champion II

Have you tried this?

 

IF(Aggr(Rank(count({<[Date Stamp] ={">=$(=Date(Today()-90,'DD-MM-YYYY'))<=$(=Date(today(),'DD-MM-YYYY'))"}>}[Color Priority])),[SKU Code],[Color Priority]) <=10,count({<[Date Stamp] ={">=$(=Date(Today()-90,'DD-MM-YYYY'))<=$(=Date(today(),'DD-MM-YYYY'))"}>}[Color Priority]))

Sunil Chauhan
Aanchal
Contributor II
Contributor II
Author

Yes , this is not limiting to top 10 .

BrunPierre
Partner - Master
Partner - Master

@Aanchal  Try this

IF(RANK( Count(Aggr(Count([Color Priority])),[SKU Code]))<=10,Count([Color Priority]))

Aanchal
Contributor II
Contributor II
Author

Aanchal_0-1662011759323.png

 

BrunPierre
Partner - Master
Partner - Master

This instead

IF(RANK(Count(aggr(Count([Color Priority]),[SKU Code],[Color Priority])))<=10,Count([Color Priority]))

 

Aanchal
Contributor II
Contributor II
Author

No, not working.