Quantcast
Channel: SCN : Discussion List - SAP HANA and In-Memory Computing
Viewing all articles
Browse latest Browse all 5653

1791464 - Select count(*) on graphical Calculation Views

$
0
0

Symptom

Select count (*) statement on top of a HANA graphical Calculation View leads to unexpected number of records in the result set.

 

 

Other Terms

HANA Calculation Engine

 

 

Reason and Prerequisites

It works as designed. The HANA Calculation Engine does not behave relational. At runtime the Calculation Engine executes an instantiation process, which transforms a stored calculation model to an executed calculation model based on a query on top of a calculation view.

 

The stored calculation model consists of a hierarchical order of calculation nodes. Each calculation node provides a defined set of attributes to the parent calculation node(s). Depending on the parent node(s) and the projection list in the query only the requested attributes will be considered in the calculation nodes of the executed calculation model.

 

The select count(*) statement does not specifiy a projection list of keyfigure(s) that shall be counted. Due the instantiation process the result set of the executed calculation model can vary.

 

 

Solution

You can overcome this situation by using built-in 'row.count' attribute in Analytical Views and its mapping into the graphical Calculation View

The built-in 'row.count' attribute is only generated, if an Analytical View contains one of the following characteristics:

  • Input parameter
  • Currency conversion
  • Calculated attribute
  • Calculated measure using attributes


In case the Analytical View does not have one of these characteristics, you can add e.g. a calculated attribute with a constant value.

 

Do the following steps in the HANA Modeler:
1. Create and activate the Analytical View as described
2. Create a graphical Calculation View on top of the Analytical View
3. You will see an additional 'row.count' attribute, when you click on the node for the Analytical View
4. Define the 'row.count' attribute as measure in the graphical Calculation View
5. It appears as 'row_count' measure, which is automatically mapped to the 'row.count' attribute of the underlying Analytical View
6. Activate the graphical Calculation View
7. Execute: 'Select sum("row_count") from "_SYS_BIC"."<CalcViewname>"'

 

The select statement returns the expected count(*) result for the underlying Analytical View.

 

 

Header Data

Released On04.04.2013 11:02:20
Release StatusReleased for Customer
ComponentHAN-DB SAP HANA Database
PriorityRecommendations / Additional Info
CategoryFAQ

 

Validity

This document is not restricted to a software component or software component version

 

References

This document refers to:

SAP Notes

1764658HANA Calculation Engine Instantiation Process

This document is referenced by:

SAP Notes (1)

1764658HANA Calculation Engine Instantiation Process

Viewing all articles
Browse latest Browse all 5653

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>