Need filter on left outer join to be in join not in where clause in OBIEE
up vote
0
down vote
favorite
We are using obiee 11g.
In my repository (RPD), I have joined two tables with a left outer join (specifically, the Person
table left join the address
table).
In my analyses, I take some info of the person and some info of the address. I make a filter on the female persons and I get all female persons, even if they have no address.
But, I only want to see the address types 'HOME'
, so I thought to put in my analyses a filter on addressType='HOME' OR addressType is null
. Unfortunately, I don't get all the female persons anymore. I only get the female persons with an address type HOME
.
When I look at the generated query, I see:
select person.emplid,addr.address_type,addr.address3 from
person
LEFT JOIN address addr
on person.emplid=addr.emplid
WHERE person.sex='female'
AND ( address_type IN ('HOME')
OR
address_type IS NULL)
I see that the address_type
filter is put in the WHERE
clause, but here I want it to be set in the ON
clause of the LEFT JOIN
like this:
select person.emplid,addr.address_type,addr.address3 from
person
LEFT JOIN address addr
on person.emplid=addr.emplid
AND ( address_type IN ('HOME')
OR
address_type IS NULL)
WHERE person.sex='female'
If it is like this, it works, but I don't know how to force this in my analysis. Can someone help me?
obiee
add a comment |
up vote
0
down vote
favorite
We are using obiee 11g.
In my repository (RPD), I have joined two tables with a left outer join (specifically, the Person
table left join the address
table).
In my analyses, I take some info of the person and some info of the address. I make a filter on the female persons and I get all female persons, even if they have no address.
But, I only want to see the address types 'HOME'
, so I thought to put in my analyses a filter on addressType='HOME' OR addressType is null
. Unfortunately, I don't get all the female persons anymore. I only get the female persons with an address type HOME
.
When I look at the generated query, I see:
select person.emplid,addr.address_type,addr.address3 from
person
LEFT JOIN address addr
on person.emplid=addr.emplid
WHERE person.sex='female'
AND ( address_type IN ('HOME')
OR
address_type IS NULL)
I see that the address_type
filter is put in the WHERE
clause, but here I want it to be set in the ON
clause of the LEFT JOIN
like this:
select person.emplid,addr.address_type,addr.address3 from
person
LEFT JOIN address addr
on person.emplid=addr.emplid
AND ( address_type IN ('HOME')
OR
address_type IS NULL)
WHERE person.sex='female'
If it is like this, it works, but I don't know how to force this in my analysis. Can someone help me?
obiee
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
We are using obiee 11g.
In my repository (RPD), I have joined two tables with a left outer join (specifically, the Person
table left join the address
table).
In my analyses, I take some info of the person and some info of the address. I make a filter on the female persons and I get all female persons, even if they have no address.
But, I only want to see the address types 'HOME'
, so I thought to put in my analyses a filter on addressType='HOME' OR addressType is null
. Unfortunately, I don't get all the female persons anymore. I only get the female persons with an address type HOME
.
When I look at the generated query, I see:
select person.emplid,addr.address_type,addr.address3 from
person
LEFT JOIN address addr
on person.emplid=addr.emplid
WHERE person.sex='female'
AND ( address_type IN ('HOME')
OR
address_type IS NULL)
I see that the address_type
filter is put in the WHERE
clause, but here I want it to be set in the ON
clause of the LEFT JOIN
like this:
select person.emplid,addr.address_type,addr.address3 from
person
LEFT JOIN address addr
on person.emplid=addr.emplid
AND ( address_type IN ('HOME')
OR
address_type IS NULL)
WHERE person.sex='female'
If it is like this, it works, but I don't know how to force this in my analysis. Can someone help me?
obiee
We are using obiee 11g.
In my repository (RPD), I have joined two tables with a left outer join (specifically, the Person
table left join the address
table).
In my analyses, I take some info of the person and some info of the address. I make a filter on the female persons and I get all female persons, even if they have no address.
But, I only want to see the address types 'HOME'
, so I thought to put in my analyses a filter on addressType='HOME' OR addressType is null
. Unfortunately, I don't get all the female persons anymore. I only get the female persons with an address type HOME
.
When I look at the generated query, I see:
select person.emplid,addr.address_type,addr.address3 from
person
LEFT JOIN address addr
on person.emplid=addr.emplid
WHERE person.sex='female'
AND ( address_type IN ('HOME')
OR
address_type IS NULL)
I see that the address_type
filter is put in the WHERE
clause, but here I want it to be set in the ON
clause of the LEFT JOIN
like this:
select person.emplid,addr.address_type,addr.address3 from
person
LEFT JOIN address addr
on person.emplid=addr.emplid
AND ( address_type IN ('HOME')
OR
address_type IS NULL)
WHERE person.sex='female'
If it is like this, it works, but I don't know how to force this in my analysis. Can someone help me?
obiee
obiee
edited Nov 7 at 22:03
Joel
1,6086719
1,6086719
asked Nov 7 at 21:10
Bigjo
3191321
3191321
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53197866%2fneed-filter-on-left-outer-join-to-be-in-join-not-in-where-clause-in-obiee%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown