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?










share|improve this question




























    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?










    share|improve this question


























      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?










      share|improve this question















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 7 at 22:03









      Joel

      1,6086719




      1,6086719










      asked Nov 7 at 21:10









      Bigjo

      3191321




      3191321





























          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          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






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          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





















































          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







          這個網誌中的熱門文章

          Post-Redirect-Get with Spring WebFlux and Thymeleaf

          Xamarin.form Move up view when keyboard appear

          JBPM : POST request for execute process go wrong