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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Top 10 using an expression

I have created a pivot table with one dimension and multiple expressions.  I need to create 2 more tables using the same information but I only want to pull the top 10 and the top 10 bottom based on one of the expressions.

Here is what the expression looks like:

if (sum({<FYEAR={$(vBenchYr)},QUARTER={'Q4'}>}(SALES_OVR))<>0,

1-((sum({<FYEAR={$(vCompYr)},QUARTER={$(vCompPrd)}>}(SALES_TOTAL))/sum({<FYEAR={$(vCompYr)},QUARTER={$(vCompPrd)}>}(QTY))*Column(3)) /

((sum({<FYEAR={$(vBenchYr)},QUARTER={'Q4'}>}(SALES_OVR))/sum({<FYEAR={$(vBenchYr)},QUARTER={'Q4'}>}(QTY_OVR)))*Column(3))),

1-((sum({<FYEAR={$(vCompYr)},QUARTER={$(vCompPrd)}>}(SALES_TOTAL))/sum({<FYEAR={$(vCompYr)},QUARTER={$(vCompPrd)}>}(QTY))*Column(3)) /

((sum({<FYEAR={$(vBenchYr)},QUARTER={'Q4'}>}(SALES_TOTAL))/sum({<FYEAR={$(vBenchYr)},QUARTER={'Q4'}>}(QTY)))*Column(3))))

Is there a way to only pull the top 10 & bottom 10 based on the value from this????

11 Replies
pratap6699
Creator
Creator

=Aggr(If(rank(Sum(sales_total))>=10,FYEAR),FYEAR)


=Aggr(If(rank(Sum(sales_total))<=10,FYEAR),FYEAR)

ramoncova06
Partner - Specialist III
Partner - Specialist III

Customers Having Top 4 Values

that post has several methods of doing the top 4 that you could apply for the top 10, for the lowest 10, you might need to use an aggr with a min

expression > (aggr(min(expresion,10),field)