Skip to content
NextLytics
Megamenü_2023_Über-uns

Shaping Business Intelligence

Whether clever add-on products for SAP BI, development of meaningful dashboards or implementation of AI-based applications - we shape the future of Business Intelligence together with you. 

Megamenü_2023_Über-uns_1

About us

As a partner with deep process know-how, knowledge of the latest SAP technologies as well as high social competence and many years of project experience, we shape the future of Business Intelligence in your company too.

Megamenü_2023_Methodik

Our Methodology

The mixture of classic waterfall model and agile methodology guarantees our projects a high level of efficiency and satisfaction on both sides. Learn more about our project approach.

Products
Megamenü_2023_NextTables

NextTables

Edit data in SAP BW out of the box: NextTables makes editing tables easier, faster and more intuitive, whether you use SAP BW on HANA, SAP S/4HANA or SAP BW 4/HANA.

Megamenü_2023_Connector

NextLytics Connectors

The increasing automation of processes requires the connectivity of IT systems. NextLytics Connectors allow you to connect your SAP ecosystem with various open-source technologies.

IT-Services
Megamenü_2023_Data-Science

Data Science & Engineering

Ready for the future? As a strong partner, we will support you in the design, implementation and optimization of your AI application.

Megamenü_2023_Planning

SAP Planning

We design new planning applications using SAP BPC Embedded, IP or SAC Planning which create added value for your company.

Megamenü_2023_Dashboarding

Business Intelligence

We help you with our expertise to create meaningful dashboards based on Tableau, Power BI, SAP Analytics Cloud or SAP Lumira. 

Megamenü_2023_Data-Warehouse-1

SAP Data Warehouse

Are you planning a migration to SAP HANA? We show you the challenges and which advantages a migration provides.

Business Analytics
Megamenü_2023_Procurement

Procurement Analytics

Transparent and valid figures are important, especially in companies with a decentralized structure. SAP Procurement Analytics allows you to evaluate SAP ERP data in SAP BI.

Megamenü_2023_Reporting

SAP HR Reporting & Analytics

With our standard model for reporting from SAP HCM with SAP BW, you accelerate business activities and make data from various systems available centrally and validly.

Megamenü_2023_Dataquality

Data Quality Management

In times of Big Data and IoT, maintaining high data quality is of the utmost importance. With our Data Quality Management (DQM) solution, you always keep the overview.

Career
Megamenü_2023_Karriere-2b

Working at NextLytics

If you would like to work with pleasure and don't want to miss out on your professional and personal development, we are the right choice for you!

Megamenü_2023_Karriere-1

Senior

Time for a change? Take your next professional step and work with us to shape innovation and growth in an exciting business environment!

Megamenü_2023_Karriere-5

Junior

Enough of grey theory - time to get to know the colourful reality! Start your working life with us and enjoy your work with interesting projects.

Megamenü_2023_Karriere-4-1

Students

You don't just want to study theory, but also want to experience it in practice? Check out theory and practice with us and experience where the differences are made.

Megamenü_2023_Karriere-3

Jobs

You can find all open vacancies here. Look around and submit your application - we look forward to it! If there is no matching position, please send us your unsolicited application.

Blog
NextLytics Newsletter
Subscribe for our monthly newsletter:
Sign up for newsletter
 

PlanViz for Analytical Models in SAP Datasphere

In our article “The hidden JSON-Hack for Database Hints in SAP Datasphere”, we showed you how to correct faulty or slow analytical models in SAP Datasphere using database hints. You can use PlanViz to track the execution of queries step by step. In this article, we will show you how to generate PlanViz files for SAP Datasphere analytical models.

While the generation of PlanViz is integrated into the user interface for SAP Datasphere transformation flows and views, for analytical models you need to take a small detour to obtain the required information.

Prerequisites for Generating PlanViz for Analytical Models

First, open the developer tools in your browser, e.g. in Chrome via Menu → More Tools → Developer Tools, or use the keyboard shortcut Ctrl+Shift+I.

Then, in SAP Datasphere, open your analytical model in Preview mode.

Drag the required dimensions and measures into rows or columns and set the filters to reproduce the performance issue or faulty calculation.

SAP-Datasphere-preview-analytical-model

Switch to the Network tab in the developer tools and set the filter to GetResponse. The first result corresponds to the exchanged metadata, while the subsequent ones, which start with Analytics, correspond to the respective drilldown in Datasphere.

001-filter-getresponse

Now click on View source under Payload, and then click on Show more to display the full query.

SAP-Datasphere-view-source

Then copy the entire query to the clipboard.

SAP-Datasphere-show-full-query


Watch the recording of our webinar: 
"SAP Datasphere and the Databricks Lakehouse Approach"


How to execute the Analytical Model Query in SAP HANA Database Explorer

Internally, SAP HANA Multi-Dimensional Services (MDS) are used to process queries in SAP Datasphere. These are translated into an execution plan for the SAP HANA Calculation Engine or into SQL, which is executed by the HANA core engines. We want to reproduce this on the HANA database.

For this, we need a database analysis user. To create a new user, follow the menu path System → Configuration → Database Access → Database Analysis Users.

SAP-Datasphere-configuration

Create a new user via Create and copy the password. Then click on Open Database Explorer and log in with the newly created user.

SAP-Datasphere-database-analysis-user

Open the SQL console in the SAP HANA Database Explorer.

SAP-Datasphere-open-sql-console

Copy the previously copied payload into the following CALL SYS.EXECUTE_MDS command.

CALL SYS.EXECUTE_MDS('Analytics', '', '', '', '',
'<Insert the copied payload here>' , ?);

After execution, you can view the required time under Messages tab. Even at this point, you can check whether this matches the time required in SAP Analytics Cloud and thus narrow down the cause of long-running reports.

007-messages

Generate the PlanViz Analysis File

To generate the PlanViz analysis, select the entry Generate SQL Analyzer Plan File under Analyze.

SAP-Datasphere-generate-sql-analyzer-plan-file

Assign a specific name. For longer-running requests, ensure that the generation is executed in the background by activating the Run Analysis as Background Activity option.

SAP-Datasphere-save-plan

You can view the background activities at the bottom right in SAP HANA Database Explorer.

010-background-activities-monitor

Now switch to the folder Database Diagnostic Files and then other. You can use the search function to look for the generated file. Then right-click and select Download to download the file.

Download-planviz

Analyze the PlanViz File

The analysis of the file can be performed in Eclipse using SAP HANA PlanViz. Alternatively, the extension SQL Analyzer Tool for SAP HANA is available for you in Visual Studio Code. Open Eclipse and follow the menu path Window → Perspective → Open Perspective → Other

Open_perspective_SQL_Analyzer_Tool

Then select the entry SAP HANA PlanViz and confirm your selection with Open.

sap-hana-planviz

Then open the downloaded file via File → Open File. The overview shows you the runtime and the operators used at a glance. If you want to dive deeper, the Executed Plan view provides you with detailed information on the individual execution steps. Here, the operations performed and their respective duration can be easily traced using the graphical interface.

planviz-analysis

Further Resources for SAP Datasphere Performance Analysis

We have explained working with PlanViz in detail in the post SQL Performance Analysis with SAP PlanViz. The analysis of the views used in analytical models is covered in the post Optimize SAP Datasphere Views-Visual Performance Analysis with PlanViz. Check it out!

PlanViz for Analytical Models in SAP Datasphere: Our Summary

Even though generating PlanViz files for Analytical Models in SAP Datasphere is not possible directly via the user interface, you can quickly achieve your goal using developer tools and the HANA Database Explorer. This provides you with a detailed insight into the execution of your queries.  On this basis, you can analyse performance issues in a targeted manner, pinpoint the causes of slow-running reports and subsequently optimise your analytical models effectively.

If you need support analyzing complex PlanViz files or optimizing slow-performing analytical models in SAP Datasphere, reach out to our experts. Whether you're troubleshooting a specific issue or looking to optimize your overall SAP Datasphere landscape, we can help you achieve measurable performance gains.

 

FAQ - PlanViz for Analytical Models

Here are some of the most frequently asked questions about Planviz for Analytical models in SAP Datasphere.

Why do I have to take the detour via developer tools for analytical models? For transformation flows and views, PlanViz generation is directly integrated into the SAP Datasphere user interface. This button is not available for analytical models. Therefore, you extract the underlying query manually via the network analysis of the browser developer tools and then execute it on the HANA database. 
What are SAP HANA Multi-Dimensional Services (MDS)? MDS internally process the multidimensional queries from SAP Datasphere. They translate the respective drilldown into an execution plan of the SAP HANA Calculation Engine or into SQL which is executed by the HANA core engines. You can replicate this exact processing using the CALL SYS.EXECUTE_MDS command.
Which entry in the Network tab do I need to copy? Filter for GetResponse. The first result contains the exchanged metadata. The subsequent entries that begin with "Analytics" correspond to the respective drilldown in Datasphere. You copy this payload via View source → Show more
Which command do I need to use in the HANA Database Explorer? The copied query is passed to the SAP HANA Multi-Dimensional Services (MDS). Use the following command in the SQL console of the HANA Database Explorer and insert your copied payload in the command: CALL SYS.EXECUTE_MDS('Analytics', '', '', '', '','<Insert the copied payload here>' , ?); 
Do I need special permissions in order to use PlanViz? Yes, you need a database analysis user. You create this via System → Configuration → Database Access → Database Analysis Users. Note down the password generated during creation in order to log in to the Database Explorer.
How can I check whether the model is the cause even before the PlanViz analysis? After executing CALL SYS.EXECUTE_MDS, you can see the required runtime under Messages tab. If this matches the time observed in SAP Analytics Cloud, then the cause of the long-running report actually lies in the analytical model or the database execution.
Does the PlanViz generation block my system? No, you can have the analysis run in the background. To do this, simply activate the Run Analysis as Background Activity option during creation (Generate SQL Analyzer Plan File). You can conveniently track the progress via the icon for background activities (bottom right).
Where can I find the generated PlanViz file? Navigate to the Database Diagnostic Files and other folder. Use the search function to find the file mentioned earlier, which you can download by right-clicking and selecting the Download option.
What do I use to analyze the PlanViz file? There are two ways available to you for the analysis: SAP HANA PlanViz in Eclipse (via Window → Perspective → Open Perspective → Other → SAP HANA PlanViz) or the „SQL Analyzer Tool for SAP HANA“ extension in Visual Studio Code. The Executed Plan view provides detailed information on the individual execution steps and their duration.

,

avatar

Dimitrios

Dimitrios has been working with Native HANA and SAP products since January 2020, and he joined NextLytics as an SAP consultant in early 2022. Thus, he has already gained a lot of hands-on experience with SAP Datasphere. In his free time, he enjoys hiking, watching movies and spending time with friends.

Got a question about this blog?
Ask Dimitrios

PlanViz for Analytical Models in SAP Datasphere
5:11

Blog - NextLytics AG 

Welcome to our blog. In this section we regularly report on news and background information on topics such as SAP Business Intelligence (BI), SAP Dashboarding with Lumira Designer or SAP Analytics Cloud, Machine Learning with SAP BW, Data Science and Planning with SAP Business Planning and Consolidation (BPC), SAP Integrated Planning (IP) and SAC Planning and much more.

Subscribe to our newsletter

Related Posts

Recent Posts