1 Reply Latest reply on Aug 18, 2016 9:41 AM by Stoyko Kostov

    Top N items by a parameter

    Maheshh C K

      Dear Team,

       

      I have a requirement where I need to pull top n items for a based on a parameter field.

       

      Ex: I have attached a list report .twbx. My requirement is to pull Top 2 Entity1 based on Rating2 Score.

      There should be a parameter to pass Category as input from the user. If none category is not passed we need to bring in Top 2 Entity1 based on Rating2 Score.

      If user selects Category-1, then we need to bring in Top2 Entity1 based on Rating2 score for Category1 alone.

      Similarly for Category-2. Kindly help me on the same.

       

      Thanks

      Maheshh

        • 1. Re: Top N items by a parameter
          Stoyko Kostov

          Hi Maheshh,

           

          If you have a filter for Category that is added to context, then another filter for Entity1 that is Top 2 based on Rating2 Score, the top2 Entity1 filter will be applied after the Category filter, so it will achieve what you need.

           

          You can also show the Category filter to give users control on what categories to choose.

           

          Here's what I did:

           

          1. Drag Category to filters. Choose Use All. Then click on the drop-down of the filter pill, choose Add to context. Finally, click on the drop-down, choose Show Filter.

          2. Drag Entity1 to Filters. Click the Top tab, choose By Field, choose Top 2 by Rating2 Score, use Sum.

           

          Now, play with the selections for the Category filter that are shown in the top right corner to see how your top 2 values will change.

           

          I'm attaching my solution - hope it answers your questions!