Requirement to combine data in two cubes-need help

Hi all,
There is a cube which has Material number and Amount .
There is one more cube which has material number and salesindicator.
We need report in such a way that the common material numbers in both cubes should display amount and sales indicator values and uncommon material numbers should also be displayed.
Suppose MATO01 is material numebr in cube 1 with amount 200.
It should display same 200 for MATO01 in cube2 even though amount is not an infobject in cube2.
How to achieve this.
Please suggest.
Thanks in advance!

Hi Pallavi,
You can create a multiprovider on both the cubes and build a query on this multiprovider.
In this case, the characteristics from both the cubes will be available for reporting.
Regards,
Srinivas Kamireddy.

Similar Messages

  • OBIEE 11g - Combine data from two Oracle tables

    Good day!
    I tried to combine data from two Oracle tables as fact data, but it doesn't work.
    My steps: I created SCOTT.EMP2 table from SCOTT.EMP table, update EMPNO and ENAME values of EMP2 table to distinguish data of my tables. Then I imported physical tables DEPT, EMP and EMP2 to BIEE 11g, created joins DEPT-EMP and DEPT-EMP2 in physical diagram. Then I dragged DEPT and EMP tables to BMM, and EMP2 table to EMP as second LTS. In Content tab for EMP and EMP2 I checked "This source should be combined with other sources at this level" checkboxes. Then I renamed logical tables EMP and DEPT to Employees and Departments and dragged them to Presentation area. In Answers I created Analysis with columns DNAME and ENAME.
    The problem is that data on results tab is only from one physical table EMP or EMP2 (depending on the order of sources EMP and EMP2 of LT Employees) and not from both.
    Can anybody help? Am I missed something?
    Al.

    Hi Al,
    I think you have to define the content of the LTS.
    http://download.oracle.com/docs/cd/E12096_01/books/admintool/admintool_BusModSetup16.html
    You have to specify the content of the different fragments.
    http://download.oracle.com/docs/cd/E12096_01/books/admintool/admintool_SetUpAggNav3.html#wp1005333
    Maybe you have to add an additional column 'Source' ('EMP1', 'EMP2')
    Good Luck,
    Daan Bakboord
    http://obibb.wordpress.com

  • Loading data into two cubes

    We want to set up a delta refresh from R/3 data that will pull data into two cubes.  One cube I want all the records to be loaded, in the second cube I want to filter the records that are loaded into that cube.  I can figure out how to load the data into two cubes, but can I place a filter on one of the loads.  (i.e. only load records of where type = 'X')
    Thanks,
    Chris

    You can do that in the Update Rules to the second cube... In the Start Routine...
    DELETE FROM DATA_PACKAGE
    WHERE type EQ 'X'.
    (Please, verify the right syntax)
    Then with only one Infopackage, you can load both cube with different conditions.
    Hope it helps.
    Regards,
    Luis

  • Combining Data into one Cube from two Data-sources..

    Dear Experts,
    I am pulling data from two data sources and trying to combine in one Info-Cube. The data are like
    Data-Source 01
    1. GUID  --Common
    2.Document No ( User Entry)
    3.Dist. Channel
    4.Transaction Type
    5.Date and Quantity
    Data-Source 02
    1.GUID -- Common
    2.Billing Document ( If User drill down according to Document No , Billing Document should come in the report )
    3.Billing date
    4.Net Value
    Out of the datas , The GUID is common between the 2 data-sources.  I was thinking that, tha data will take according to its place and If i select the Document No in Report, it will atomatically fetch all the data like Tran type, dist ch, Billing Document No , Billing date.. .
    The problem is , in the report Tha data is not coming as I was thinking.
    And Another problem is , In future I need to create a Multiprovider between the above mentioned Info-cube and One ODS. And  DOCUMENT NO is common in Cube and ODS.
    Please Suggest,
    How can I proceed for the following requirement.
    Thanks,
    Sanjana

    Hi Sanjana,
    In your case cube will create a problem because it will have multiple records . For example :
    Data-Source 01 :
    1. GUID -- 101
    2.Document No - 999
    3.Dist. Channel - DL
    4.Transaction Type - GPRO
    5.Date and Quantity - 20.02.2011 & 20
    Data-Source 02
    1.GUID -- 101
    2.Billing Document - 6000
    3.Billing date - 03.03.2011
    4.Net Value - 500
    Your cube will have 2 records . And your requirement is to show above two records in 1 record in the report .
    Why dont you make an ODS in between , where you can put GUID as the Key field and rest all the fields as data fields. Create 2 transformations to this DSO from the 2 datasources . And let it get updated one by one . Your DSO will have 1 record only . Now either you do reporting on this DSO or take the data to the cube .
    Hope the above reply was helpful.
    Kind Regards,
    Ashutosh Singh
    Edited by: Ashutosh Singh on May 19, 2011 1:34 PM

  • Pulling in data from two cubes in one common report in OBIEE

    Hi,
    We have a scenario wherein we are using Oracle OLAP Cubes as data source for reporting against OBIEE v10.1.3.3.2. The specific question that we have can be exemplified as below:
    The Analytic Workspace (as created using AWM) has the following seven dimensions:
    Dimension A
    Dimension B
    Dimension C
    Dimension D
    Dimension E
    Dimension F
    Dimension G
    Based on the above dimensions, we have the following cubes:
    Cube One : Dimension A, Dimension B, Dimension C, Dimension D and Dimension E
    Cube Two : Dimension D, Dimension E, Dimension F, Dimension G
    So essentially, we have two cubes in the same Analytic Workspace and they do have a few dimensions in common.
    What we now need to know is how best to include these two cubes in the same logical model in the business and presentation layers of the OBIEE repository - this needs to be done because we want to include measures from both the cubes in a common report.
    Any ideas on the implementation of this scenario are highly appreciated.
    Regards,
    Piyush

    Hello Wildmight,
    I am sorry for the duplicate updates - and I regret the inconvenience caused.
    Here is what we are trying to achieve:
    We have a Business Domain wherein two measures are of importance : M1 and M2. Also, we now know that M1 and M2 are dimensioned as below:
    M1 - Dimensions A, B, C, D , E , F, G and H
    M2 - Dimensions C, D , F and G
    Hence, we are looking at an AW with 8 dimensions and two cubes : One for M1 with 8 dimensions and the other for M2 with 4 dimensions. Also, here comes the need to have a report wherein we can see the values of M1 and M2 in the same report and then do some calculations and analysis using both the figures at the same time. What we now need to know is how best to include these two cubes (which have 4 dimensions in common) in the same logical model in the business and presentation layers of the OBIEE repository so that we can address the reporting requirement of having values of M1 and M2 in the same report.
    Any help is much appreciated.
    Best Regards,
    Piyush

  • MDX query for to get the data from two cubes

    Hi
    Can you tell me how to create MDX query to get the values from two cubes.  (One hierarchy from first cube and one hierarchy from second cube)
    Can you give me one example.
    Regards,
    Madhu.
    Sudhan

    Hi Sudhan,
    According to your description, you want to retrieve data from two different cubes, right? The short answer is yes. To query multiple cubes from a single MDX statement use the LOOKUPCUBE function (you can't specify multiple cubes in your FROM statement).
    The LOOKUPCUBE function will only work on cubes that utilize the same source database as the cube on which the MDX statement is running. For the detail information about it, please refer to the link below to see the blog.
    Retrieving Data From Multiple Cubes in an MDX Query Using the Lookupcube Function
    Regards,
    Charlie Liao
    TechNet Community Support

  • Reg: To automate deletion of data in two cubes at a time

    Hi,
    I want to automate deletion of two cubes at a time using abap code. The selection criteria will be same for both the cubes.
    Will it be possible to do?
    Please help.
    Regards,
    Sameer.

    HI,
    please see the below link
    How can we automate the process of selective deletion in process chain
    and there is a good PDF document is there on this
    https://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/603a9558-0af1-2b10-86a3-c685c60071bc#rating
    thansk & Regards,
    Sathish

  • Error when extracting data with extractor 2lis_04_matnr - NEED HELP ASAP !!

    Hi experts!
    Got an error when extracting data with extractor 2lis_04_matnr.
    System says (short dump):
    DUMP TEXT START----
    Runtime error:    CONNE_IMPORT_WRONG_COMP_TYPE
    Exception:   CX_SY_IMPORT_MISMATCH_ERROR
    Error when attempting to import object "MC04P_0MAT_TAB".
    The current ABAP program "SAPLMCEX" had to be terminated because one of the statements could not be executed. This is probably due to an error in the ABAP program. When attempting to import data, it was discovered that the data type of the stored data was not the same as that specified in the program.
    An exception occurred. This exception is dealt with in more detail below. The exception, which is assigned to the class 'CX_SY_IMPORT_MISMATCH_ERROR', was neither caught nor passed along using a RAISING clause, in the procedure  "MCEX_BW_LO_API" "(FUNCTION)".                                                                             
    Since the caller of the procedure could not have expected this exception      
    to occur, the running program was terminated.                                
    The reason for the exception is:  When importing the object "MC04P_0MAT_TAB", the component no. 5 in the dataset has a different type from the corresponding component of the target object in the program "SAPLMCEX". <b>The data type is "D" in the dataset, but "C" in the program.</b>
    DUMP TEXT END----
    Please, can someone explain me how to solve it? 
    Really need help ASAP!
    Thanks in advance,
    Jaume
    Message was edited by:
            Jaume Saumell
    Message was edited by:
            Jaume Saumell

    Hi,
    Check this note: 328181
    So you need to delete entries in SM13/LBWQ for application and also detup table content.
    And then refill teh set up table.
    If you are in production clear the entries by running collective run no of times for this application 04.
    With rgds,
    Anil Kumar Sharma .P

  • Data from two cubes to display in same grid - Actual/planned comparison

    Hi All,
    I want to show planned and actual data in the same grid. For example,
    qty-2011001     qty-2011002     qty-2011012
    actual   plan      actual    plan     actual     plan
    Here quantity is shown for fiscal year periods. For each fiscal year period actual and planned quantity should be shown in adjacent columns in bex analyzer. But in my model actual and planned data are in two different cubes. So how can I show in the same grid.
    I thought of creating a multiprovider or infoset and by combining them we can pull data from both of them to show in the same grid. But it resulted in errors.
    I was wondering if there are any interesting workaround for this.
    Thanks and Regards,
    Jerry

    Hi,
    this is a standard requirement and very easy to model. To key figures (actual and plan) are not need.
    1. Create a cube for actuals A and one for plan data P. Both contain the same key figure.
    2. Create a multiprovider with both cubes and use the default mapping for key figures and characteristics
    3. Create an aggregation level on top of the multiprovider with the characteristics and key figures you need
    4. Create a query with two restricted key figures, e.g.
    Quan actual: restrict by 0INFOPROV = A
    Quan plan: restrict by 0INFOPROV = P, make this element input-ready.
    Drill-down 0FISCPER on columns.
    Thats all.
    Regards,
    Gregor

  • Error in Abap code when combining data from two tables

    Hi,
    I got error in my code when  i try to select data based on two tables
    error message Unknown column name "(" field list. field list. field list. field list.
    select ( WLK1~ARTNR )
              into ZOXE1D0041-ZZPROMO
              from WLK1 INNER JOIN T001W
              ON WLK1FILIA = T001WKUNNR.
              where WLK1-PFLKN NE 'P' AND
              WLK1-QUELL NE '2'.
    Table 1 WLK1
    ARTNR   FILIA       PFLKN                  QUELL
    001         C001        P                           2
    002         C001        A                          1
    Table 2  T001W
    KUNNR                WERKS
    C001                    P001
    My requirement is to extract from article number from table WLK1 where the customer number (FILIA) matches with Customer number from (T001W) and plant (WERKS).
    In conclusion I like to have this only this row
    ARTNR   FILIA       PFLKN                  QUELL
    002         C001        A                          1

    Hi
    You need to append every article number after each select is performed
    is this an intermal table ZOXE1D0041 with header line ? if yes
    then do this way
    select WLK1~ARTNR
    into ZZARTICLE
    from WLK1 INNER JOIN T001W
    ON WLK1FILIA = T001WKUNNR
    where WLK1~PFLKN NE 'P' AND
    WLK1~PFLKN NE 'S' AND
    WLK1~QUELL NE '2'.
    ZOXE1D0041-ZZLISTARTICLE = ZZARTICLE.
    Append ZOXE1D0041.  " <edited>
    endselect.
    then ZOXE1D0041 will have all article numbers.
    Edited by: Sonal Patel on Sep 5, 2009 10:27 AM

  • How to merge the data from two cubes into ODS?

    Hi,
    I wan to analyze the data of both the cubes by means of merging into an ODS.
    And i want to have one of the characteristic is used as a key for the purpose which is existing in both the cubes
    Cany nay one detail me of how this can be done?
    Thanks,
    Ravi

    Hi,
    If it is very needful.
    you can create the ODS object for each infocubes and map these ODS objects to target ODS object.
    or, you can create the Export datasources from each infocube and map these to new target ODS object which is having all the char and KF of both the infocubes.
    reg.
    Vis

  • How to combine data from two rows into one row

    I have the following sets of data. I want to find all the duplicate sets of field values. in the data below there is only one duplicate set: brenda, analyst, green.
    DocID and Doc Seq combine to form the set key. FieldID I believe are consistent in that 1 is always name, 2 is job, 3 is favorite color etc. but there are up to 20 field IDs.
    To tell you the truth, my client is a bit sketchy about the data and the values. I would like collapse the sets by getting all the field values into a single row. They could be in the same column, or in their own columns. This way I can then look for whatever
    dups my customer seems to think that he has.
    the first image is what i want (either in same column or in different columns. but they have to be in the order of the FieldID), the second is what i have. THANKS

    CREATE TABLE #t (
    c1 INT NOT NULL PRIMARY KEY,
    c2 VARCHAR(50) NOT NULL
    GO
    INSERT INTO #t(c1, c2) VALUES(1, 'P1,P2,P3')
    INSERT INTO #t(c1, c2) VALUES(2, 'P2,P3')
    GO
    -- Generate set of numbers
    -- Idea from Itzik Ben-Gan
    ;WITH
    L0 AS (SELECT 1 AS n UNION ALL SELECT 1),
    L1 AS (SELECT 1 AS n FROM L0 AS a, L0 AS b),
    L2 AS (SELECT 1 AS n FROM L1 AS a, L1 AS b),
    L3 AS (SELECT 1 AS n FROM L2 AS a, L2 AS b),
    L4 AS (SELECT 1 AS n FROM L3 AS a, L3 AS b),
    Numbers AS (SELECT ROW_NUMBER() OVER(ORDER BY (SELECT 1)) AS Number FROM L4)
    SELECT
    t.c1,
    t.c2,
    SUBSTRING(',' + t.c2 + ',', Number + 1, CHARINDEX(',', ',' + t.c2 + ',', 
    Number + 1) - Number - 1) AS Item,
    ROW_NUMBER() OVER(PARTITION BY t.c1 ORDER BY n.Number) AS rn
    FROM
    #t AS t, Numbers AS n
    WHERE
    n.Number <= LEN(t.c2)
    AND SUBSTRING(',' + t.c2 + ',', n.Number, 1) = ','
    ORDER BY
    t.c1, rn
    GO
    DROP TABLE #t
    GO
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Report with two data sources...Need help!

    Post Author: mamorgan1
    CA Forum: General
    Good afternoon,It has been a while since I have used Crystal Reports and I was hoping someone could help me with this:Let me explain the data:We have an application that tracks Cases for Patients.  For every 1 Case there are MANY Notes.  For every 1 Case the are MANY Appointments.  I have two data sets that I am using as my data sources for this report:1.  Notes by Case2. Appointments by CaseOkay, I would like to create a report that displays for each Case:1.  Case information2.  Appointments related to the Case3.  Notes related to the CaseI keep getting a bunch on duplicates due to the 1:M relationships with Case.  Is there a solution?  I hope I have been clear.Thanks in advance.mamorgan1 

    Post Author: Jagan
    CA Forum: General
    Where does the case information come from? Where's the case data source?
    Try pushing one of the tables into a subreport

  • Requirement to compare data of two tables.

    Hi all,
    I have a requirement to compare 2 tables based on Column1 Value as show below.
    If a specific value of column 1 doesnt have a log for both the files for a specific day, then it will send the email mentioning the details.
    For eg in the below case an email will be sent for 1001 for missing file b*.txt.
    please suggest if in SP I can do it, and send the email with attachement ?
    thanks,
    Varun
    Thanks, Varun

    Try this:
    DECLARE @table1 TABLE (column1 INT)
    INSERT INTO @table1 (column1) VALUES
    (1000),(1001),(1004)
    DECLARE @table2 TABLE (column1 INT, fileName VARCHAR(20), date DATE)
    INSERT INTO @table2 (column1, fileName, date) VALUES
    (1000,'A*.txt','2015-03-01'),(1000,'B*.txt','2015-03-01'),(1001,'A*.txt','2015-03-01'),(1004,'A*.txt','2015-03-01'),(1004,'B*.txt','2015-03-01')
    SELECT *
    FROM @table1 t1
    LEFT OUTER JOIN @table2 t2a
    ON t1.column1 = t2a.column1
    AND LEFT(t2a.fileName,CHARINDEX('.',t2a.fileName)-1) = 'A*'
    LEFT OUTER JOIN @table2 t2b
    ON t1.column1 = t2b.column1
    AND LEFT(t2b.fileName,CHARINDEX('.',t2b.fileName)-1) = 'B*'
    WHERE t2a.fileName IS NULL
    OR t2b.fileName IS NULL
    Don't forget to mark helpful posts, and answers. It helps others to find relevant posts to the same question.

  • Merge Two SQL - need help

    Hi All,
    Need some tips - like i have two different process runing with just only a SQL query on each.
    The both the process SQL Query is 90% similar Rather the Second sql has extra two columns
    and few filterning conditions is different which is Marked in bold. My question is there any way that
    i can write a single SQL statement that works for my both process. The Difference between the
    Query 1 and Query 2 have marked in Bold/underlined.
    Query 1
    SELECT SUBCON.MEME_CK,MEMBER_ID,LINE_NUMBER,RECIPIENT_NUMBER,MEMBER_LAST_NAME,MEMBER_FIRST_NAME,MEMBER_MIDDLE_INIT,MEMBER_SSN,MEMBER_DOB,
           MEMBER_ADDRESS_1,MEMBER_ADDRESS_2,MEMBER_CITY,MEMBER_STATE,MEMBER_ZIP_CODE,MEMBER_COUNTY_CODE,MEMBER_SEX,MEMBER_PHONE_NUMBER,
           HH_LAST_NAME,HH_FIRST_NAME,RELATIONSHIP_CODE,PCP_ID_NUMBER,PCP_NAME,PCP_PHONE_NUMBER,PCP_ADDRESS_1,PCP_ADDRESS_2,PCP_CITY,
           PCP_STATE,PCP_ZIP_CODE,PCP_COUNTY_CODE,PCP_EFFECTIVE_DATE,PCD_ID_NUMBER,PCD_NAME,PCD_PHONE_NUMBER,PCD_ADDRESS_1,
           PCD_ADDRESS_2,PCD_CITY,PCD_STATE,PCD_ZIP_CODE,PCD_COUNTY_CODE,PCD_EFFECTIVE_DATE,GROUP_EFF_DATE,GROUP_TERM_DATE,
           GROUP_NUMBER,PROGRAM_STATUS_CODE,LANGUAGE_INDICATOR,VISION_IMP_IND,HEARING_IMP_IND,SPECIAL_NEEDS_FLAG,ELIG_EFF_DATE,
           ELIG_TERM_DATE,BEN_GROUP_NO,BEN_GROUP_EFF_DT,MEDICARE_IND,TPL_RX_PAYER,TPL_RX_PAYER_EFF_DT,TPL_RX_PAYER_NAME,INSURANCE_CODE,
           POLICY_NUMBER,TYPE_OF_COVERAGE,LOB,COUNTY_STATE_RECORD,STATE_RECORD_NUMBER,GROUP_CODE,REV_CATEGORY_CODE,AQ_IND,MECD_CSCS_ID,
           MECB_EFF_DT,MCRE_ID,MECB_TERM_DT,rtrim(SBAD_PHONE) as "SBAD_PHONE"
    FROM      EXT_MEGD_SBCN_ELG_DLY SUBCON,
              CMC_MECD_MEDICAID MECD,
              CMC_SBAD_ADDR SBAD,
              CMC_MEME_MEMBER MEME
    WHERE     SUBCON.MEME_CK = MECD.MEME_CK
    AND        DATEDIFF(mm,MEMBER_DOB, DATEADD(mm,  1,GETDATE())) < 25_
    AND        Right(MECD_MCTR_AIDC,2) not in ('31', '33')
    AND        MECD_MCTR_AIDC Not in ('PC36','J36')
    AND        SUBCON.MEME_CK = MEME.MEME_CK
    AND        MEME.SBSB_CK *= SBAD.SBSB_CK
    AND        SBAD.SBAD_TYPE = "1"
    AND        SBAD.SBAD_PHONE <> " "
    AND        SBAD.SBAD_PHONE <> "0000000000"
    AND        CHAR_LENGTH(RTRIM(SBAD_PHONE)) < 11Query 2
    SELECT SUBCON.MEME_CK,MEMBER_ID,LINE_NUMBER,RECIPIENT_NUMBER,MEMBER_LAST_NAME,MEMBER_FIRST_NAME, MEMBER_MIDDLE_INIT,MEMBER_SSN,MEMBER_DOB,
           MEMBER_ADDRESS_1,MEMBER_ADDRESS_2,MEMBER_CITY,MEMBER_STATE,MEMBER_ZIP_CODE,MEMBER_COUNTY_CODE,MEMBER_SEX,MEMBER_PHONE_NUMBER,
           HH_LAST_NAME,HH_FIRST_NAME,RELATIONSHIP_CODE,PCP_ID_NUMBER,PCP_NAME,PCP_PHONE_NUMBER,PCP_ADDRESS_1,PCP_ADDRESS_2,PCP_CITY,
           PCP_STATE,PCP_ZIP_CODE,PCP_COUNTY_CODE,PCP_EFFECTIVE_DATE,PCD_ID_NUMBER,PCD_NAME,PCD_PHONE_NUMBER,PCD_ADDRESS_1,PCD_ADDRESS_2,
           PCD_CITY,PCD_STATE,PCD_ZIP_CODE,PCD_COUNTY_CODE,PCD_EFFECTIVE_DATE,GROUP_EFF_DATE,GROUP_TERM_DATE,GROUP_NUMBER,PROGRAM_STATUS_CODE,
           LANGUAGE_INDICATOR,VISION_IMP_IND,HEARING_IMP_IND,SPECIAL_NEEDS_FLAG,ELIG_EFF_DATE,ELIG_TERM_DATE,BEN_GROUP_NO,BEN_GROUP_EFF_DT,
           MEDICARE_IND,TPL_RX_PAYER,TPL_RX_PAYER_EFF_DT,TPL_RX_PAYER_NAME,INSURANCE_CODE,POLICY_NUMBER,TYPE_OF_COVERAGE,LOB,COUNTY_STATE_RECORD,
           STATE_RECORD_NUMBER,GROUP_CODE,REV_CATEGORY_CODE,AQ_IND,MECD_CSCS_ID,MECB_EFF_DT,MCRE_ID,MECB_TERM_DT,RTRIM(SBAD_PHONE) as "SBAD_PHONE",
           PRCF_MCTR_SPEC,PRAD_FAX
    FROM      EXT_MEGD_SBCN_ELG_DLY SUBCON,
              CMC_MECD_MEDICAID MECD,
              CMC_SBAD_ADDR SBAD,
              CMC_MEME_MEMBER MEME,
              CMC_PRPR_PROV    PRPR,_
              CMC_PRAD_ADDRESS PRAD_
    WHERE     SUBCON.MEME_CK = MECD.MEME_CK
    AND        Right(MECD_MCTR_AIDC,2) not in ('31', '33')
    AND        MECD_MCTR_AIDC Not in ('PC36','J36')
    AND        SUBCON.MEME_CK = MEME.MEME_CK
    AND        SUBCON.PCP_ID_NUMBER  = PRPR.PRPR_ID*_
    AND        SUBCON.PCP_ID_NUMBER  = PRAD.PRAD_ID*_
    AND        PRAD.PRAD_TYPE = 'PRI'_
    AND        (CONVERT(CHAR(10),GETDATE(),101))  BETWEEN PRAD.PRAD_EFF_DT AND PRAD.PRAD_TERM_DTAND        MEME.SBSB_CK *= SBAD.SBSB_CK_AND        SBAD_TYPE = "1"
    AND        SBAD_PHONE <> " "
    AND        SBAD_PHONE <> "0000000000"
    AND        CHAR_LENGTH(RTRIM(SBAD_PHONE)) < 11Any suggestions Welcome.
    Edited by: USER_X on May 18, 2009 11:03 AM

    Hi,
    The simplest thing, and perhaps the fastest, is to do a UNION, as Someoneelse suggested.
    See [this thread|http://forums.oracle.com/forums/message.jspa?messageID=3430965#3430965] for an example.
    Depending on your data, you could do an Outer Join of the two tables that are only in Query 2 to the other tables.
    The WHERE clause would look something like this:
    WHERE     SUBCON.MEME_CK = MECD.MEME_CK
    AND        Right(MECD_MCTR_AIDC,2) not in ('31', '33')
    AND        MECD_MCTR_AIDC Not in ('PC36','J36')
    AND        SUBCON.MEME_CK = MEME.MEME_CK
    AND        SBAD_PHONE  " "
    AND        SBAD_PHONE  "0000000000"
    AND        CHAR_LENGTH(RTRIM(SBAD_PHONE)) < 11
    AND        (     DATEDIFF (mm, MEMBER_DOB, DATEADD(mm,  1,GETDATE())) < 25     -- Extra condition from Query 1
            OR  (                                                                    -- Extra conditions from Query 2
                       SUBCON.PCP_ID_NUMBER   = PRPR.PRPR_ID
              AND   SUBCON.PCP_ID_NUMBER   = PRAD.PRAD_ID
              AND   PRAD.PRAD_TYPE          = 'PRI'_
              AND   (CONVERT(CHAR(10),GETDATE(),101))  BETWEEN PRAD.PRAD_EFF_DT
                                              AND      PRAD.PRAD_TERM_DT
              AND   MEME.SBSB_CK           = SBAD.SBSB_CK
              AND   SBAD_TYPE               = 1
            )Since all the tables in the Outer Join are referenced in the conditions from Query 2, this has the effect of making that an Inner Join unless the extra conditions from Query 1 were met.
    iIn the SELECT claue, use a CASE expression for each column that occurs only in Query 2 that repeats all the extra conditions for Query 2:
    ,       CASE
              WHEN  SUBCON.PCP_ID_NUMBER   = PRPR.PRPR_ID
              AND   SUBCON.PCP_ID_NUMBER   = PRAD.PRAD_ID
              AND   PRAD.PRAD_TYPE          = 'PRI'_
              AND   (CONVERT(CHAR(10),GETDATE(),101))  BETWEEN PRAD.PRAD_EFF_DT
                                              AND      PRAD.PRAD_TERM_DT
              AND   MEME.SBSB_CK           = SBAD.SBSB_CK
              AND   SBAD_TYPE               = 1
              THEN  PRCF_MCTR_SPEC
           END     AS PRCF_MCTR_SPECThat column will be NULL if the extra conditions from Query 2 are not met.
    Instead of computing all those extra conditions over and over again, you may want to compute them once for all in a sub-query:
    SELECT  ...
    ,       CASE
              WHEN  SUBCON.PCP_ID_NUMBER   = PRPR.PRPR_ID
              AND   SUBCON.PCP_ID_NUMBER   = PRAD.PRAD_ID
              AND   PRAD.PRAD_TYPE          = 'PRI'_
              AND   (CONVERT(CHAR(10),GETDATE(),101))  BETWEEN PRAD.PRAD_EFF_DT
                                              AND      PRAD.PRAD_TERM_DT
              AND   MEME.SBSB_CK           = SBAD.SBSB_CK
              AND   SBAD_TYPE               = 1
              THEN  1
                                    ELSE  0
           END     AS query_2_extraThen, in the main querry, you can use use that column:
    WHERE     ...
    AND        (     DATEDIFF (mm, MEMBER_DOB, DATEADD(mm,  1,GETDATE())) < 25     -- Extra condition from Query 1
            OR     query_2_extra = 1                                              -- Extra conditions from Query 2
            )

Maybe you are looking for

  • How to inspect used location in a mapping OWB Rel2?

    I have exported the Warehouse Builder metadate from a server and imported in another server. The I have allocated the modules to new defined locations. When trying to validate the metadata in a module I get the error VLD-1134 Invalid location and con

  • Upgraded to Lion, no longer can I read DVD-R

    A friend gave me a DVD-R of some pictures we took on a vacation (created out of Windows.)  With SL I had no issues importing these photos into Aperature.  I have since upgraded to Lion and want want to re-copy the photos onto one of my hard drives. 

  • Microsoft ISATAP and 6to4-Adapter yellow triangles in device manager

    Hello, we´ve disabled IPv6 via Registry. Now we noticed that the ISATAP and 6to4-Adapter have yellow triangles in device manager. My question is: is that normal behavior, when disabling IPv6? Can we remove this adapters without no issues? Or schould

  • Risk Analysis & Remediation

    What are the components of Risk Analysis & Remediation (Compliance Calibrator)?

  • Table  is mutating, trigger/function may not seen it

    Hi My work is before delete this record the same values can be stored into the temporary table.. Trigger CREATE OR REPLACE TRIGGER TEST_TRIGGER BEFORE DELETE ON py_test for each row DECLARE EMP_ID py_test%ROWTYPE; CURSOR C1 IS SELECT ID,NAME FROM py_