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

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Display top 20 materials

Hi,

I have a table in my report (see attached 't20_mat_existing_table') which displays all the records. I want it to show only top 20 materials (rows) which has highest 2016(YTD) , change%. Result should look like the table attached 't20_mat_proposed_table_pie'.

NOTE:

2016(YTD)  = sum({$<[Fiscal Year]= {$(=Year(Today()))}>} ([In company code currency POS]/RateFixed))

change % = (sum({$<[Fiscal Year]= {$(=Year(Today()))}>} ([In company code currency]/RateFixed))-sum({$<[Fiscal Year]= {$(=Year(Today())-1)}>} ([In company code currency]/RateFixed)))/sum({$<[Fiscal Year]= {$(=Year(Today())-1)}>} ([In company code currency]/RateFixed))

-James

Labels (1)
11 Replies
Anonymous
Not applicable
Author

Hi,

For your table, you can sort by expression in the sort tab.

For your chart, you can use the dimension limits.

See attachments with screenshots as an example.

Not applicable
Author

Thanks Filip,

Your example worked for me in table. Great !!

Now i need the pie chart to display the  sum of Top 20 sales in 2016(YTD)  against sum of all the materials' 2016(YTD). How to achieve this ?

TIA,

James

Anil_Babu_Samineni

James,

filip_duchateau Continuation, If you want to do in Set Analysis, Then we require your Application.

- Anil

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
muthukumar77
Partner - Creator III
Partner - Creator III

Hi,

Try in dimension,

AGGR(IF(Rank(sum({$<[Fiscal Year]= {$(=Year(Today()))}>} ([In company code currency POS]/RateFixed)), 20)<=20, Material), Material, 'Others')

Muthukumar Pandiyan
Anonymous
Not applicable
Author

Hi James,

That's great.

For your chart, please try Muthukumar's suggestion :

Try in dimension,

AGGR(IF(Rank(sum({$<[Fiscal Year]= {$(=Year(Today()))}>} ([In company code currency POS]/RateFixed)), 20)<=20, Material), Material, 'Others')

Not applicable
Author

Muthu,

Your expression displays empty pie.

muthukumar77
Partner - Creator III
Partner - Creator III

Hi,

Can you send me a Qvw file?

Muthukumar Pandiyan
Not applicable
Author

Muthu,

sorry , the size is huge.. i have attached the script..

-James

muthukumar77
Partner - Creator III
Partner - Creator III

Hi,

try like this,

=if(aggr(sum({$<[Fiscal Year]= {$(=Year(Today()))}>} ([In company code currency POS]/RateFixed))),Material)<=20,Material,'Others')

Muthukumar Pandiyan