Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

Average issue in analytical view

$
0
0

Hi,

 

I have a small requirement to calculate average based on region.

 

Whatever I am trying to do,first I am calculating SUM and then trying to put in calculated column say Sum(Salary) ( datatype i).

After that will do COUNT and again put in calculated column say Count(Salary)( datatype i ).

 

Now when I am trying to divide Sum(Salary)/Count(Salary) , its not working but when I am dividing Sum(salary) / 2 ( or say any number ) it works.

 

Can someone help? Am I going with wrong approach?

 

Table1


Region          Salary

A                    1000

A                    2000

B                    4000

B                    5000

 

Output:

 

Region          Salary

A                    1500

B                     4500

 

BR

Sumeet


Viewing all articles
Browse latest Browse all 6412

Trending Articles



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