Hello,
I am new to the world of HANA, and I am writing a stored procedure which will be used in my calculation view.
The table data I will be working with is as below.
MARC-WERKS (Site) | MARC-MATNR (Article) | MARA-MATKL (Category) | CUSTOM Field |
---|---|---|---|
0001 | 1 | CAT1 | A |
0001 | 2 | CAT1 | A |
0001 | 3 | CAT1 | B |
0001 | 4 | CAT2 | B |
0001 | 5 | CAT2 | A |
0001 | 6 | CAT1 | B |
And my requirement is to get the number of times of the custom field data's recurrence aggregated by site and category, Example output shown below.
MARC-WERKS (Site) | MARA-MATLK (Category) | Number of A's | Number of B's |
---|---|---|---|
0001 | CAT1 | 2 | 2 |
0001 | CAT2 | 1 | 1 |
I have an understanding of how the calculation engine functions work, though it is structuring the SQLScript to calculate the number of times A and B recur per site/category which I am struggling to work out.
Hopefully I am on the right track with this!
Many thanks!