Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

How to show Top20 rows in Pivot table?

Hello, I need to show top20 products that have maximum sales in a specific period, in a specific time, in a specific shop .. . .
I can do that in Straight table by using the limiting option in dimension tab, but pivot table doesn't allow me to do.
Anyone, can come up with the solution for me? Thanks in advance.

1 Solution

Accepted Solutions
cabhijit
Valued Contributor

Re: How to show Top20 rows in Pivot table?

Try using Rank function in calculated dimension:

If( Aggr(Rank(Sum(Sales)),<PeriodField>,<ShopField>)<=20,Product)

3 Replies
cabhijit
Valued Contributor

Re: How to show Top20 rows in Pivot table?

Try using Rank function in calculated dimension:

If( Aggr(Rank(Sum(Sales)),<PeriodField>,<ShopField>)<=20,Product)

Not applicable

Re: How to show Top20 rows in Pivot table?

If( Aggr(Rank(Sum(Sales)),<PeriodField>,<ShopField>)<=20,Product)


This one ranks and filters top20, but on the measure, it should show measure (Sales), but here its showing me Products name in measure area.    

cabhijit
Valued Contributor

Re: How to show Top20 rows in Pivot table?

use Sum(Sales) as Expression to your pivot table.

Community Browser