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

Incorrect result in Calculated Column of SAP HANA Calculation View

$
0
0

Hi All,

 

I am trying to create a Graphical Calculation view on top an Analytical View. Out put of the Analytical view looks something like this,

 

PERNRDate of BirthOrg UnitCount
12/23/1980A1
22/23/1980A1
32/23/1970B1
42/23/1984B1
52/23/1985B1

 

In the Calculation view, I have created a Calculated Column in the projection node, named "Employee Age" with expression as 'daysbetween("Date of Birth", now())' and it is added to the output as Aggregated Column (SUM). Count is also added to the output as an aggregated column (SUM).

 

Another calculated column "Average Age" is created in the Aggregation node, with the expression as "Employee Age" / "Count". When I display the result of Calculation view, with PERNR in the output, Age and Average columns as the same data and is calculated properly. But when I have data displayed at Org Unit level, both the calculated columns "Employee Age" and "Average Age" columns display incorrect data.

 

PERNROrg UnitEmployee AgeAverage AgeCount
1A36361
2A36361
3B46461
4B32321
5B31311

 

Org UnitEmployee AgeAverage AgeCount
A36182
B10936.333

 

At the Org unit level, both the employees in Org Unit "A", has the same date of birth. So the calculated column is picking up only one row and calculating SUM of Age as "36" instead of "72" and Average Age as "18" instead of "36".

 

What should I do to get the output right, I mean how can I make the calculated column consider both the employees for calculation of SUM and AVG.

 

Any pointers on this, would be of great help. Please let me know, if the example I have given above is not clear.

 

Thanks & Regards,

Vishwa


Viewing all articles
Browse latest Browse all 5653

Trending Articles



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