cancel
Showing results for 
Search instead for 
Did you mean: 

Change Filter in SAC table To Top 5/Bot 5 based on Drop down of TOP and BOT

RAMNATH
Discoverer
0 Kudos

Hi folks,

I am new to SAC and I have this requirement to filter Top 5 or Bot 5 contributors on a Measure but I want it to be driven through the Input field Dropdown with two values TOP 5 and BOT 5. when I select the values the Table_1 should have a particular Measure restricted to top 5 values or Bottom 5 values.

I think it is possible to do it via Scripting changing filters of table . Can someone help me on filters.

Regards

Ram

 

 

 

Accepted Solutions (0)

Answers (1)

Answers (1)

N1kh1l
Active Contributor

@RAMNATH 

Create the dropdown for TOP5 and BOT5. Read the value of this dropdown, and based on the value rank the table.

var sel = Dropdown_1.getselectedkey(); This will return what was selected in dropdown.

if (sel === "TOP5" ) {
Table.rankBy({
	applyToEachDimension: false,
	direction: Direction.Horizontal, // or Direction.Vertical
    rankOrder: RankOrder.Top,   // or RankOrder.bottom
    relatedDimensions: <dimname>,//put your dim name
	value: 5
});

Nikhil