Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

CDS views , partially overlapping data

Former Member
0 Likes
719

Hello Experts,


     I am working with CDS views. I want to select specific row from several partially overlapping data,  for example.

Origin data:    

Field 1Field 2Field 3Field 4
1aaa111bbb111R1
1NULLbbb111R2
1aaa111NULLR3
1NULLNULLR4
2NULLbbb222R5
2aaa222NULLR6
2NULLNULLR7
3aaa333NULLR8
3NULLbbb333R9
4NULLbbb444R10
4NULLNULLR11
5NULLNULLR12

After select:

Field 1Field 2Field 3Field 4
1aaa111bbb111R1
2aaa222NULLR6
3aaa333NULLR8
4NULLbbb444R10
5NULLNULLR12


          Since cant use sub-query or "order by" clause, so..., How can I do.

2 REPLIES 2
Read only

P1389307362
Explorer
0 Likes
569

Hi,

First take distinct values of column 1 and put a left outer join for other columns



https://help.sap.com/saphelp_hanaplatform/helpdata/en/b4/080c0883c24d2dae38a60d7fbf07c8/content.htm#...

Read only

henk_verdaasdonk4
Active Participant
0 Likes
569

Hi Kang,

I don't understand the exact requirement. Why is record R6, R8, etc. selected, on what logic?

Or is just random 1 record out of the set 2 and 3? So it could as well have been records R1, R5, R8, R10, R12?

Cheers,

Henk.