• Solutions
  • Services
  • Sectors
  • Sharing
  • Over ons

Verbeter je SAP Analytics Cloud-Stories met scripting

Ontdek hoe je jouw dashboards kunt verbeteren met aangepaste logica in SAP Analytics Cloud! In deze video neemt Kris je mee door de eerste stappen van scripting om krachtige, op maat gemaakte functionaliteiten in je stories te ontsluiten.

Highlights:

  • Knoppen toevoegen met onClick acties

  • Toon/verberg panelen en popups

  • Maatregelen schakelen en meerdere objecten beheren

Hierbij de scripts voor de vier besproken topics in the McCoy TV: 

Show and Hide Panels 

Make sure this is on the onClick-sript of the button where you want to apply this:

// If the filterpanel is visible: hide the filterpanel
if (Demo_Filter.isVisible() === true) {
  Demo_Filter.setVisible(false);
  Demo_Body.getLayout().setLeft(15);
  Demo_Numeric.getLayout().setLeft(15);
}
// else if the filterpanel is invisible: show the filterpanel
else if (Demo_Filter.isVisible() === false) {
  Demo_Filter.setVisible(true);
  Demo_Body.getLayout().setLeft(250);
  Demo_Numeric.getLayout().setLeft(250);
}

Retrieve a Popup

Make sure you can close and open the popup.

  • To open the popup, use [Popup-name].open();

  • To close the popup, use [Popup-name].close();

CY <--> YTD Switch 

if (Switch_1.isOn() === false) {
  // Notification on the new setting
  Application.showMessage(ApplicationMessageType.Success, "You've selected YTD");
              
  // Remove CY Measures
  Chart_1.removeMember(Feed.ValueAxis, "20382204-0635-4508-3663-224197897322"); //Profit CY
  Chart_1.removeMember(Feed.ValueAxis, "22011059-3187-4902-3986-254867627317"); //Sales
  Chart_1.removeMember(Feed.ValueAxis, "34764521-4237-4475-3692-222410153142"); //COGS CY
              
  // Set YTD Measures
  Chart_1.addMember(Feed.ValueAxis, "37554691-7515-4533-3635-730697853521"); //Profit YTD
  Chart_1.addMember(Feed.ValueAxis, "42482451-2393-4233-3816-388409155026"); //Sales YTD
  Chart_1.addMember(Feed.ValueAxis, "51948958-7154-4722-3534-181755600934"); //COGS YTD
} else if (Switch_1.isOn() === true){

  // Notification on the new setting
  Application.showMessage(ApplicationMessageType.Success, "You've selected CY");

  // Remove YTD Measures
  Chart_1.removeMember(Feed.ValueAxis,  "37554691-7515-4533-3635-730697853521"); //Profit YTD
  Chart_1.removeMember(Feed.ValueAxis, "42482451-2393-4233-3816-388409155026"); //Sales YTD
  Chart_1.removeMember(Feed.ValueAxis, "51948958-7154-4722-3534-181755600934"); //COGS YTD
                                                                                     
  // Set CY Measures
  Chart_1.addMember(Feed.ValueAxis,"20382204-0635-4508-3663-224197897322"); //Profit CY
  Chart_1.addMember(Feed.ValueAxis, "22011059-3187-4902-3986-254867627317"); //Sales CY
  Chart_1.addMember(Feed.ValueAxis, "34764521-4237-4475-3692-222410153142"); //COGS CY
}

Measure switch

if (Switch_2.isOn() === false) {
  // Notification on the new setting
  Application.showMessage(ApplicationMessageType.Success, "You've selected Line");
  
  // Hide Charts
  Profit_Num.setVisible(false);
  Units_Num.setVisible(false);
  Gross_Num.setVisible(false);
  Sales_Num.setVisible(false);
  
  // Show Lines
  Profit_Line.setVisible(true);
  Units_Line.setVisible(true);
  Gross_Line.setVisible(true);
  Sales_Line.setVisible(true);
    
} else if (Switch_2.isOn() === true) {
  // Notification on the new setting
  Application.showMessage(ApplicationMessageType.Success, "You've selected Chart");
  
  // Hide Lines
  Profit_Line.setVisible(false);
  Units_Line.setVisible(false);
  Gross_Line.setVisible(false);
  Sales_Line.setVisible(false);
  
  // Show Charts
  Profit_Num.setVisible(true);
  Units_Num.setVisible(true);
  Gross_Num.setVisible(true);
  Sales_Num.setVisible(true);
}

Ben jij al een Friend of McCoy?

Als innovatiepartner willen wij graag blijven inspireren. Daarom delen wij graag onze meest relevante content, evenementen, webinars en andere waardevolle updates met jou.