Using the getResultSet() API with SAP Analytics Designer

How to use the getResultSet() APi with SAP Analytics Designer

The getResultSet() API is used to return result sets. A result set consists of property-value pairs. The property is a dimension name. The value contains information about the member or measure. You can get an array of result sets with getDataSource().getResultSet().

We are using an example from our Ownership Interface Analytics Application where we need to display the entity members for a scope, we read them from a hidden table with appropriate selection using the getResultSet() API. Then using the same API we will populate the Ownership report by scope.

Create two Script Objects, the first is the getScopeChildEntities with a return Type ResultSet and set as an Array, create one argument as a string called scopeId.

The second is the populateOwnershipTableByScope with a return Type void and do not set as an Array, nor create an argument.

This code is added to the getScopeChildEntities Script Objects fx

var results =Table_HiddenWrite.getDataSource().getResultSet({  
    "@MeasureDimension":"AMOUNT", 
    "Account":"[Account].[parentId].&[P_GROUP]",
    "AUDIT_TRAIL":"[AUDIT_TRAIL].[H1].&[INPUT]", // fixed
    "FLOW":"[FLOW].[H1].&[F99]",                 // fixed
    "INTERCO":"[INTERCO].[H1].&[I_NONE]",        // fixed
    "CURRENCY":"LC",                             // fixed
    //"ENTITY":"[ENTITY].[H1].&[ALL_ENTITIES]",  // ommited to get all
    "SCOPE": selectedScopeId,
    "Date": SV_String_selectedDateID,
    "Version": selectedVersion
});
return results; 

This code is added to the populateOwnershipTableByScope Script Objects fx

var selection = ({
    "@MeasureDimension":"AMOUNT", 
    "AUDIT_TRAIL":"[AUDIT_TRAIL].[H1].&[INPUT]", // fixed
    "FLOW":"[FLOW].[H1].&[F99]",                 // fixed
    "INTERCO":"[INTERCO].[H1].&[I_NONE]",        // fixed
    "CURRENCY":"LC",                             // fixed
    "ENTITY": part_entity_id,
    "Date":  SV_String_selectedDateID,
    "Version": selectedVersion
});

console.log(selection);

var data = Table_HiddenWrite.getDataSource().getResultSet(selection);

Test the result by adding a button to the Analytics Application, hide the button on run time after the testing is concluded.

Recent Posts

Story Popups vs. Page Popups in SAP Analytics Cloud

Master the use of popups in SAP Analytics Cloud with this practical guide. Understand when to use Story Popups vs. Page Popups, how to configure them, and boost your dashboard interactivity without sacrificing user experience.

InsightCubes Consolidation Extension for SAP Analytics Cloud

InsightCubes’ SAC Extension vs. NDC on SAP BTP

Compare InsightCubes’ SAC Consolidation Extension and NDC’s SAP BTP solution to determine the best financial consolidation approach for your business. This in-depth comparison covers system architecture, integration, functionality, deployment, and cost-effectiveness to help organizations make an informed decision.

Journal Entries Dashboard

SAP Analytics Cloud Journals: A Complete Guide

Journals in SAP Analytics Cloud (SAC) allow users to make financial adjustments, track audit trails, and ensure consolidation accuracy. This guide covers everything from journal entry creation to posting, locking, and reporting; empowering finance teams with full control over adjustments and compliance.

InsightCubes Consolidation Extension for SAP Analytics Cloud

Switch Themes in SAP Analytics Cloud

By leveraging the power of Theme Builder and integrating JavaScript and CSS, users can seamlessly tailor their dashboards’ appearance to align with specific brand guidelines and aesthetic preferences.

Ownership interface of the consolidation solution for SAP analytics cloud

Managing Ownership Structure

Explore how Consolidation Extension for SAC simplifies managing ownership structures, spanning from creating and editing scopes to assigning ownership methods and percentages for accurate consolidation.

Systems Check and Referential Integrity Interface

Learn how SAP Analytics Cloud’s Consolidation Extension ensures data accuracy with system checks and referential integrity, ensuring proper configuration and identifying inconsistencies in design.

Get in Touch

Learn more and ask us About Our Cloud Consolidation Solution

Share This Post

Share this Page!

Share this with your network.

Want to Know More?

Get In Touch

Something isn’t Clear?


Feel free to contact us, and we will be more than happy to answer all of your questions.