Skip to Content
Author's profile photo Tammy Powlas

Design Studio Best Practices Scripting – ASUG Webcast Part 4

SAP’s Jie Deng covered this part of the webcast.  See Design Studio Best Practices Design Experience – ASUG Webcast Part 3  CSS Design Studio Best Practices ASUG Webcast Part 2 andDesign Studio Best Practices Webcast – Platform Specifics– ASUG Webcast, Part 1

Note the usual legal disclaimer applies that things in the future are subject to change.

/wp-content/uploads/2014/10/1chartselection_554877.png

Figure 1: Source: SAP

Figure 1 covers chart data selection capabilities

In property window, select the data source and select the key figures (“measures”)

In Figure 1 shows selecting only period 1 and 4

Use the data interface shown in Figure 1

/wp-content/uploads/2014/10/2chartdataselectionscripting_554878.png

Figure 2: Source: SAP

In the start-up event, you can use the chart to set data selection

What do you want to initiate for the chart, you can set the script as shown in Figure 2

/wp-content/uploads/2014/10/3chartdataselect_554921.png

Figure 3: Source: SAP

A third option for chart data selection is if you want to select dimension here, you implement with scripting and the value is result member. I finally tried this myself and understand this, thanks to this webcast.

/wp-content/uploads/2014/10/4multiple_554922.png

Figure 4: Source: SAP

Figure 4 shows the crosstab where if click OPEX and product margin, it should both display

A global variable is used in the code above

/wp-content/uploads/2014/10/5getmembers_554923.png

Figure 5: Source: SAP

Figure 5 shows Top 10 customers in the pie chart, based on those customers, they are assigned to a particular country and a customer hierarchy.  They belong to hierarchy node Russia.  The script sets field to get Russian

Get Data Source to get Russian as hierarchy node and do the filtering (note: I have not tried this)

/wp-content/uploads/2014/10/6linebreak_554927.png

Figure 6: Source: SAP

Figure 6 shows the Line Break – \n – add to text field

More to come.

Related:

Stay Ahead : Attend TechEd && d-code – Win Big SAP BI BusinessObjects HANA Hands-on Sessions

Join SAP at the end of October for Reporting & Analytics 2014 INTERACTIVE conference – register here

Upcoming related ASUG webcasts – you need to be logged on to ASUG.com to register:

Assigned Tags

      10 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Jeroen van der A
      Jeroen van der A

      Great posts,

      I was wondering about the country example for the customer selection though: here a foreach function is used although the dimension is only filled with one country as the first step was a filter on customer.

      Did you hear anything in the 1.4 that includes new options for working with arrays?

      Jeroen

      Author's profile photo Tammy Powlas
      Tammy Powlas
      Blog Post Author

      Hi -

      Thank you for commenting.

      we didn't get into the details of the scripting updates in yesterday's webcast.  I expect we'll hear/see more at SAP TechEd (&& d-code) Las Vegas

      Author's profile photo Former Member
      Former Member

      Hi Tammy,

      Nice Post 🙂
      I have one scenario where I need your advice.

      I have a datasource in my application in which there are five keyfigures and one dimension. I have one chart in application which I need to display on five different pages. For each time I have to use the dimension and a Key figure.
      Can I do that in script?

      Basically I want to use the same Chart and same data source but different KF everytime.

      Example:
      Keyfigures: KF1, KF2, KF3, KF4, KF5
      Dimension: Region

      Chart: CHART_1
      Button: Button_1

      Case 1: CHART_1 will display KF1 for  all values of dimension Region.
      Case 2: CHART_! will display KF2 for  all values of dimension Region.
      and so on...

      Regards

      Author's profile photo Tammy Powlas
      Tammy Powlas
      Blog Post Author

      Hi Atul - I think this is something you should try yourself and if you experience issues post your question as a new discussion in the forum.  I also encourage you to search before you post per SCN rules

      Author's profile photo Former Member
      Former Member

      I tried and I was able to do that runtime. Thanks. 🙂

      Author's profile photo Alfons Gonzalez Comas
      Alfons Gonzalez Comas

      Hi Tammy,

      Just a question. I am trying to follow the sample you provide to use Chart component setDataSelection method to select dimensions to display in different charts. The idea sounds great, as effectively would allow us to decrease dramatically the number of data source we are using on our apps, but I am not sure of have undertsood how it works. In our case (we are using a UNX universe)  we are not able to execute the code properly.

      My intial data view has 5 dimensions and the purpose is to show only 2 of them in a graph.

      This is the code I am writing

      CHART_COMPANY.setDataSelection({

        "_eizOFGZ9EeWIkOXYgpWw7Q" : "(RESULT_MEMBER)",

        "_ejr-5WZ9EeWIkOXYgpWw7Q" : "(RESULT_MEMBER)",

        "_732s4Y-YEeWxu6eov64bAg" : "(RESULT_MEMBER)"

      });

      but does "(RESULT_MEMBER)" really means? It is somekind of variable ? In my case DS manage it as the key corresponding to a memebr dimension and shows nothing.

      Could you clarify it?

      Thanks,

      Author's profile photo Tammy Powlas
      Tammy Powlas
      Blog Post Author

      Hi Alfons - RESULT_MEMBER, as far as I can tell, is just a parameter (not a variable in the application) to use in the method (looks like the JSON format)

      I just tried it - it works with BEx queries; when I can I will try against a universe as well.

      Author's profile photo Tammy Powlas
      Tammy Powlas
      Blog Post Author

      Hello Alfons - I could not get this to work with the universe as a datasource.  But please note I am not an experienced coder nor am I that experienced with the universe.

      The code works with the BEx queries - and I agree it is a nice feature

      Author's profile photo Alfons Gonzalez Comas
      Alfons Gonzalez Comas

      Hi Tammy,

      Thanks. Effectively I was suspecting that the feature does not work on UNX universes......I have already submitted as idea

      https://ideas.sap.com/D30434

      Please, if some one reads the thread an has same issue using UNX and setDataselection would be nice to vote it.

      Thx!

      Author's profile photo Lijun Shen
      Lijun Shen

      Hi Alfrons,

           I'm using universe data source. Using data selection to specify the total by means of RESULT_MEMBER is working for me. Maybe it is just a bug with specific DS version./wp-content/uploads/2015/12/2015_12_02_8_51_14_843050.png

      Best Regards,

      Shady