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

Aggregations in Calc view calculated columns are not working as expected

$
0
0

Hi All,

 

We are trying to get total number of employees in a region who generated more revenue than a threshold value in that region. To get that we have created a calculated column in HANA calc view as, IF(Revenue>1000,Employee ID, Null) and a counter on top of that.

 

If we take region in the query along with this measure, that is working fine. But when we include any other attribute with lower granularity than region, ex: sub region, its failing. Its giving less value compared to actual one.

 

We are running the below query,

select region, sum(Employee Count) from Table1

where sub_region not in ('Latin America','South Asia')

group by region

 

What we found is, whenever we include sub_region in the where clause, its aggregating the Revenue at Region, Employee ID, Sub Region level instead of Region and Employee ID level. Some employees are missing here as they are not meeting the threshold value in any of sub regions.

 

Do we have any workaround for this?

 

Thanks,

Ramesh


Viewing all articles
Browse latest Browse all 6412

Trending Articles



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