4 Replies Latest reply: Apr 7, 2011 11:11 AM by Nicolas ALLANO

# Total spend for top 10 suppliers in each category

I have the following expression which provides me with the total spend if a supplier is in the top 10 for its category. This works fine when in a straight table and the suppliers and categories are shown as dimensions.

`=IF(aggr(rank(sum([NET_Amount])),Category,Supplier_Key)<=10,Sum([NET_Amount]))`

`I now want to use this information but in a new straight table that only has the Category dimension and shows an expression for total spend for the top 10 suppliers in that category. I'm not sure how to do this?`

`Do I need to use set analysis?`

`Thanks in anticipation,`

`Alex Botten`

• ###### Total spend for top 10 suppliers in each category

BOUNCE

Someone in the community must know how to help me with this one

• ###### Total spend for top 10 suppliers in each category

I think it is possible but I don't have the final answer yet.

You would need the Set Analysis to be based on the Key(Id) of your observations (and not on the Category, Supplier) as the Set Analysis 'filter the records once for the whole chart (table or graph)'

I still don't get the whole total, but here is what I get so far:

`=Sum({\$<Id = {"=Id = IF(aggr(rank(sum([NET_Amount])),Category,Supplier_Key)<=10,Id)"}>}NET_Amount)`

Hope others will contribute.