Oracle Analytics Cloud and Server

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

How to modify this complex join in OBIEE Answers?

Received Response
71
Views
2
Comments
Abed Jaji
Abed Jaji Rank 1 - Community Starter

How do I achieve below join condition for one specific report in OBIEE 12c Answers?

Select * from A right outer join B

on (a.id = b.id and a.entity is not null)

I have defined everything in rpd except 'a.entity is not null'. When I add this condition 'a.entity is not null' in rpd or in Answers to table A, it adds it to the where clause which is not right result because I lose ID 4 and ID 5 records from table B. I don't want to lose them from Table B. Is it possible to achieve this through combining two analysis results using (UNION, INTERSECT or MINUS)? If not, what else can i try?

Table A

IDEntity
1CT
2VA
3PT
6Null
7GA

Table B

ID
1
2
3
4
5
6

Result needed:

IDEntity
1CT
2VA
3PT
4Null
5Null
Tagged:

Answers

  • [Deleted User]
    [Deleted User] Rank 10 - Analytics Guru

    Forget the query for a moment. What is that in terms of your model? What kind of entity should that represent? A dimension? A fact?

    The better you prepare the data, the easier it is to build things and you don't need to bother about them - especially in the front end you should NEVER have to think about this!

  • Abed Jaji
    Abed Jaji Rank 1 - Community Starter

    Resolve this issue through UNION in Answers.

    Select * from A right outer join B

    on (a.id = b.id)

    where a.entity is null

    UNION

    Select * from A right outer join B

    on (a.id = b.id)

    where a.id is null