cancel
Showing results for 
Search instead for 
Did you mean: 

clear selection on chart

Former Member
0 Kudos

SAP BusinessObjects Design Studio

Release 1.6 SP1 Patch 2 (Version: 16.1.2)

Source: Relational database, thru UNX

In my application I have 1 chart, 1 scorecard  and 1 KPI to report

1. KPI = "# of Key Products"

2. chart: treemap of products (sales and # customers as two metrics by product required to plot treemap)

3. scorecard - product scorecard with each row representing one product

2 filtering actions:

click on multiple products (one by one) in treemap and then filter the scorecard on each selection.

also user can click on KPI ("# of Key Products") and the scorecard will clear all exisitng filters and shows all key products.

Issue:

when i make a selection of products on treemap (1 or more), my scorecard filters accoridngly. Now when I try to click on KPI, I'm able to clear all filters on scorecard query and apply new filter to show only Key Products. however the previously selected products on treemap as still showing up as selected. I wanted to clear all the selections on the treemap when ever user clicks on KPI and thus tried using the below code:

chart.clearSelection();

DS_Scorecard.clearAllFilters();

DS_Scorecard.setFilterExt(product, vKPIProducts);

When I test this using the below steps:

1. run the application

2. select a product on treemap (the scorecard shows only that product)

3. clicked the KPI number, then the treemap clears the selection done; the scorecard gets filtered to show the key products but almost immediately the scorecard again refreshes and shows all products. This last unwanted step i guess is caused by "clearSelection()" call but if I do not use it then I cannot clear selection on the treemap.

I checked below links and some more in SCN but couldnt slove my issue.

http://scn.sap.com/thread/3473811

http://scn.sap.com/thread/3807014

Accepted Solutions (1)

Accepted Solutions (1)

MustafaBensan
Active Contributor
0 Kudos

Hi Srikanth,

I suspect the issue is caused by the fact that the "On Select" event of the chart is triggered again when you execute the chart.clearSelection() method, so a filter on "ALL MEMBERS" is applied.  I would need to see your script code for the "On Select" event to be clearer though.

One approach you could try is the following:

1)  Create a global script variable called KPI_Clicked of type boolean with a default value of "false";

2)  In the "On Click" event of the KPI, set the KPI_Clicked variable to "true";

3)  In the "On Select" event of the chart, wrap the data source filter code in an if then statement such as the following:

if (KPI_Clicked) {

  KPI_Clicked = false;

} else {

// Execute filtering code

}

Regards,

Mustafa.

Former Member
0 Kudos

Thanks Mustafa for identifying the issue for me. Following  your solution I was able to solve the issue but hit another roadblock.

The steps followed on running the application:

1. click on a product in treemap: scorecard gets filtered accordingly (i could selection more products if required)

2. click on KPI number: the scorecard reflects only those key products and treemap selection also gets cleared. Here my initial problem gets resolved.

3. now when i click on any product in treemap, nothing happens. This is because I have set my variable vKPISelected value to "KPI 1 Selected" from default value of "none" and with this variable value my Treemap on select script ignores it and does nothing.

Hope I'm clear enough. The reason i'm not using boolean variable is that I have many KPI's shown on the dashboard and to keep things simple I have mentioned only 1 KPI in this discussion.

my code:

global variable: vKPISelected; default value "None".

KPI Number, On select code:

(notE: the reason i'm resetting vKPISelected variable on click of the KPI number the 2nd time so as to make it work like a on off button. Meaning if i click the KPI number first time it filters for Key products and on click of the KPI again it clears the fitler and shows all products)

if (vKPISelected == "KPI 1 Selected") {

  vKPISelected = "None";

}

else {

  vKPISelected = "KPI 1 Selected";

}

var territoryValue = DROPDOWN_TERRITORY.getSelectedText();

if (vKPISelected == "None") {

  ds_scorecard.clearAllFilters();

}

else (vKPISelected == "KPI 1 Selected") {

  ds_scorecard.clearAllFilters();

  ds_scorecard.setFilterExt("_LrJh8VA1EeaT08M75qoMbA", "DP");

}

chart_TREEMAP.clearSelection();

Treemap On select code

if (vKPISelected != "None") {

} else {

  // capture selected products on treemap

  var prd = IC_PRODUCT_TREEMAP.getSelectedMembers("_eaTRsLh0EeWuS70gbqxHFA");

  var referenceString="";

  

  prd.forEach(function(element, index) {

   referenceString=referenceString + element.text + ";";

  });

  // filter data sources based on treemap selection

  

  ds_scorecard.clearAllFilters();

  ds_scorecard.setFilterExt("_DIjrEbixEeWenPViqt7rlA", referenceString);

}

Thanks,

Srikanth

MustafaBensan
Active Contributor
0 Kudos

Hi Srikanth,

You have lost me a little here.  Can you provide a screenshot or mockup showing the

complete dashboard layout with ALL of the KPI Number texts?

Thanks,

Mustafa.

MustafaBensan
Active Contributor
0 Kudos

Hi Srikanth,

Just to clarify, is each KPI number text supposed to filter a group of Products or a group of measures?

I think your requirement could be much better managed using either a Dropdown Box or the new Segmented Button component instead of creating separate Text components for each KPI group.  You would be able to significantly streamline the code and it would be easier to resolve the current filtering issue you are facing.

Regards,

Mustafa.

Former Member
0 Kudos

Hi Mustafa,

Yes each KPI is supposed to filter the scorecard as well as the treemap. I would be displaying all KPIs on the dashboard and not in a dropdown box as that's the layout requirement. The user is free to click either the treemap or the different KPIs as he likes and what ever is clicked, that has to be displayed. I tried to put together a mockup to visualize the layout and flow of clicks/events.

Thanks,

Srikanth

MustafaBensan
Active Contributor
0 Kudos

Hi Srikanth,

Thanks for the detailed mockups.  The requirement is now clear.  I'll get back to you tomorrow with some options.

Regards,

Mustafa.

Answers (0)