1 Reply Latest reply on Jan 27, 2015 1:57 AM by Sankarmagesh Rajan

    Top and Bottom N (again)

    keith.r

      So I know there are other ways to do this, but I'd like to understand why I got stuck using this particular approach, and if there is a way to make it work.

       

      Parameter: Top 10, Top 20, Top 50, Bottom 10, Bottom 20, Bottom 50, etc

       

      Calculated field:

      [Top N]="ALL" or

      [Top N]="Top 10" and [INDEX] <=10 or

      [Top N]="Top 50" and [INDEX] <=50 or

      [Top N]="Top 100" and [INDEX] <=100 or

      [Top N]="Bottom 10" and [INDEX] ???

       

      I'm guessing it would be something like

      [Top N]="Bottom 10" and [INDEX] >= MAX([INDEX])-10

       

      but it doesn't seem to like the MAX([INDEX])

       

      Any ideas?

      Thanks!!

        • 1. Re: Top and Bottom N (again)
          Sankarmagesh Rajan

          Hi

           

          Create parameter [Show top and bottom N] and select integer then select allowable values "all"

          create index calc as index()

          Create cal as

          IF INDEX() <= [Show top and bottom N] THEN "Top N"

          ELSEIF INDEX() >SIZE() - [Show top and bottom N] THEN "Bottom N"

          ELSE "Middle"

          END

           

          new cal field into filter and select top N and Bottom N.