on 01-09-2014 2:38 PM
Hi Experts,
I am new SAP HANA.
Can any one of you help me on this issue?
Actually my input is:
Customer ID | Customer Name | Amount | Quantity |
---|---|---|---|
1000 | C1 | 1000 | 12 |
1000 | C1 | 2000 | 5 |
1000 | C1 | 1500 | 9 |
1000 | C1 | 1800 | 16 |
1001 | C2 | 500 | 18 |
1000 | C1 | 600 | 6 |
1000 | C1 | 700 | 17 |
1001 | C2 | 1860 | 5 |
1001 | C2 | 500 | 3 |
I need the result in the below format
Customer ID Customer Name Amount Quantity
1000 C1 1000 12
2000 5
1500 9
1800 16
600 6
700 17
Sub Total: 7600 67
1001 C2 500 18
1860 5
500 3
Sub Total: 2860 26
Grand Total: 10460 93
Hi Hityshi,,
The output which you are looking for is actually done in reporting tool like WebIntelligence (WebI).
Regards
Raj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Hityshi,
I was thinking that you wanted the output to be framed at the backend itself ( As we are all trying to push as much as reporting logic to backend to see the optimal performance of HANA )
As Raj, rightly mentioned we can use "Break" functionality in WebI to display customer id and name only once.
Adding to it,you might also want to do the Sub Totals and Totals also using WebI .
Please find the link below
Regards,
Krishna Tangudu
Hi Hityshi,
Are you looking for an output like this:
Please find the select statement i have used below:
select DISTINCT "Customer ID" AS "Customer_ID","Customer Name" AS "Customer_Name", sum("Amount"), sum("Quantity")
from krishna."Customer"
group by grouping sets WITH TOTAL
(
("Customer ID", "Customer Name","Amount","Quantity"),
("Customer ID", "Customer Name")
)ORDER BY 1 NULLS LAST,2 NULLS LAST
Regards,
Krishna Tangudu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.