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

HANA Query group by but add values

$
0
0

Hello everyone,

 

I am trying to write a query in HANA that achieves the following:

Capture.PNG

So I want to make the Sales_ID unique. At the same time I want to add the Revenue of each Sales_ID.

What I did so far: Selecting Sales_ID and Revenue, group by Sales_ID and sum up the revenue. So far so good. But it doesnt work when I add the field "Product_ID" since there are different values in each row. (so it doesnt group anymore) But I'm good if I just have the Product_ID of the first row of each Sale.

 

How do I do that?

 

Greetings


Viewing all articles
Browse latest Browse all 6412

Trending Articles



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