You want to display a chart/table with the Top X and Bottom X, all in the same widget
Sisense allows setting ranking filters based on a measure, but this is only for Top OR Bottom.
Create your widget, with the value you want to rank by (for ex. sum( [Visits] ) ).
Create the rank filter measure
Start with the RANK function to rank the values DESC
Wrap the RANK function with an IF statement, saying IF (Rank <= X , 1, 0). This will return a value of 1 if the member is in the top X
Repeat this, but switch the RANK to a DESC in order to get a value of 1 if the member is in the bottom X
Add these two IF statements together, which will give you a value of 1 for Top X members and the Bottom X members
Create a widget filter from your formula, that filters where the value = 1
(Optional) Include the ranking:
If you just try to add your RANK function to the widget, it won't work. This is because the values in the widget are sliced by the widget filter down to just the Top/Bottom X, and then the RANK is calculated (which means the RANK will just show values of 1-10).
Create the true rank formula
Start with the RANK function to rank the values DESC, and wrap it within an IF statement
If the rank <= X, then just display the rank
else, count the unique values of the dimension and subtract the rank ASC + 1