cancel
Showing results for 
Search instead for 
Did you mean: 

#SAC Set dimension filter value from a dashboard with hierarchy to another table

adriano1973
Explorer
0 Kudos
309

Hello experts

I have a dashboards where I use an item hierarchy: when I click it I want to pass the selected value to another table (using same model) , to have as result the table filtered with the item selected from first dashboard.

I did many attempts but without result.

I created a similar script over "On select" function of first dashboard:

var sel = Chart_7.getSelections()[0];  // Chart_7 is the first dashboard

Table_10.getDataSource().setDimensionFilter("dimItems", "[dimItems].[HryItemcode].[dimItems.ItemCodeMaster]");   // Table_10 is the receiver dashboard

What should I do to achieve the desidered result?

Thank you so much for your help

Adriano

View Entire Topic
jain06
Explorer
0 Kudos

Hi,

You can use the below script:Chart_1 is the source and Table_1 is target

var list=Chart_1.getSelections();
var list1=[""];
for(var i=0;i<list.length;i++)
{
list1[i]=list[i]["Product_3e315003an"];
Table_1.getDataSource().setDimensionFilter("Product_3e315003an",list1[i]);    
}
adriano1973
Explorer
0 Kudos
Hi, thank you so much for your solution, the script works fine if the two ojbects are in the same "form". But as I told you, I'd like to filter the Table_1 (same model of Chart_1 object) inside a popup (that is hidden at begin) in the form but it seems not working. The popup is called Popup_1 and after the script I do a Popup_1.open(). In this case the popup will open but the table will be empty. Do you have any idea why? Thank you
jain06
Explorer
0 Kudos

Applying filter on the table should be done from pop-up script. You can create a global variable as list1

Script for chart-

var list=Chart_1.getSelections();
for(var i=0;i<list.length;i++)
{
list1[i]=list[i]["Product_3e315003an"];    
}
StoryPopup_1.open();
Script for pop.open-
for(var i=0;i<list1.length;i++){
Table_2.getDataSource().setDimensionFilter("Product_3e315003an",list1[i]);

}