4 Replies Latest reply on Oct 11, 2018 8:28 PM by Garen XIA

    how to find top N within a category using the calculation field

    Garen XIA

      Hi,

       

      I am trying to find the top N within a category using a calculation field.

      I referred to the following article, but when the category is created by a calculation field,

      I could not rank each category well as I expect. I could only get the rank of the whole table.

       

      https://kb.tableau.com/articles/howto/finding-the-top-n-within-a-category?lang=en-us

       

      I attached the sample workbook.

           [group] is a calculation field to separate the [cumulative amount]

           I wish to filter the top 1 within each [group] so I tried to use RANK and INDEX.

       

      The attached picture is showing what I expect, but the [group] category is a dimension existing in the data source.

       

      Thanks for any suggestions!

       

      Best Regards