Skip to Content
0

SAP Design Studio - Getting the measure and filter with it

Jun 06, 2017 at 12:37 PM

537

avatar image

Hello dear community,

I have a question about how I can get the measure and filter with it.
In Design Studio I have a normal bar chart, where I show aggregated values with 3 measures, see below picture.

On the horizontal axis I have values called "OEsG" and on the vertical axis I have the count.
My goal is to get the measure I clicked.

For example: If I click the green bar of the OEsG = 'Sonstige', it should write the selected measure text (in this case it is "WSA bis 3 Monate") into a text box.

My idea was:

TEXT_1.setText( DS_BAR_CHART.getSelectedMember ("OEsG") );

But this just gives me the VALUE of the OEsG, but what I want is to write the name / text of the measure ("WSA bis 3 Monate" into a text box and then use it as a "filter".

tiuuc.png (12.8 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Tammy Powlas
Jun 06, 2017 at 12:55 PM
0

Hi - I recommend looking at Karol's blog about formatter function here: https://blogs.sap.com/2015/05/26/design-studio-15-view-on-data-binding-for-text/ - this looks like what you may be looking for - his example is a crosstab

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi Tammy,

thanks for your answer - but unfortunately it isn't what I am looking for.

As I explained, I need to get the text / name of the measure and not the value of it.

Regards,

Vu

0

Looks like Eshwar was able to do this in this blog - https://blogs.sap.com/2014/11/26/global-scripting-in-design-studio-14/ the third measure.

0
Mustafa Bensan Jun 06, 2017 at 02:09 PM
0

Hi Vu,

Your requirement is perfectly clear, in that you want to obtain the selected measure, as is your observation that getSelectedMember() only returns the chart category axis dimension member value. Unfortunately, your requirement is not supported by the standard Stacked InfoChart. There is no possible way to obtain the selected measure.

I would suggest you review the Partner chart extensions for Design Studio in the SAP App Center.

*** UPDATE ***

You can ignore my previous comment. I had an epiphany overnight and realised you can indeed achieve your requirement. You simply need to specify the Measures Dimension in getSelectedMember() instead of the Axis Category Dimension. The steps are as follows:

1. Create a Global Variable called myMeasure;

2. In the "On Select" event script of your chart, apply the following code:

myMeasure = me.getSelectedMember(<Measures Dimension ID>); 
TEXT_1.setText(myMeasure.text); 

3. To use the selected Measure as a filter, apply the following code in the "On Click" event of the text box:

DS_1.setFilter(<Measures Dimension ID>, myMeasure.internalKey);

Regards,

Mustafa.

Show 3 Share
10 |10000 characters needed characters left characters exceeded

Hi Mustafa,

just like the last time you helped me very much! Thank you, this works very fine!

But another question:
I want to display a crosstab without the measures, but still want to filter this crosstab with the measure value. I hope you understand what I mean, is this possible?

0

Hi Vu,

You're welcome, glad to hear the suggestion achieved the desired result.

For hiding the measures in a Crosstab, refer to the post: SAP Design Studio – Showing/Hiding Crosstab Columns with Measures with CSS and Scripting.

I am not sure what you mean by "still want to filter this crosstab with the measure value". Can you clarify?

Also, for future reference, as per the SCN Rules of Engagement, if you have a new question, you should post it separately instead of adding it to the existing question, so it is easier for members to find the solution.

Regards,

Mustafa.

0

Hi Mustafa,

thanks for your quick reply again.

I'm sorry for asking an answer here, next time I will do it as you said.

I have read the post you referred to but I still don't understand how to do that.

Can you help me here? I don't understand what to do, can you give me a step-by-step-"tutorial"?

The biggest problem I have here is the editing of the .css-File.

I don't know what to put in that file.

The scripting in Design Studio is no problem for me.



Regards,

Vu

0