Quantcast
Channel: SCN: Message List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 9165

Re: Aggregate Functions Max and Min not working in Analytic and Calculation Views. However It works on Tables.

$
0
0

Hi Lars Breddemann,

 

We are also facing the same issue.

 

Details has been provided below for easier understanding-

 

Lets assume we have one master table(M_Employee) with three columns-

Empno.

Empname

Empaddress

 

and one fact table F_Employee

Empno.

EmpSal

EmpBonus

 

 

My requirement is that I want to see the employee details with minimum salary and maximum salary. It sounds easy but as I am new to Hana, could not able to find how I can achieve it.

 

Further to explain you-

I have created Attribute View (AN_EMP), Analytical View (AV_EMP) and Calculation View (CV_EMP).

 

Here in analytical view AV_EMP we have created two calculated measure with the aggregation function of MAX and MIN on the EMPSAL column, let’s assume calculated measures name as CM_MAX and CM_MIN. Now when I check the data of this view, the issue is that the data for both of these fields is coming as the data for SUMMATION Aggregate function value not for minimum and maximum aggregate function.

Same is the case with Calculation View CV_EMP.

 

Also if we try to calculate the minimum and maximum directly from the Analytical View and calculation view it didn’t work. In sql console we give-

 

SELECT MIN(EmpSal),MAX(EmpSal) from AV_EMP

SELECT MIN(EmpSal),MAX(EmpSal) from CV_EMP

 

Both of these return the values for Summation aggregation function which is equivalent to:

Select sum(EmpSal) from AV_EMP or CV_EMP

 

But if we tried to calculate the minimum and maximum directly from the table it works fine.

In sql console if we write-

SELECT MIN(EmpSal),MAX(EmpSal) from F_EMP

then it gives the  required minimum and maximum record which is our requirement.

 

Please guide me how to achieve it with calculation view.

 

 

Regards,

Prateek


Viewing all articles
Browse latest Browse all 9165

Trending Articles



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