cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple Filters in Design Studio using Charts

Former Member
0 Kudos

Hi all,

I am fairly new to Design Studio. I am using Calculation Views from Hana Studio as data sources and I am encountering some problems when trying to create filters using the ".setFilter(Dimension, value)" method in the "onSelect" option of charts:

I am using four different charts on my dashboard (tree maps, bar charts, pie charts).

I would like to set up my filters the following way:

In every chart only a single element can be selected, which then filters the other three charts given that dimension value. If a different element is chosen in the same chart, the other three charts should be filtered on that value instead.

However, when an element in a different chart is selected, I would like to keep the first filter and filter the remaining two charts using both selections.

I am not able to set up the right Selection Mode and code to create this behavior. Looking forward to any help.

Kind regards,

Moritz

Accepted Solutions (1)

Accepted Solutions (1)

MustafaBensan
Active Contributor
0 Kudos

Hi Moritz,

In order to suggest a solution specific to your scenario it would be helpful if you provided the following information:

1)  Whether the charts are using the same data source or different ones;

2)  Which dimensions you are using to filter each chart.

Regards,

Mustafa.

Former Member
0 Kudos

Hi Mustafa,

1) I am using different Data Sources for every chart.

2) The Dimensions I am using are nominal dimensions such as "Model" "CustomerComplaint" etc.

At the moment, I am using these dimensions as background filters for the charts where they are not shown. And my code in the onSelect method looks like this for the charts:

DS_2.setFilter("Dimension1",INFOCHART_1.getSelectedMember("Dimension1").internalKey);

DS_3.setFilter("Dimension1",INFOCHART_1.getSelectedMember("Dimension1").internalKey);

DS_4setFilter("Dimension1",INFOCHART_1.getSelectedMember("Dimension1").internalKey);

I have tried playing around with the possible selection modes and the options of clearing filters or selection somewhere in between, but I did not reach the expected result.

Kind regards,

Moritz

Former Member
0 Kudos

Hello Mortiz,

Here is what I think from what I understood. You may have heard of a concept called breadcrumb. To implement your requirement you should try implementing breadcrumb that will keep track of the order in which user clicks on charts to select filters.

Every time user clicks on a chart the script should check the the breadcrumb to apply filter to only those charts/data sources which are not recorded on the breadcrumb. This can be done using global script variables. I will try to put a pseudo code or actual BIAL script soon.

Thank you.

Regards,

Swapnil Koti

MustafaBensan
Active Contributor
0 Kudos

Hi Moritz,

Thanks for the clarification.  What you have described is effectively a cascading filter with charts and the setFilter() script example you have provided should in fact work as desired.  Here are my suggestions:

1)  Firstly, in each of the 4 data source initial views, you should make sure that all dimensions have the setting of Members for Filtering -> Only Values with Posted Data, as shown below:

There is actually no need to include any dimensions as background filters so after you have made the above settings, you can remove the dimensions from the Background Filter Panel.

2)  If after making the above settings, your issue still persists, then to help identify the problem you should setup your application as per the example below.  I have used nominal dimensions Region, Airline, Time Block and Weekday.

i)  Create your application as per the following screenshot:

ii)  Set the Selection Mode of each chart as shown below:

iii)  Create the following scripts:

INFOCHART_1 "On Select"

var mySelection = me.getSelectedMember("ZAIRLINID__ZAIREGN").internalKey;

DS_2.setFilter("ZAIRLINID__ZAIREGN", mySelection);

DS_3.setFilter("ZAIRLINID__ZAIREGN", mySelection);

DS_4.setFilter("ZAIRLINID__ZAIREGN", mySelection);

INFOCHART_2 "On Select"

var mySelection = me.getSelectedMember("ZAIRLINID").internalKey;

DS_1.setFilter("ZAIRLINID", mySelection);

DS_3.setFilter("ZAIRLINID", mySelection);

DS_4.setFilter("ZAIRLINID", mySelection);

INFOCHART_3 "On Select"

var mySelection = me.getSelectedMember("ZDEPTMBLK").internalKey;

DS_1.setFilter("ZDEPTMBLK", mySelection);

DS_2.setFilter("ZDEPTMBLK", mySelection);

DS_4.setFilter("ZDEPTMBLK", mySelection);

INFOCHART_4 "On Select"

var mySelection = me.getSelectedMember("0WEEKDAY1").internalKey;

DS_1.setFilter("0WEEKDAY1", mySelection);

DS_2.setFilter("0WEEKDAY1", mySelection);

DS_3.setFilter("0WEEKDAY1", mySelection);

iv)  To verify the applied filters with each selection, include the following script code for the data sources:

DS_1 "On Result Set Changed"

var airlineFilter = DS_1.getFilterText("ZAIRLINID");

var timeBlockFilter = DS_1.getFilterExt("ZDEPTMBLK");

var weekdayFilter = DS_1.getFilterText("0WEEKDAY1");

TEXT_1.setText("Airline: " + airlineFilter + ", Time Block: " + timeBlockFilter + ", Weekday: " + weekdayFilter);

DS_2 "On Result Set Changed"

var regionFilter = DS_2.getFilterText("ZAIRLINID__ZAIREGN");

var timeBlockFilter = DS_2.getFilterText("ZDEPTMBLK");

var weekdayFilter = DS_2.getFilterText("0WEEKDAY1");

TEXT_2.setText("Region: " + regionFilter + ", Time Block: " + timeBlockFilter + ", Weekday: " + weekdayFilter);

DS_3 "On Result Set Changed"

var regionFilter = DS_3.getFilterText("ZAIRLINID__ZAIREGN");

var airlineFilter = DS_3.getFilterText("ZAIRLINID");

var weekdayFilter = DS_3.getFilterText("0WEEKDAY1");

TEXT_3.setText("Region: " + regionFilter + ", Airline: " + airlineFilter + ", Weekday: " + weekdayFilter);

DS_4 "On Result Set Changed"


var regionFilter = DS_4.getFilterText("ZAIRLINID__ZAIREGN");

var airlineFilter = DS_4.getFilterText("ZAIRLINID");

var timeBlockFilter = DS_4.getFilterText("ZDEPTMBLK");

TEXT_4.setText("Region: " + regionFilter + ", Airline: " + airlineFilter + ", Time Block: " + timeBlockFilter);



The result of the above scripts is to show the effect of the filter selections as follows:


No filters


Filters applied




With the above application setup, the filtering works as expected.  Although my data sources are BW BEx Queries, the same result should occur with HANA Calculation Views as well.


Let me know how you go,


Mustafa.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello Mustafa,


Thank you so much for the in-depth answer. I set up my dashboard just like your example and the filtering seems to work. However, the dynamic text components show every filter twice when it is clicked ("Region: Latin America Latin America"). In order to clarify which filters are set at the moment, I would like to keep the selections that were made in the charts highlighted. At the moment, once a value in another chart is clicked the prior selection is getting lost.

Thank you very much once again.


Kind regards,

Moritz

MustafaBensan
Active Contributor
0 Kudos

Hi Moritz,

If you can provide screenshots of the Initial Views of each of your four data sources and the charts corresponding to each, I can try to provide further suggestions.

Regards,

Mustafa.