cancel
Showing results for 
Search instead for 
Did you mean: 

how to choose between two indicators in a graph sap analytics cloud

Hello everyone, I am new to this SAP tool (SAP Analytics Cloud) and I have a line chart that represents the volume (indicator) by segment (dimension). I would like to be able to add a kind of filter to be able to insert between 2 indicators, volume and amount, and to be able to see only the volume, the amount, or both lines at the same time, how could I do this?

I would be very grateful if you give me a hand, thanks in advance, a greeting

Accepted Solutions (1)

Accepted Solutions (1)

JBARLOW
Contributor

Hi Abel,

There are a number of ways in which you could do this in Analytics Designer.
You could add/remove measures in the chart using the addMeasure script parameter , or you could apply a filter on the measures.

In the example below I've used a radio button group to filter the chart.
(Based on the best run juice sample dataset)

The code is placed in the onSelect property of the radio button group.

var Selected = RBG.getSelectedKey();  // get the value selected in the radio button group
var DS = Chart_1.getDataSource();     // get the chart datasource and write it to the variable 'DS'

DS.removeDimensionFilter(Alias.MeasureDimension); // Remove any current measure filters on the chart

if(Selected ==="Both") // if the value Both is selected in the radio button, apply a filter to show Discount & Gross Margin
{ DS.setDimensionFilter(Alias.MeasureDimension,["[Account_BestRunJ_sold].[parentId].&[Gross_Margin]","[Account_BestRunJ_sold].[parentId].&[Discount]"]);}

if(Selected ==="Gross Margin")
{ DS.setDimensionFilter(Alias.MeasureDimension,"[Account_BestRunJ_sold].[parentId].&[Gross_Margin]");}

if(Selected ==="Discount")
{ DS.setDimensionFilter(Alias.MeasureDimension,"[Account_BestRunJ_sold].[parentId].&[Discount]");}

Answers (1)

Answers (1)

N1kh1l
Active Contributor

Abel,

Try using input control on the account/measure in your chart. Something like below.

You can input control as below.

Regards

Nikhil