By using Index( ) in calculated filed and drag that calculated field in rows shelf we can achieve this.Please find the attached twbx.I hope this solves your problem
Step1: Create calc field called index ie index( )
Step2: Drag the customer name and calc field index into row shelf.
Right click customer name descending and sort via field [sales]
Step3: create [Top N] parameter with integer data type
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" else “Others” end end
Drag calculation field Top 10? Into filter then select top n and bottom n.
Drag the new calculation into row.
show parameter control and type 10,20 etc
Become a Viz Whiz on the Forums!
Support the Community and master Tableau.