Skip to Content

Lasso and Reverse Lasso are important workarounds in SAP BusinessObjects Design Studio. Using the Lasso selection functionality allows you to select a particular chart area and zoom into it. Reverse lasso is unique because allows you to remove a particular selection from the chart.  Learn more about them from:

Lasso – http://scn.sap.com/community/businessobjects-design-studio/blog/2014/12/12/design-studio-14-chart-enhancements
Reverse Lasso – http://visualbi.com/blogs/design-studio/general/reverse-lasso-in-sap-businessobjects-design-studio/

We have already seen that Lasso and Reverse Lasso can be implemented separately. However, we had a requirement to implement both of them at the same time. i.e one after the other. One of the limitations we encountered was that the selection on a chart is retained once we lasso and unless we do a clearSelection(), but clearSelection() triggers the onClick() of the chart component, thus clearing the lasso filters.

One approach was to use multiple charts and toggle visibility, but since the application had performance issues due to the number of components, we had to find a workaround while using a single chart to implement the required functionality.

Since we have previous blogs on how to implement lasso and reverse lasso, this blog will focus on how to integrate lasso and reverse lasso together in a single chart component. The logic is to append the Lasso elements with the Reverse Lasso elements and pass on the combined elements as a filter to get the expected outcome.

var members = CHART_1.getSelectedMembers(“ZR_STOKY__ZR_STKEY”);           //Getting selected members of the chart
if ( RADIOBUTTONGROUP_1.getSelectedValue()==”Lasso”) //Lasso or reverse lasso selection
{
lasso = “”;                                              //String to store the elements to global variable lasso
members.forEach(function(element, index) {
if (Convert.indexOf(lasso, element.internalKey)==-1)             //To add an element to the Lasso string if its not present, else omit it
{
lasso = lasso + element.internalKey+”;”; //If multiple entries of same element are present , it throws error when filtered
}
});
if (lasso!=””)  //Clear Selection triggers onSelect to prevent the clearing of filters
{
DS_1.setFilterExt(“ZR_STOKY__ZR_STKEY”, lasso+revlasso);   //Set filter on the dimension that include the lasso and Reverse lasso elements
}
}
else
{
members.forEach(function(element, index) {
if (Convert.indexOf(revlasso, element.internalKey)==-1)    //To add an element to the Reverse lasso global variable string if it’s not present, else omit it
{
revlasso = revlasso + “!”+element.internalKey+”;”;
}
});
DS_1.setFilterExt(“ZR_STOKY__ZR_STKEY”, revlasso+DS_1.getFilterExt(“ZR_STOKY__ZR_STKEY”)); //Set filter on the dimension that include the lasso and Reverse lasso elements
}
CHART_1.clearSelection(); //Clears the selection on the chart

Let’s consider a simple scenario :-

In the initial view we have sales for all the states.

/wp-content/uploads/2016/03/1_918394.png

Lasso is selected from the radio button and few members are selected for Lasso

/wp-content/uploads/2016/03/2_918416.png

The Selected members are filtered out and zoomed.

/wp-content/uploads/2016/03/3_918417.png

Now selected Reverse Lasso and selected all but 2 members on the chart to remove them.

/wp-content/uploads/2016/03/4_918419.png

We get the elements that were not selected now zoomed in.

/wp-content/uploads/2016/03/5_918421.png

This procedure can be done infinite times as per the user requirement.

To reset the selections a button to clear the filter on the particular dimension can be provided.

Source : http://visualbi.com/blogs/design-studio/general/continuous-lasso-reverse-lasso-sap-businessobjects-design-studio/

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply