on 03-17-2020 8:14 AM
I would like to create a concatenation in a calculation view.
For example,
if I have several rows like...
PLANT | CUSTOMER | LABEL
1 | 1 | A
2 | 1 | A
3 | 1 | B
I would like to create a aggregation / projection with this grouping
CUSTOMER | LABEL
1 | AB
Is that possible?
Thanks and regareds.
Hi
Try this way
Example code
SELECT A.CUSTOMER AS "CUSTOMER" , STRING_AGG(LABEL,',' ORDER BY CUSTOMER) AS "LABEL"
FROM
<TABLENAME> AS A
GROUP BY A.CUSTOMER;
This is kind of Transpose option
1. LABEL - is the column you are transposing
2. Order by clause - can be your any column in that table - I used customer itself. (example plant you can use)
Hope this help you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
9 | |
9 | |
9 | |
6 | |
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.