on 06-08-2022 9:08 AM
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
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]");}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
10 | |
10 | |
8 | |
7 | |
7 | |
7 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.