Child pages
  • Non relational behaviour of HANA calculation engine
Skip to end of metadata
Go to start of metadata

Introduction

While this is a problem that affects HANA in general, it may be specifically encountered when importing BW infoproviders as HANA models.

Example

2 BW infocubes were imported into the HANA database:

On top of these 2 analytic views, a calculation view is built that realizes a simple union:

When querying the 2 analytic views individually, the following results are returned:

select "0CURRENCY", count(*) 
from "_SYS_BIC"."BWIMP/COTST_INTERNAL" 
group by "0CURRENCY";
 
select "0CURRENCY", count(*) 
from "_SYS_BIC"."BWIMP/ICPAY_INTERNAL"
group by "0CURRENCY";
0CURRENCY;COUNT(*) 
ARS      ;9  
------------------ 
0CURRENCY;COUNT(*) 
ARS      ;150     
CAD      ;138     
EUR      ;25.378  
GBP      ;42      
JPY      ;620     
MXN      ;152     
USD      ;19.680 

The calculation view would however return the following:

select "0CURRENCY", count(*) 
from "_SYS_BIC"."BWIMP/TEST_COUNTER_UNION" 
group by "0CURRENCY";
0CURRENCY;COUNT(*) 
ARS      ;2       
CAD      ;1       
EUR      ;1       
GBP      ;1       
JPY      ;1       
MXN      ;1       
USD      ;1    

HANA SP9 provides a new feature that helps to get a better understanding about what is done here: The calculation view debugger. Detailed information on how to use it can be found in the HANA documentation here.

In general, the explanation of this behaviour can be found in SAP note 1764658.

The bottom line is the following:

In a calculation model the projection list of each calculation node in the calculation model is depending on the requested columns of the query or the parent calculation node(s). 

In addition, SAP note http://service.sap.com/sap/support/notes/1791464 explains the significance of having count( * ) on top of a calculation view:

The select count(*) statement does not specifiy a projection list of keyfigure(s) that shall be counted

So in the example from above, only 0CURRENCY is added to the projection list of the aggregation, which would be equivalent to

 

select "0CURRENCY" from "_SYS_BIC"."BWIMP/ICPAY_INTERNAL";
 
select "0CURRENCY" from "_SYS_BIC"."BWIMP/COTST_INTERNAL";
0CURRENCY 
ARS      
----------
0CURRENCY 
ARS      
CAD      
EUR      
GBP      
JPY      
MXN      
USD

 

 

 

  • No labels