4 Replies Latest reply on Nov 18, 2013 8:57 AM by Dallin Crump

    Issue with using index function to rank "at a [certain] level"

    Raunaq Palejwala

      Hi All-

       

      Hoping you can help me with an issue I'm having in Tableau. I'm attaching a sample spreadsheet- think it's easiest to talk through this example.

       

      I am working with a complex data set, but have boiled it down here to a product hierarchy. There are product categories, that contain products and then SKUs within those products. I am trying to rank products based on total sales dollars but I need to have the SKU ID information in my visualization in order to know what SKUs sit under that product. Here's a screenshot of the viz in the attached workbook:

       

      Rank issue viz.PNG.png

       

      I would like to rank based on product IDs within each product category based on sales. The issue I'm having (which you can see in the image or the attached workbook) is that when ranking a product, Tableau does not take into account the SUM of sales of the SKUs underneath that product. Instead, it assigns a rank based on the sales of the first SKU within that product. In the example above, product ID 1 has a product rank of 2 but if the total sales of that product are taken into account, it should have a rank of 1.

       

      Please note- going into the index function and changing the "Compute using">"Sort" field to "Automatic" is not an option. This is a simplified workbook but in my actual workbook, I am not necessarily going to be sorted on the field I want to rank on (plus I have several ranks in the visualization).

       

      Hoping this makes sense- let me know if I can clarify.