1 Reply Latest reply on Mar 27, 2012 4:34 AM by Andy Piper

    Top 5 risk and the nth Top risk


      Please see the attached spreadsheet and my earlier question.  I have a table of stock portfolios, where the key is Date + Portfolio code + StockID. Thus for each date, I would have several portfolios, each of which would have many stocks. Of course, the stocks would repeat between portfolios, as the portfolios would repeat between dates.


      Question 1

      I am trying to display the Top 5 highest risky stocks in the portfolio. The sections highlighted in blue in the attached excel worksheet shows the incorrect ( which is what I get from Tableau) and the correct ranking. Instead of showing the top 5 risky stocks for the given date and the given portfolio, Tableau sums up across the entire table (all portfolios across all dates) - finds the top 5 risky stocks - and then if these exist in the given portfolio display them. Thus for any portfolio I can get 0 to 5 bars, depending upon whether or not that stock exists in the portfolio.


      Question 2

      Is there a way to calculate the nth Top risk? This way I can have 5 separate line charts, showing each of the 5 top risky names in the current portfolio separately. For example, chart 2 would show how the risk of the second riskiest stock in the portfolio evolved over time.



      Thank you,