on 2024 Mar 22 7:36 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @N1kh1l, In sac on initialization is used the below code but i am not able to mention the related dimension"invalid property related dimension : cannot convert from array; array dimension info to selection prototype"
var d = Table_5.getDataSource().getDimensions();
Table_5.rankBy({
applyToEachDimension: true,
direction: Direction.Horizontal, // or Direction.Vertical
rankOrder: RankOrder.Top, // or RankOrder.Bottom
relatedDimensions:{d}, // Use getDimension to reference the dimension
value: 1
});
I tried to add dimension it showing
User | Count |
---|---|
77 | |
11 | |
10 | |
8 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.