Skip to Content
0
Aug 28, 2020 at 06:14 PM

I need to get the top 10 products from a filtered table

93 Views Last edit Aug 28, 2020 at 06:15 PM 2 rev

I have initial raw data that contains columns for trader, counterparty, product, mtm abs. From this data, I have to pick out the top 10 counterparties. So I get the top 10 counterparties using this variable:

Top 10 cp =Rank([mtm abs];[Client Valuations Counterparty])

and then filtering that table such that Top 10 cp less than or equal to 10.

Now with this table, I then need to get the top 10 products. I cannot use the initial raw data. The rule is to use the table you get when you filter the initial raw data by the top 10 counterparty.

I tried these formulas:

  • -Top 10 Product = Rank([mtm abs];[Client Valuations Product Class Orig]) Where([Top 10 CP] <= 10) - does not give the right result as it basis it on the initial raw data
  • -Top 10 Product = Rank([mtm abs];[Client Valuations Product Class Orig]) Where ([Client Valuations Counterparty]) InList (“NBCGF” ; ”ICECLEAR”; ”MSIL”; ”DZBANK” ; “MSCS” ; “HSBCEU” ; “BNPP” ; “LCH” ; “GSB” ; “NWMLI”) - I wish I could do this but the top 10 counterparties have been hardcoded, next time you run the report for a different date, the top 10 cp can change

Really am struggling and I so wish someone can help please.

Thanks,

Jay