Outer Join not giving correct result

I have two tables=> tab_child_tmp (product_id,region,child_val,mst_product) and
tab_master_tmp (master_product_id,region,master_val)
tab_child_tmp.mst_product is the foreign key referencing tab_master_tmp.master_product_id.
Currently the tables are populated with below values
tab_child_tmp
PRODUCT_ID REGION CHILD_VAL MST_PRODUCT
Arm-01,     CAL,     100,     Arm-Master
Arm-01,     DEL,     222,     Arm-Master
Arm-01,     CHEN,     55,     Arm-Master
Arm-02,     MUM,     69,     Arm-Master
Arm-02,     DEL,     90,     Arm-Master
tab_master_tmp
MST_PRODUCT     REGION     MASTER_VAL
Arm-Master     , CAL,     390
Arm-Master     , DEL,     300
Arm-Master, CHEN,     450
Arm-Master, MUM,     600
Now I want to display the result in the below format
PRODUCT_ID REGION CHILD_VAL MASTER_VAL
1. Arm-01     , CAL, 100,     390
2. Arm-01     , DEL, 222,     300
3. Arm-01     , CHEN, 55,     450
4. Arm-01     , MUM, 0,     600
5. Arm-02     , MUM, 69,     600
6. Arm-02     , DEL, 90,     300
7. Arm-02     , CHEN, 0,     450
8. Arm-02     , CAL, 0,     390
When I am running the below query it is not returning the above 4,7 and 8 rows. Can you please provide the correct sql to get the above desired output
SELECT
a.product_id,
nvl(a.region,b.region) geo,
nvl(a.child_val,0)match_val,
b.master_val
FROM
tab_child_tmp a,
tab_master_tmp b
WHERE
a.mst_product(+) = b.master_product AND
a.region(+) = b.region
Thanks

Hi
Thanks for the reply. Please find below the details.
Oracle Version*
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi
PL/SQL Release 10.2.0.1.0 - Production
CORE     10.2.0.1.0     Production
TNS for Solaris: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
Create Table Script_
create table TAB_CHILD_TMP
PRODUCT_ID VARCHAR2(50),
REGION VARCHAR2(100),
CHILD_VAL NUMBER,
MST_PRODUCT VARCHAR2(50)
create table TAB_MASTER_TMP
MST_PRODUCT VARCHAR2(50),
REGION VARCHAR2(100),
MASTER_VAL NUMBER
Insert Script_
INSERT INTO tab_child_tmp VALUES ('Arm-01','CAL',100,'Arm-Master');
INSERT INTO tab_child_tmp VALUES ('Arm-01','DEL',222,'Arm-Master');
INSERT INTO tab_child_tmp VALUES ('Arm-01','CHEN',55,'Arm-Master');
INSERT INTO tab_child_tmp VALUES ('Arm-Master','MUM',69,'PLC1');
INSERT INTO tab_child_tmp VALUES ('Arm-Master','DEL',90,'PLC1');
INSERT INTO tab_master_tmp VALUES ('Arm-Master','CAL',390);
INSERT INTO tab_master_tmp VALUES ('Arm-Master','DEL',300);
INSERT INTO tab_master_tmp VALUES ('Arm-Master','CHEN',450);
INSERT INTO tab_master_tmp VALUES ('Arm-Master','MUM',600);
INSERT INTO tab_master_tmp VALUES ('PLC1','MUM',199);
INSERT INTO tab_master_tmp VALUES ('PLC1','DEL',299);
INSERT INTO tab_master_tmp VALUES ('PLC1','CHEN',399);
Expected output logic*
Need to display the product value for each region along with the value of master product for the corresponding product and region. If a product doesn't belong to a particular region, but the corresponding master product is, then that value also needs to be displayed for that product and region with child value as zero.
ie. for product Arm-01 there is no record in tab_child_tmp for region "MUM", but it's master product 'Arm-Master' has a record for region 'MUM' in tab master_tmp table. So in ouput there will be a record for product 'Arm-01' and region-'MUM' with child value as 0 and master value as 600.
Expected Output*
PRODUCT_ID ~~~ REG ~~~ CHILD_VAL ~~~ MASTER_VAL
Arm-01 ~~~ CAL ~~~ 100 ~~~ 390
Arm-01 ~~~ DEL ~~~ 222 ~~~ 300
Arm-01 ~~~ CHEN ~~~ 55 ~~~ 450
Arm-01 ~~~ MUM ~~~ 0 ~~~ 600
Arm-MASTER ~~~ MUM ~~~ 69 ~~~ 199
Arm-MASTER ~~~ DEL ~~~ 90 ~~~ 299
Arm-MASTER ~~~ CHEN ~~~ 0 ~~~ 399
Please help

Similar Messages

  • % Change is not giving correct results.

    Hi,
    I am using Ago Function to calculate Current month cx count , previous month cx count, present month acct count, previous month acct count and in the report parameter selecting Reporting Month as DEC 09. The results are coming perfectly fine... but when I create % Change Previous Month Cx count and % change Previous month Account count, It is not showing the correct results and getting only 0% listed even if the Difference is huge and should be around 10% ...
    The code written to calculate % change is :
    CASE WHEN ("EIP BDW Analytics"."EIP Reporting FACT"."Previous Month Account Count" IS NULL OR "EIP BDW Analytics"."EIP Reporting FACT"."Previous Month Account Count" = 0) AND NOT "EIP BDW Analytics"."EIP Reporting FACT"."Current Month Account Count" IS NULL AND "EIP BDW Analytics"."EIP Reporting FACT"."Current Month Account Count" <> 0 THEN 100.0 WHEN ("EIP BDW Analytics"."EIP Reporting FACT"."Previous Month Account Count" IS NULL OR "EIP BDW Analytics"."EIP Reporting FACT"."Previous Month Account Count" = 0) AND ("EIP BDW Analytics"."EIP Reporting FACT"."Current Month Account Count" IS NULL OR "EIP BDW Analytics"."EIP Reporting FACT"."Current Month Account Count" = 0) THEN 0.0 WHEN "EIP BDW Analytics"."EIP Reporting FACT"."Current Month Account Count" IS NULL AND NOT "EIP BDW Analytics"."EIP Reporting FACT"."Previous Month Account Count" IS NULL AND "EIP BDW Analytics"."EIP Reporting FACT"."Previous Month Account Count" <> 0 THEN -(100.0) ELSE 100.0 * ("EIP BDW Analytics"."EIP Reporting FACT"."Current Month Account Count" - "EIP BDW Analytics"."EIP Reporting FACT"."Previous Month Account Count") / "EIP BDW Analytics"."EIP Reporting FACT"."Previous Month Account Count" END
    Can some one tell me what I need to do in order to get the desired results.
    I am using a time dimension with the following hierarchy ( Year - Month - Period_ID) joined with the Reporting Table Fact which has count of cx and Count of Accts.

    We have two assets one acquired on 01/04/2014 and another on 26/04/2014.  Everything else is same for both assets like asset class , keys etc.
    Now here are two calculations.
    System is giving calculation ok , what should we do so that for both assets we are left with same scrap value (1047)  (and not 1119.68 as in last line )
    Can anyone help how to get value in last field of screen shot given below asset vale date or it is always blank.
    wanted to add something in our case DEP to the DAY is also ticked in dep key.
    regards
    Sanjeev Mehndiratta

  • Access and JDBC not giving correct results

    I am running a Query on an access DB
    SELECT COUNT(*) FROM TABLE1 WHERE [First Name] LIKE '*Jamie*'
    is the SQL query that should be executed. I get 0 errors or warnings but I get a result back as 0
    res.next(); int max = res.getInt(1);
    The max is always returned as 0.
    When I do the SAME SQL query but
    SELECT COUNT(*) FROM TABLE1 WHERE [First Name] = 'Jamie'
    and with the above code, I get results
    I am confused... please help!

    why should you? sql doesn't read minds. it's an error only in your understanding. you passed a perfectly reasonable string the first time.
    %

  • Enterprise Manager does not give correct results

    I am using version 9.0.2.0.1 core edition(oc4j & web-cache).
    My application consists of business components, java beans and jsp. It is running fine.
    Oracle enterprise manager is not giving correct results of memory/cpu usage by oc4j_home and bc4j.
    Some times it does not gives result, when i refresh it twice or thrice it shows results.
    But results are not correct. On each refresh it gives different results.
    Then it is very hard to find which resuslt is correct.
    waiting for response,
    Tahir.

    i have been using 9iAS versions 102*, 90200, 90201, and now using 903.
    As stated above, some times the results for oc4j_home is displayed.
    But the memory/cpu usage for bc4j is never shown.
    Also, its radio-button is always disabled. while its status is "running".
    On BC4J page, it also shows results of application modules created. But these results are usually wrong.
    How bc4j will be enabled, and how its memory results can be get ???
    Tahir.

  • ORA-30563, Outer Join not allowed in select list

    I can not find any information about this error message that I am getting.
    I have just upgraded my Oracle database from Version 7.3 to Version 8.1.7, a stored procedure that was written in v7.3 has outer joins in the select statement.
    when trying to run this proc in version 8 I get this meesage.(ORA-30563, Outer Join not allowed in select list)
    code ex:
    Select alt.id
    decode(alt.advise, NULL, NULL, AA.act_yr(+))||'-'||AA.act_per(+)||'-'||AA.Acc_per_no(+)) as advise_no
    from alt, AA;
    Is there any information about this message anywhere? or does anybody know if this is a known issue with oracle ver 8.1.7?
    Thanks
    CJ

    It appears to have been a bug in 7.x
    From a metalink note on bugs fixed in 8i (doc 132632.1)
    974742 Oracle does not report an error if (+) is specified in select-list. The OUTER JOIN operator (+) is only valid in WHERE clause predicates. As this is not flagged as an error the query can give unexpected results. The correct action to avoid this problem is to fix the query.
    Ken

  • Media out or not loaded correctly when attempting to print since iOS 7 upgrade?

    Since ios7 upgrade my mini gives me "media out or not loaded correctly" when attempting tp print to Epson r2400. Apple support directed me through a new setup. It worked for a few days and on it's own reverted back to the original problem.

    Since ios7 upgrade my mini gives me "media out or not loaded correctly" when attempting tp print to Epson r2400. Apple support directed me through a new setup. It worked for a few days and on it's own reverted back to the original problem.

  • VL06I Inbound delivery monitor not showing correct results

    Dears,
    We are creating inbound deliveries on the basis of POs and creating GR via MIGO after eliminating movement type in line item catageory by using SPRO. For monitoring we would like to use VL06I but its not showing correct results.
    Can anyone guid me ?
    Regards,
    FR

    You can list all Inbound Deliveries by selecting "List Inbound Deliveries"  Tab in VL06I
    May be if you can little elaborate the issue

  • NonLinearFitWithMaxIters does not give correct results for phase

    Dear all,
    I am trying to fit a sin cuve with NonLinearFitWithMaxIters function of labwindows, but the results given by this function are dispersed a lot (the function does not give same results).
    In fact, I have two waveforms signals v and i (of 104 points), and I  find the phase between the two signals with NonLinearFitWithMaxIters.
    The two singals v and i are  measured with an osciloscope.
    I use the following fit functions :
    v=p1*sin(wt+p2) ;
    i=p3*sin(wt+p4) ;
    I use the NonLinearFitWithMaxIters function to fit the data and to have the parameters  p1, p2, p3, p4. Then, the phase is claculated as follow phase=p4-p3.
    The problem is that the phase calculted between the two signals (v and i) is different for each run for the same conditions.
    In fact, for a same condition, I measure different times the signals v and i, and I calculate the phase p4-p3, using NonLinearFitWithMaxIters. The goal is to calculate a mean of phases for the same condition. For example, there are cases where the phase=-5 degree, and other cases when phase=12 degree.
    For ten measures of v and i, the phase calculated is different. I get a big dispersion between the phases.
    I would like to know please why I have a big difference in phases calculated with the same condition?whern using NonLinearFitWithMaxIters.
    I read that this function does not give all time the correct results, is there a way to know when the results are not corrects and when they are correct ?
    And is there any solution to find accuratly the phase between the two waveforms.
    Thank you for your precious answer.

    The pseudocode which I am using is :
    v_err=NonLinearFitWithMaxIters(array_x,array_v,v_y_fit,1252,100,sinus,v_coef,2,&v_mean_squareError);
    The fit function is
    double sinus(double x, double a[],int noef){
        return (a[0]*sin((w*x)+a[1]));
     I use the same inital coeficient of v_coef for each run :     
    v_coef[0]=0.03;
    v_coef[1]=0.2;
    These coeficient are choosen arbitrary.
    In this case, the number of points of the data is 1252 (the data of array_v).
    The number of iterations is 100.
    For the array_x, the distance between adjacents values of the array is dt=0.4*1e-9(difference between array_x[i] anv array_x[i+1]=dt=0.4*1e-9 ).
    for (i=0;i<1252;i++){
    array_x[i]=i*(0.4*1e-9);
    The means square error returnned by the function when it is complished is  small, of the order of 0,001.
    I read the help
    « From the help:
    You must pass a pointer to the nonlinear function f(x,a) along with a set of initial guess coefficients a. NonLinearFitWithMaxIters does not always give the correct answer. The correct output sometimes depends on the initial choice of a. It is very important to verify the final result.
    That means that the function cannot be used, as it does not give correct results. How
    can we check if the results are good or not ? in my case.
    I think that in my case, the function does not give correct results, but how can I check if the results are good, or not ? The mean square error is small.

  • FOX CLOCKS not giving correct time. Central time is 2 hours ahead of the actual time

    FOX CLOCKS not giving correct time. Central time is 2 hours ahead of the actual time

    sorry not an Atomic clock issue I read your post wrong
    actually last night I tried to set my clock back to the time without Daylight savings and it would only let me set it to 1 or 3 am but not 2.. I noticed this, but I would wait till Sunday is over and see if this bug is only a one day issue which I have a feeling it may be, wait till 3am march 10th and see if this bug fixes itself I have a feeling it will

  • Merging two complemental result sets... or OUTER JOINs not working?

    Dear experts!
    Again I have a very difficult problem for which I ask Your help, but this time I am better prepared than last time and can deliver sample data of my (hopefully not too much) simplified example:
    create table Subjects(
    pk_id          number          not null primary key,
    title          varchar2(128)
    create table People(
    pk_id          number          not null primary key,
    name          varchar2(128)
    create table Results(
    pk_id          number          not null primary key,
    fk_subjects_id     number,
    fk_people_id     number,
    result          number
    insert into Subjects(pk_id, title) values (1, 'Choosing a recipe')
    insert into Subjects(pk_id, title) values (2, 'Shopping ingredients')
    insert into Subjects(pk_id, title) values (3, 'Preparations')
    insert into Subjects(pk_id, title) values (4, 'Cooking for beginners')
    insert into Subjects(pk_id, title) values (5, 'Eating for pros')
    insert into Subjects(pk_id, title) values (6, 'Dishwashing for everyone')
    insert into Subjects(pk_id, title) values (7, 'Digesting for experts')
    insert into Subjects(pk_id, title) values (8, 'Becoming hungry again...')
    insert into Subjects(pk_id, title) values (9, 'Redo from start')
    insert into People(pk_id, name) values (1, 'Hank')
    insert into People(pk_id, name) values (2, 'Cloe')
    insert into People(pk_id, name) values (3, 'Mary')
    insert into Results(pk_id, fk_subjects_id, fk_people_id, result) values (1, 1, 1, 2)
    insert into Results(pk_id, fk_subjects_id, fk_people_id, result) values (2, 2, 1, 4)
    insert into Results(pk_id, fk_subjects_id, fk_people_id, result) values (3, 3, 1, 3)
    insert into Results(pk_id, fk_subjects_id, fk_people_id, result) values (4, 9, 1, 5)
    insert into Results(pk_id, fk_subjects_id, fk_people_id, result) values (5, 1, 2, 4)
    insert into Results(pk_id, fk_subjects_id, fk_people_id, result) values (6, 2, 2, 1)
    insert into Results(pk_id, fk_subjects_id, fk_people_id, result) values (7, 3, 2, 5)
    insert into Results(pk_id, fk_subjects_id, fk_people_id, result) values (8, 4, 2, 2)
    insert into Results(pk_id, fk_subjects_id, fk_people_id, result) values (9, 5, 2, 3)
    insert into Results(pk_id, fk_subjects_id, fk_people_id, result) values (10, 6, 2, 2)
    insert into Results(pk_id, fk_subjects_id, fk_people_id, result) values (11, 7, 2, 1)
    insert into Results(pk_id, fk_subjects_id, fk_people_id, result) values (12, 4, 3, 3)
    insert into Results(pk_id, fk_subjects_id, fk_people_id, result) values (13, 5, 3, 5)
    insert into Results(pk_id, fk_subjects_id, fk_people_id, result) values (14, 7, 3, 1)
    insert into Results(pk_id, fk_subjects_id, fk_people_id, result) values (15, 8, 3, 5)
    insert into Results(pk_id, fk_subjects_id, fk_people_id, result) values (16, 9, 3, 1)
    Please imagine this as an university for amateur cooks. Now I want to present them their performance record/"scorecard", for every student, only with her or his marks. On this performance record there should be a list of all 9 subjects possible to pass, and where students got a result, that result should be filled in. I thought that should be possible to achieve with something like this:
    SELECT PEOPLE.NAME, SUBJECTS.TITLE, RESULTS.RESULT FROM RESULTS
    JOIN PEOPLE ON PEOPLE.PK_ID = RESULTS.FK_PEOPLE_ID
    JOIN SUBJECTS ON SUBJECTS.PK_ID = RESULTS.FK_SUBJECTS_ID
    WHERE RESULTS.FK_PEOPLE_ID = 2
    But also using (LEFT|RIGHT|FULL) OUTER JOINs here does not help me to get what I want, I always only get
    NAME TITLE RESULT
    Cloe Choosing a recipe 4
    Cloe Shopping ingredients 1
    Cloe Preparations 5
    Cloe Cooking for beginners 2
    Cloe Eating for pros 3
    Cloe Dishwashing for everyone 2
    Cloe Digesting for experts 1
    But I want:
    NAME TITLE RESULT
    Cloe Choosing a recipe 4
    Cloe Shopping ingredients 1
    Cloe Preparations 5
    Cloe Cooking for beginners 2
    Cloe Eating for pros 3
    Cloe Dishwashing for everyone 2
    Cloe Digesting for experts 1
    Cloe Becoming hungry again...
    Cloe Redo from start
    Without having to fill in empty rows for all students which did not take all exams yet.
    Is it possible? If so, how?
    Thank You very much in advance and Happy Easter to everyone! :-)
    With kind regards,
    Chriss
    Edited by: user9355711 on 01.04.2010 07:01
    Edited by: user9355711 on 01.04.2010 07:28
    Edited by: user9355711 on 01.04.2010 07:29

    Also;
    var n number
    exec :n := 2;
    PL/SQL procedure successfully completed
    n
    2
    select ppl.name, sub.title, res.result
      from subjects sub, people ppl, results res
    where sub.pk_id = res.fk_subjects_id(+)
       and ppl.pk_id = :n
       and res.fk_people_id(+) = :n
    order by sub.title;
    NAME       TITLE                         RESULT
    Cloe       Becoming hungry again... 
    Cloe       Choosing a recipe                  4
    Cloe       Cooking for beginners              2
    Cloe       Digesting for experts              1
    Cloe       Dishwashing for everyone           2
    Cloe       Eating for pros                    3
    Cloe       Preparations                       5
    Cloe       Redo from start          
    Cloe       Shopping ingredients               1

  • .bat file result not giving correctly in data services

    Hi ,
    I am using .bat file to count the number of files in the folder. I want to capture the value of the number of files.
    I have written small .bat file as shown below
    @echo off
    setlocal enableextensions
    CD %1
    set cnt=0
    for %%A in (*) do set /a cnt+=1
    echo File count = %cnt%
    endlocal
    I have used this batch  file in the script as shown below.
    $COUNT =exec('D:\\test.bat', 'D:\\docs',8);
    print($COUNT);
    In the above $COUNT is varchar(255).
    actually i have only 11 file sin the docs folder . But it is giving the 442 files.
    If I run the same batch file in the windows cmd command I am getting the correct result.
    Please let me know what will be issues?
    I am unable figure out the issues for weird result when I am using DS.
    Please help me in this issue.
    Thanks & Regards,
    Ramana.

    Hi,
    While executing the batch file it is taking the Data services installation directory path as shown below.
    14504    6420    PRINTFN    3/30/2015 9:40:10 AM    0: C:\Program Files (x86)\SAP BusinessObjects\Data Services\bin  File count = 442
    I have changed the the batch file with two parameters. one for changing directory and another one for changing the folder.
    Now my batch file looks like this.
    @echo off
    setlocal enableextensions
    %1:
    CD %2
    echo %CD%
    set cnt=0
    for %%A in (*) do set /a cnt+=1
    echo File count = %cnt%
    endlocal
    Then my script is like this .
    $COUNT =exec('D:\\test.bat', ' D D:\\docs',8);
    print($COUNT);
    Now it is giving the expected result as shown below.
    14700    13912    PRINTFN    3/30/2015 9:52:18 AM    0: D:\Docs  File count = 11
    Thanks & Regards,
    Ramana.

  • Left Outer Join not working in Infoset.

    Hello Friends,
    I have two ODSes , one for planned data (zplan) and other is billing z ods (zsd_o03).
    now the situation is such that in my planned ODS  for one sold to party .
    SOLD TO        MATERRIAL CALMONT     PLANNED QUANTIY
    14315            100                06.2007           54
    14315            200                06.2007           20
    14315            300                06.2007           30
    14315            400                06.2007           10
    But in my Billing ODS iam having for Sold to 14315
    SOLD TO        MATERRIAL CALMONT     ACTUAL QUANTIY
    14315           100           06.2007                  20
    14315           200           06.2007                  30
    And my Bex ouput should be like
    SOLD TO        MATERIAL CALMONT        planned             ACTUAL QUANTIY
    14315            100                06.2007           54                                 20
    14315            200                06.2007           20                                30
    14315            300                06.2007           30                                  0
    14315            400                06.2007           10                                0
    So for this i made one Infoset and these ODses are linked by Sold_to , Materail,
    Calmonth.
    First i tried using Inner joing option , but the bottom two lines were not ciming , so used left outer join , and activated and recreated the query but still its showiong me the output same as inner join .. i.e
    14315            100                06.2007           54                                 20
    14315            200                06.2007           20                                30
    So i checked by writing a ABAP code in Se38 , but there its showing me the correct result ..
    So please anybody help me out because iam thinking that infoset is the right way to do this kind of reporting , or esle shall i make one ODS and populate it through this ABAP code..
    Thanks in advance.

    Hi , can anybody help me in this regard..
    Thanks ..

  • Old outer join syntax produces different results from new syntax!

    I have inherited a query that uses the old outer join syntax but that is yielding correct results. When I translate it to the new outer join syntax, I get the results I expect, but they are not correct! And I don't understand why the old syntax produces the results it produces. Bottom line: I want the results I'm getting from the old syntax, but I need it in the new syntax (I'm putting it into Reporting Services, and RS automatically converts old syntax to new).
    Here's the query with the old outer join syntax that is working correctly:
    Code Snippet
    SELECT   TE = COUNT(DISTINCT T1.ID),
             UE = COUNT(DISTINCT T2.ID),
             PE = CONVERT(MONEY, COUNT(DISTINCT T2.ID)) / 
                  CONVERT(MONEY,COUNT(DISTINCT T1.ID))
    FROM     TABLE T1, TABLE T2
    WHERE    T1 *= T2
    In this query, much to my surprise, TE <> UE and PE <> 1. However, TE, UE, and PE seem to be accurate!
    Here's the query with the new outer join syntax that is working but not producing the results I need:
    Code Snippet
    SELECT   TE = COUNT(DISTINCT T1.ID),
             UE = COUNT(DISTINCT T2.ID),
             PE = CONVERT(MONEY, COUNT(DISTINCT T2.ID)) / 
                  CONVERT(MONEY,COUNT(DISTINCT T1.ID))
    FROM     TABLE T1 LEFT OUTER JOIN TABLE T2 ON T1.ID = T2.ID
    Though not producing the results I need, it is producing what would be expected: TE = UE and PE = 1.
    My questions:
    1) Can someone who is familiar enough with the old syntax please help me understand why TE <> UE and PE <> 1 in the first query?
    2) Can someone please tell me how to properly translate the first query to the new syntax so that it continues to produce the results in the first query?
    Thank you very much.

    How can we reproduce the issue?
    Code Snippet
    USE [master]
    GO
    EXEC sp_dbcmptlevel Northwind, 80
    GO
    USE [Northwind]
    GO
    SELECT
    TE
    = COUNT(DISTINCT T1.OrderID),
    UE = COUNT(DISTINCT T2.OrderID),
    PE = CONVERT(MONEY, COUNT(DISTINCT T2.OrderID)) /
    CONVERT(MONEY,COUNT(DISTINCT T1.OrderID))
    FROM
    dbo
    .Orders T1, dbo.Orders T2
    WHERE
    T1
    .OrderID *= T2.OrderID
    SELECT
    TE
    = COUNT(DISTINCT T1.OrderID),
    UE = COUNT(DISTINCT T2.OrderID),
    PE = CONVERT(MONEY, COUNT(DISTINCT T2.OrderID)) /
    CONVERT(MONEY,COUNT(DISTINCT T1.OrderID))
    FROM
    dbo
    .Orders T1
    LEFT OUTER JOIN
    dbo.Orders T2
    ON T1.OrderID = T2.OrderID
    GO
    EXEC sp_dbcmptlevel Northwind, 90
    GO
    Result:
    TE
    UE
    PE
    830
    830
    1.00
    TE
    UE
    PE
    830
    830
    1.00
    As you can see, I am getting same results.
    AMB

  • Left Outer Join Not working in BI 7.0 Infoset

    Hi All,
    I am working on BI 7.0. I have to create a report where I have to display the Target values from a target DSO against the transactional data (Operational data).
    I have a DSO where for a “subteam” value target has been set up on different KPIs.
    In the Info Cube, I have transactional data on daily basis per “subteam”. I have to show the actual and target values.
    I have created an Info Set using Target DSO and Daily operational cube, so that I should able to compare the target and actual values of KPIs, for all the “subteam” values (From DSO, irrespective of whether the data is available in cube for those sub team).
    I have used Outer Left Join in the Info set (DSO on left side), but I am unable to see the desired results. It is working just like an inner join.
    Any Idea why the Outer Left Join is not working? The DSO has only one fey field called “subteam” on which I have set outer left join.
    Regards,
    Amit

    Hi,
    did you solve your problem? because I have the same issue right now: the left outer join doesn't seem to do its job.
    Let me know if you have found a solution, it would be appreciated.
    have a nice day,
    Dominic

  • Drill Down are not giving correct values

    Hi
    We created sales Order values as a character and putting them in Rows and populating data by writing update rule. We created variables on calendar month in order to choose specific period of data in the query. For example if we need 02/2008 to 0/42008 which gives two months of data. When I drill down on Sales Order or billing document on the report it’s not giving variable interval data instead it’s pulling all the sales orders and billing documents in the Cube. With out drilling down the values are showing OK.  If I restrict with same period in the cube it's giving correct values
    Please let us know if you have any ideas.
    Thanks
    Naga

    Aah, I guessed it correctly!
    Remove the local var of the Stop button & place the terminal itself inside the inner while loop & directly wire it to the conditional terminal of the outer while loop.
    Please see the attached pic...
    Message Edited by parthabe on 07-30-2009 07:12 AM
    - Partha
    LabVIEW - Wires that catch bugs!
    Attachments:
    arrayreq_mod.jpg ‏97 KB
    arrayreq_mod.jpg ‏97 KB
    arrayreq_mod.jpg ‏99 KB

Maybe you are looking for

  • Performance Issue with BSIS(open accounting items)

    Hey All,       I am having serious performance issue with a accrual report which gets all open GL items, and need some tips for optimization. The main issue is that I am accesing large tables like BSIS, BSEG, BSAS etc without proper indexes and that

  • Vendors Payment Before Due Date

    Dear All, We could like to restric the release of Vendor payment before the due date. We feel there is a system in SAP by which it should give a Error/ warining message (pop up) if any payment is made before the due date. Do suggest. Regards,

  • Need steps for Installing Oracle 11g R2 Grid Infrastrucure in Suse Linix 10

    Hi, I have system with Suse Linux 10 (64-bit), in that i need to install the Oracle 11 R2 Grid Infrastructure for 1. Grid Computing 2. ASM Cluster. Can any one please provide the Step by step installation to me. Thanks With Regards Baalaji V

  • Lost in Migration

    I've just purchased my first Mac, Macbook Pro 17" ; yea it's a size thing.  Anyway i transferd all files eg; photos music to the Mac using the migration tool after 49 min I can't locate any files, what did I do wrong.

  • Applications crashing, won't start up...

    So I did a clean install of 10.7.5 on a 3 TB drive. Reinstalled all me doc, apps movies etc- from backup. I set up a 2 TB raid drive to run old games and apps with  10.5 everything went great, I played some old games and then selected the 10.7.5 star