on 03-20-2024 8:08 PM
Hi experts.
I'm trying to build a CDS view mainly based on data from RPSCO table.
(this view is supposed to be used to feed an SAP Analytics Cloud model)
This table contains fields WLP01, WLP02 ... until WLP16, and each of them contains an amount related to january (for WLP01), to february (for WLP02) and so on until december -> WLP12 (I don't need WLP13,14,15,16).
My need is to make the following transformations :
as to say one line from RPSCO table (with no empty wlp fields from 1 to 12) should become 12 lines.
This is kind of a "transpose" copy-paste we could make in a spreadsheet.
I need one colum for the time dimension, and one for the figures (instead of 12 columns)
My SQL is too old to achieve something like this without an outside help (and I'm new to CDS view building).
My current piece of code is looking like this :
(I also need fields from other tables but it's another topic).
Thanks in advance to share the trick if you've solved this kind of situation already.
Regards.
Guillaume P.
Hello @Guillaume_P_FR
Unfortunately I am no ABAP/SQL Developer... but if you don't have one to ask, the only possibility I see here is that you create 12 views to select always one key figure.
In the end you create one final view with UNION to ingetrate all of them:
https://help.sap.com/doc/abapdocu_750_index_htm/7.50/de-de/abapunion_clause.htm
But I think the better option is to find someone who can code this 😉
Btw. for the other way round, this would be a potential solution:
https://blogs.sap.com/2019/07/16/transpose-or-merge-multiple-rows-in-one-row-cds-views/
BR, Martin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
10 | |
8 | |
6 | |
6 | |
6 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.