cancel
Showing results for 
Search instead for 
Did you mean: 

How do I add multiple different fixed reference lines in a chart with changing measures

04-17-2021 10:04 AM
Alex_B Participant
1619 views 4 comments Go to solution
0 Likes
SAP Managed Tags
Subscribe

Hi

i am using the standard setMeasureFilter script from Analytics Designer Development Handbook when I select a measure out of a Dropdown Field to select the measure for a Line Chart. Of course that is working well.

Furthermore I wanted to create individual fixed reference lines for every measure. Some are numbers, some are percentages - it depends. How do i set those individual reference lines per measure?

0 Likes

Accepted Solutions (1)

Accepted Solutions (1)

shady_shen
Product and Topic Expert
Product and Topic Expert
0 Likes

You can probably create a calculated measure using a script variable and use this calculated measure to create the (dynamic) reference line. Then you can manipulate the value of the reference line by assign the script variable.

Answers (1)

Answers (1)

Bob0001
Product and Topic Expert
Product and Topic Expert

There is no method setMeasureFilter, I assume you are either using DataSource#setDimensionFIilter or Chart#addMeasure, right? Would be interested in hearing back from you, which you are actually using?

I don't know your exact scenario, but maybe https://answers.sap.com/answers/13358278/view.html gives you an idea of how dynamically change measure based configurations.

Alex_B
Participant
0 Likes

Hi Bob,

thanks for your answer.

As described in the Developer Handbook on Page 163 Chapter 6.3 - but yes with DataSource#setDimensionFIilter or Chart#addMeasure.

https://saphanajourney.com/wp-content/uploads/2021/03/DeveloperHandbookSACAnalyticsDesigner.pdf

My exact scenario would be:

I have a dropdown with values(10 measures) from DataSource#getMeasures and when I select one of these Measures I do Chart#addMeasure to a Chart and ofc before I do Chart#removeMeasure the existing Measure of that Chart.

Every Measure should have a specific fixed reference line.

How do I add and remove Reference Lines with different values in the same way like Chart#addMeasure? Something like Chart#addReferenceLine(Value).

To what edgar has written - I can't quite imagine how it should go like this

Bob0001
Product and Topic Expert
Product and Topic Expert
0 Likes

Follow Edgar's instructions to create a calculated measure and use this as reference line. With that you have the possibility to manipulate the calculated measure via the script variable.