1 Reply Latest reply on Jul 20, 2018 6:32 AM by Zhouyi Zhang

    Top N in a Subset - but there is more - please read

    Mallik Pullela

      I am looking to get top N values from my Dataset, I have used the Custom Parameter to give the user more control. But my problem is little deeper, I apologize for being naive here.

       

      Consider the following Data Set,

           

      ItemSubitemSalesPrice_Per_unitTotal Dollars (Sales* Price_per_unit)
      SnackCookies1000012120000
      SnackChips500009450000
      SnackTrail Mix70001070000
      SnackNutella Sticks8000648000
      Frozen FoodVegetables900004360000
      Frozen FoodChicken Sticks30001545000
      Frozen FoodFries4000728000
      Fresh FoodVegetables1000004400000
      Fresh FoodMeat40001664000
      Fresh FoodBread7000321000

       

      Now I am trying to get the top 2 Subitems for each ITEM sorted by Total Dollars DESC

       

      My Final Result should be

           

      ItemSubitemSalesPrice_Per_unitTotal Dollars
      Fresh FoodVegetables1000004400000
      Fresh FoodMeat40001664000
      Frozen FoodVegetables900004360000
      Frozen FoodChicken Sticks30001545000
      SnackChips500009450000
      SnackCookies1000012120000