0
votes

I want to create a table with a quick filter with the top 10 records and the bottom 10 records. I created a calculated field called Index with just the INDEX() function and then created another field with the following code:

IF [Index] >= 1 AND [Index] <= 10 
    THEN 'Top' 
ELSEIF [Index] >= (WINDOW_MAX([Index]) - 10 )
    THEN 'Bottom'
ELSE 
    'Do Not Display'
END

However, when I drag the calculated field to the filters it only shows Top and 'All' as an option. Even though in my table the top 10 show 'Top' and the bottom top show 'Bottom'.

What am I doing wrong?

1

1 Answers

2
votes

The Index is a table calculation field and you need to specify how the table calculation needs to performed.

Try the following one and see whether your requirement gets resolved

Use the below and get clarified.

  1. Step1: Create calc field called index ie index( )
  2. Step2: Drag the name field for which you are doing the calculation and calc field index into row shelf.
  3. Step3: right click name field descending and sort via field [sales]
  4. Step3: create [Top N] parameter with integer data type
  5. Step 4:Create calc field called top10? Title Top 10 calculations – Top10?

    if [Index]<=[Top N] THEN "Top N" ELSE IF [Index]>=SIZE()-[Top N] THEN "Bottom n" end end

  6. Step 6:Drag calculation field Top 10? Into filter then select top n and bottom n.

  7. Step 5:Drag the new calculation into row. show parameter control and type 10,20 etc

Please refer the below links and they might be useful to you...

If not please provide the workbook and help you out to solve your problem.

---- Removing External Website Links ----------------