Outer join style report - OBIEE 10g

Hi All,
I have a requirement to generate a report for product & sales. I have two dimensions and various fact data elements.
Some products may not be sold on a month but still i want to display them in the report with 0 value. I have tried this by creating a Left outer join in RPD, since we are using some other dimension in the fact calculation (calculated column) so that also comes in to the left outer join group and that mess with the results.
So am looking for the better approach to bring the results through answers. Here is the data and expected results
Data
Product | Month | Sale | Margin
Fridge | May | 100 | 20%
Coolers| May | 50 | 4%
Laptop| Jun| 300 | 15%
Now am filtering the report for the month of May, my results should be looks like
Product | Sale | Margin
Fridge | 100 | 20%
Coolers|50 | 4%
Laptop| 0 | 0%
Can anyone provide a solution for this ?
Thanks,
Ugser

One possible solution is based on the fact, that OBIEE is combining (=outer joining) measures from two different fact tables by their commonly shared dimensions. What you have to do is:
Physical layer:
- create a new dummy fact table in the physical layer (e.g. using a view like Select 1 from dual;)
- join all required dimension tables to the dummiy fact table using a complex foreign key. Make sure it evaluates always to true, e.g. 1=1.
BMM:
- create a new logical fact table for the dummy fact and join all required logical dimension tables to it using complex joins. Set the levels in content tab of LTS same way as for your other fact.
Presentation layer:
- expose the dummy fact column
Answers:
- Drag the dummy fact into your report. You might want to hide it because for a normal user it is confusing and meaningless since it will always show 1.
- Filtering should work fine now.
The dummy fact column will cause OBIEE to create a cartesian join, i.e. all combinations of dimension attributes used in the report will be created. Then the result of the second fact (in your case sales) will be added. In your example it will create a record for each Month for each Product. Sales and Margin will be only added for those Month and Product combinations where there are data in the sales fact.
Hope this helps.
Cheers,
Peter

Similar Messages

  • Left outer join usage in obiee BMM layer

    Hi All,
    We lately started using left outer join in our bmm layer , to meet the requirement expectation .
    problem : We have two tables  Fact A , Dim B . There is an join int_id column to join them . Problem is... in table Dim B , we have 3 millions rows of Int_id and in fact table it is loaded for only data available(1 million rows).
    Due to this we are dropping rows  in the report ..as it is only getting data where fact.int_id = dim.int_id. So we used left outer join to solve to one particular report .(we know we can do ETl to load dummy int_id and make it null , but it is huge effort ..so we did left outer join)
    These days , same kind of reports are in requirement . if i keep on doing same left outer join to meet the requirement in BMM layer ? is there any disadvantages due to this ? any performance degrade due to this ? please throw few lines on left outer join and its usage ?
    Thanks,
    Sri

    Remodel your tables that might be a partition or any other way and follow in BI as per your new model.
    Simply: Go for ETL kind of solution

  • Left outer join in presentation layer

    Could I do left outer join in presentation layer? I have 2 reports. They both have a common column - "Month". The first report have columns - "Month" and "Measure1" and the second report have columns - "Month" and "Measure2". I would like to put them together so the final report would have "Month", "Measure1" and "Measure2".
    Thanks,
    Ted

    Ted,
    It is not clear to me, why you want to do an outer join. If the dimension Month is shared by both "Measure1" and "Measure2", then it will work without any problem (assuming the RPD is configured correctly).
    An outer join comes into play if you need to preserve the dimension records. Let's assume you want to run an analysis like "Show me all months were there was no sales". In plain SQL you would to do a left-outer join between the Month dimension table and the sales fact table. If you want to know how this can be achieved in OBIEE you might want to have a look here [Outer join style report - OBIEE 10g|https://forums.oracle.com/forums/message.jspa?messageID=9805768#9805768]. This should be still valid for OBIEE 11g.
    Best regards,
    Peter

  • OBIEE 10g How ADD new report and use outer join

    Hi,
    I have to add a new report that use a new view...(just created in db)
    I'm new in OBIEE.. can you explain how can i do it?
    Actually:
    1. I opened administrator tool and import new view (and created an alias) in physical
    2. I built a logical table in BMM
    3. I built a new presentation table in presentation
    problem: the table in BMM have yellow icon like a fact table.. why??
    can you explain me what i have to do?
    thank you
    Edited by: 1006028 on 15-mag-2013 2.54

    By default OBIEE 10g considers a table as fact table that is dragged from physical to BMM layer. That's why you see the yellow color icon.
    If it is a dimension table, you will have to join this table with a fact table in BMM layer. After this the yellow color icon will go away.
    Pls mark correct/helpful.

  • OBIEE 10G outer join

    Hi, I am new to OBIEE 10G.
    I have a DimA (dimension), FactA (fact). I mapped foreign key relationship between DimA and FactA on DimA.A = FactA.A in BMM, the relationship is inner and greyed out, so I can't change it to outer join.
    So in the answers report, it only shows data of the inner join of the two tables. What I want is to show all items in DimA and related items of FactA or 0 for those not related.
    I have posted a similar question here before https://forums.oracle.com/thread/2596618
    But I still can't modify the relationship (still greyed out) even if I opened a offline repository.
    And what I am thinking is is there an option in answers to dynamically control the join (inner or outer). For example, sometimes I want to show only matched DimA and FactA , sometimes all DimA and related FactA or 0, so that I don't have to modify the BMM in repository every time if the requirement changes.
    What's the best practice for this case?
    Thanks.

    Hi SriniVEERAVALLI,
    Thanks for the reply. I have found that I might haven't created the relationship between dimension and fact tables correctly.
    I initially created the foreign key relationship (instead of creating complex join) in physical diagram between the dimension and fact table. And the relationship type is hence greyed out.
    I have deleted the foreign key relationship in physical diagram. Then
    1. In physical diagram, create complex join between dimension and fact . The relationship is 'inner' and can't be changed.
    2. In Logical table diagram, create foreign key between dimension and fact . The relationship can be changed (inner, outer, etc).
    Is this the correct way?
    I tried these on two newly created dummy tables and it worked.

  • Error  in reports after upgrade from OBIEE 10g to 11g :  [nQSError: 14025]

    Hi All, We upgraded RPD and web catalog from OBIEE 10g to 11.1.1.5. I see the following error while running few reports.
    Error: State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A
    general error has occurred. [nQSError: 43113] Message returned from OBIS.
    [nQSError: 14025] No fact table exists at the requested level of detail:
    When I add an user under BIAdministrator Application role and login, all the reports work correctly.
    I verified Oracle BUG fix (11850704) document and tried to make changes as suggested.
    Please suggest me if this issue is related to 10g to 11g RPD upgrade or are we missing any privileges?
    Also should I add every user to BIAdministrator role to avoid this issue?
    Thanks in Advance

    Hi,
    First of all i am not familiar on linux box.
    I tried in windows environment the rpd is deployed with out any errors.
    But i ran the ua.bat file in the following path
    \MWHOME\Oracle_BI1\bin\ua.bat.
    while i am running in oracle_common\bin\ua.bat is not responding in my local system.
    Please Mark if it helpful.
    Thanks

  • Filter on the reports created using DIRECT DATABASE ACCESS in obiee 10g

    How do i filter on the report that is created by using DIRECT DATABASE ACCESS in obiee 10g?
    I have reprot A with link to report B, report B is created using DIRECT DATABASE ACCESS. so it is just a table, but i need to filter out 2 columns.
    here is the query in REPORT B:
    select strm, acad_group, crse_id, class_section, count(emplid) from v_crse_enrl
    group by crse_id, strm, class_section, acad_group;
    the link in REPORT A:
    '<a target="_blank" href="'||VALUEOF("bi_link")||'Go&Path=CF_CROSS_TEACHING_LIST&ACTION=Navigate&col1=STRM&val1='||view1_DIMEN.STRM||'&col2=CLASS_SECTION&val2='||TRIM(view1_DIMEN.CLASS_SECTION)||'">' ||view1_dimen.class_id||'</a>'
    from this link to report B.
    thank you!!

    I didnt tested using url, but the same works with using presentation variables.
    To your direct sql add where clause for those two columns like WHERE col='@{col1}' and col ='@{col2}'
    and try to run from url.
    let me know updates

  • How to understand the way OBIEE implements outer joins?

    Hello guys
    I have a few scenarios where I have to implement outer joins and inner joins between dimensions and facts..
    There are 2 ways as far as I know that allows me to implement outer joins in BMM layer.
    1, Join the Logical dim table A to Logical Fact table B using outer join. The modeling will look like the below:
    A Dim ---outer------B fact -----------inner----C Dim
    By this design, the query that selects columns from all 3 tables will look at this:
    select columns from ((B fact inner joins C on key1 = key2) left outer joins on A dim) on key3=key4)..
    2, Join logical dim table A to fact table B inside the LTS of fact B by mapping the LTS B to dim A using outer join. then join fact B to C:
    B fact (mapped to fact B outer join Dim A) ------------inner -------C dim
    By this design, the query that selects columns from all 3 tables will look at this instead:
    select columns from C, B left outer join A on key1=key2 where key3=key4
    Comparing these 2 queries, the first one seems to do inner joins first and then outer join the result set to Dim A, the second query seems to outer join Dim A first and the result set inner joins to Dim C..
    I ran the same report using these 2 different designs, and the data comes out very different. The report of the first query is much smaller than the report of the second query...
    Can anyone help me understand how OBIEE understands outer joins? The second query is so far giving the right result, however, I can't get rid of the outer join in the query even if not selecting columns from Dim A, which is impacting the performance of other reports without Dim A.
    Your inputs will be greatly appreciated
    Thanks
    Edited by: user7276913 on Apr 20, 2010 9:31 AM
    Edited by: user7276913 on Apr 20, 2010 9:31 AM

    Xcode is the IDE.
    Objective-C is the language typically used.
    There's lots of getting started stuff at https://developer.apple.com

  • D2k report query , want to develop in obiee 10g

    Hi,
    I have a d2k report query, the result what i am getting in d2k report can i get the same result in obiee 10g.
    my query in d2k report auery is like :
    select a.vndr#,b.vndr_name,a.cust_type_cd,c.cust_type_e_dsct,a.branch_cd,d.branch_e_name,(sum(nvl(a.sales_total_value,0))-sum(nvl(a.return_total_value,0))) net_sales_value,count(distinct(a.cust#)) cust_count
    from cust_net_sales_tmp a,vendor b,cust_type_codes c,branches d where
    a.vndr#=b.vndr# and
    a.branch_cd=b.branch_cd and
    a.cust_type_cd = c.cust_type_cd and
    a.cust_type_cd between :f_ctype and :t_ctype
    group by a.vndr#,b.vndr_name,a.cust_type_cd,c.cust_type_e_dscr,a.branch_cd,d.branch_e_name
    order by a.vndr#,a.cust_type_cd,a.branch_cd
    thank you.
    please suggest..

    Hi,
    The presentation variable is being passed correctly, but still the date value is not persisiting.
    I have two prompts, both having presentation variables passed into them;One of the prompt value is being persisted but the other one(here date) is not.
    I am not able to justify this issue as the problem is very vague. I dont see any reason for this issue to come up.
    Anyways I am still trying to figure out the problem.
    Regards
    Ankita

  • How to do outer join select query for an APEX report

    Hello everyone,
    I am Ann.
    I have one select statement that calculate the statistics for one month(October 2012 in this example)
    select ph.phase_number
    , sum ( (case
    WHEN ph.date_finished IS NULL OR ph.date_finished > last_day(TO_DATE('Oct 2012','MON YYYY'))
    THEN last_day(TO_DATE('Oct 2012','MON YYYY'))
    ELSE ph.date_finished
    END )
    - ph.date_started + 1) / count(def.def_id) as avg_days
    from phase_membership ph
    inner join court_engagement ce on ph.mpm_eng_id = ce.engagement_id
    inner join defendant def on ce.defendant_id = def.def_id
    where def.active = 1
    and ph.date_started <= last_day(TO_DATE('Oct 2012','MON YYYY'))
    and ph.active = 1
    and UPPER(ce.court_name) LIKE '%'
    group by rollup(phase_number)
    Result is as below
    Phase_Number     AVG_DAYS
    Phase One     8.6666666666666667
    Phase Two     14.6
    Phase Three     12
         11.4615365
    I have other select list mainly list the months between two date value.
    select to_char(which_month, 'MON YYYY') as display_month
    from (
    select add_months(to_date('Aug 2012','MON YYYY'), rownum-1) which_month
    from all_objects
    where
    rownum <= months_between(to_date('Oct 2012','MON YYYY'), add_months(to_date('Aug 2012','MON YYYY'), -1))
    order by which_month )
    Query result is as below
    DISPLAY_MONTH
    AUG 2012
    SEP 2012
    OCT 2012
    Is there any way that I can join these two select statement above to generate a result like:
    Month          Phase Number     Avg days
    Aug 2012     Phase One     8.666
    Sep 2012     Phase One     7.66
    Oct 2012     Phase One     5.66
    Aug 2012     Phase Two     8.666
    Sep 2012     Phase Two     7.66
    Oct 2012     Phase Two     5.66
    Aug 2012     Phase Three     8.666
    Sep 2012     Phase Three     7.66
    Oct 2012     Phase Three     5.66
    Or
    Month          Phase Number     Avg days
    Aug 2012     Phase One     8.666
    Aug 2012     Phase Two     7.66
    Aug 2012     Phase Three     5.66
    Sep 2012     Phase One     8.666
    Sep 2012     Phase Two     7.66
    Sep 2012     Phase Three     5.66
    Oct 2012     Phase One     8.666
    Oct 2012     Phase Two     7.66
    Oct 2012     Phase Three     5.66
    And it can be order by either Phase Number or Month.
    My other colleague suggest I should use an left outer join but after trying so many ways, I am still stuck.
    One of the select I tried is
    select a.display_month,b.* from (
    select to_char(which_month, 'MON YYYY') as display_month
    from (
    select add_months(to_date('Aug 2012','MON YYYY'), rownum-1) which_month
    from all_objects
    where
    rownum <= months_between(to_date('Oct 2012','MON YYYY'), add_months(to_date('Aug 2012','MON YYYY'), -1))
    order by which_month )) a left outer join
    ( select to_char(ph.date_finished,'MON YYYY') as join_month, ph.phase_number
    , sum ( (case
    WHEN ph.date_finished IS NULL OR ph.date_finished > last_day(TO_DATE(a.display_month,'MON YYYY'))
    THEN last_day(TO_DATE(a.display_month,'MON YYYY'))
    ELSE ph.date_finished
    END )
    - ph.date_started + 1) / count(def.def_id) as avg_days
    from phase_membership ph
    inner join court_engagement ce on ph.mpm_eng_id = ce.engagement_id
    inner join defendant def on ce.defendant_id = def.def_id
    where def.active = 1
    and ph.date_started <= last_day(TO_DATE(a.display_month,'MON YYYY'))
    and ph.active = 1
    and UPPER(ce.court_name) LIKE '%'
    group by to_char(ph.date_finished,'MON YYYY') , rollup(phase_number)) b
    on a.display_month = b.join_month
    but then I get an error
    SQL Error: ORA-00904: "A"."DISPLAY_MONTH": invalid identifier
    I need to display a report on APEX with option for people to download at least CSV format.
    I already have 1 inteactive report in the page, so don’t think can add another interactive report without using the iframe trick.
    If any of you have any ideas, please help.
    Thanks a lot.
    Ann

    First of all, a huge thanks for following this Frank.
    I have just started working here, I think the Oracle version is 11g, but not sure.
    To run Oracle APEX version 4, I think they must have at least 10g R2.
    This report is a bit challenging for me.I has never worked with PARTITION before.
    About the select query you suggested, I run , and it seems working fine, but if I try this,
    it return error ORA-01843: not a valid month
    DEFINE startmonth = "Aug 2012";
    DEFINE endmonth   = "Oct 2012";
    WITH     all_months     AS
         select add_months(to_date('&startmonth','MON YYYY'), rownum-1) AS which_month
         ,      add_months(to_date('&startmonth','MON YYYY'), rownum  ) AS next_month
         from all_objects
         where
         rownum <= months_between(to_date('&endmonth','MON YYYY'), add_months(to_date('&startmonth','MON YYYY'), -1))
    select TO_CHAR (am.which_month, 'Mon YYYY')     AS month
    ,      ph.phase_number
    , sum ( (case
    WHEN ph.date_finished IS NULL OR ph.date_finished > last_day(TO_DATE(am.which_month,'MON YYYY'))
    THEN last_day(TO_DATE(am.which_month,'MON YYYY'))
    ELSE ph.date_finished
    END )
    - ph.date_started + 1) / count(def.def_id) as avg_days
    FROM           all_months          am
    LEFT OUTER JOIN  phase_membership  ph  PARTITION BY (ph.phase_number)
                                        ON  am.which_month <= ph.date_started
                               AND am.next_month  >  ph.date_started
                               AND ph.date_started <= last_day(TO_DATE(am.which_month,'MON YYYY'))  -- May not be needed
                               AND ph.active = 1
    LEFT OUTER join  court_engagement  ce  on  ph.mpm_eng_id = ce.engagement_id
                                        and ce.court_name IS NOT NULL  -- or something involving LIKE
    LEFT OUTER join  defendant         def on  ce.defendant_id = def.def_id
                                        AND def.active = 1
    group by rollup(phase_number, am.which_month)
    ORDER BY  am.which_month
    ,            ph.phase_number
    ;Here is the shorted versions of the three tables:
    A_DEFENDANT, A_ENGAGEMENT, A_PHASE_MEMBERSHIP
    CREATE TABLE "A_DEFENDANT"
        "DEF_ID"     NUMBER NOT NULL ENABLE,
        "FIRST_NAME" VARCHAR2(50 BYTE),
        "SURNAME"    VARCHAR2(20 BYTE) NOT NULL ENABLE,
        "DOB" DATE NOT NULL ENABLE,
        "ACTIVE" NUMBER(2,0) DEFAULT 1 NOT NULL ENABLE,
        CONSTRAINT "A_DEFENDANT_PK" PRIMARY KEY ("DEF_ID"))
    Sample Data
    Insert into A_DEFENDANT (DEF_ID,FIRST_NAME,SURNAME,DOB,ACTIVE) values (101,'Joe','Bloggs',to_date('12/12/99','DD/MM/RR'),1);
    Insert into A_DEFENDANT (DEF_ID,FIRST_NAME,SURNAME,DOB,ACTIVE) values (102,'John','Smith',to_date('20/05/00','DD/MM/RR'),1);
    Insert into A_DEFENDANT (DEF_ID,FIRST_NAME,SURNAME,DOB,ACTIVE) values (103,'Jane','Black',to_date('15/02/98','DD/MM/RR'),1);
    Insert into A_DEFENDANT (DEF_ID,FIRST_NAME,SURNAME,DOB,ACTIVE) values (104,'Minnie','Mouse',to_date('13/12/88','DD/MM/RR'),0);
    Insert into A_DEFENDANT (DEF_ID,FIRST_NAME,SURNAME,DOB,ACTIVE) values (105,'Daisy','Duck',to_date('05/08/00','DD/MM/RR'),1);
    CREATE TABLE "A_ENGAGEMENT"
        "ENGAGEMENT_ID" NUMBER NOT NULL ENABLE,
        "COURT_NAME"    VARCHAR2(50 BYTE) NOT NULL ENABLE,
        "DATE_REFERRED" DATE,
        "DETERMINATION_HEARING_DATE" DATE,
        "DATE_JOINED_COURT" DATE,
        "DATE_TREATMENT_STARTED" DATE,
        "DATE_TERMINATED" DATE,
        "TERMINATION_TYPE" VARCHAR2(50 BYTE),
        "ACTIVE"           NUMBER(2,0) DEFAULT 1 NOT NULL ENABLE,
        "DEFENDANT_ID"     NUMBER,
        CONSTRAINT "A_ENGAGEMENT_PK" PRIMARY KEY ("ENGAGEMENT_ID"))
    Insert into A_ENGAGEMENT (ENGAGEMENT_ID,COURT_NAME,DATE_REFERRED,DETERMINATION_HEARING_DATE,DATE_JOINED_COURT,DATE_TREATMENT_STARTED,DATE_TERMINATED,TERMINATION_TYPE,ACTIVE,DEFENDANT_ID) values (1,'AA',to_date('12/08/12','DD/MM/RR'),null,to_date('12/08/12','DD/MM/RR'),null,null,null,1,101);
    Insert into A_ENGAGEMENT (ENGAGEMENT_ID,COURT_NAME,DATE_REFERRED,DETERMINATION_HEARING_DATE,DATE_JOINED_COURT,DATE_TREATMENT_STARTED,DATE_TERMINATED,TERMINATION_TYPE,ACTIVE,DEFENDANT_ID) values (2,'BB',to_date('01/09/12','DD/MM/RR'),null,to_date('02/09/12','DD/MM/RR'),null,null,null,1,102);
    Insert into A_ENGAGEMENT (ENGAGEMENT_ID,COURT_NAME,DATE_REFERRED,DETERMINATION_HEARING_DATE,DATE_JOINED_COURT,DATE_TREATMENT_STARTED,DATE_TERMINATED,TERMINATION_TYPE,ACTIVE,DEFENDANT_ID) values (3,'AA',to_date('02/09/12','DD/MM/RR'),null,to_date('15/09/12','DD/MM/RR'),null,null,null,1,103);
    Insert into A_ENGAGEMENT (ENGAGEMENT_ID,COURT_NAME,DATE_REFERRED,DETERMINATION_HEARING_DATE,DATE_JOINED_COURT,DATE_TREATMENT_STARTED,DATE_TERMINATED,TERMINATION_TYPE,ACTIVE,DEFENDANT_ID) values (4,'BB',to_date('01/10/12','DD/MM/RR'),null,to_date('02/10/12','DD/MM/RR'),null,null,null,1,105);
    CREATE TABLE "A_PHASE_MEMBERSHIP"
        "MPM_ID"       NUMBER NOT NULL ENABLE,
        "MPM_ENG_ID"   NUMBER NOT NULL ENABLE,
        "PHASE_NUMBER" VARCHAR2(50 BYTE),
        "DATE_STARTED" DATE NOT NULL ENABLE,
        "DATE_FINISHED" DATE,
        "NOTES"  VARCHAR2(2000 BYTE),
        "ACTIVE" NUMBER(2,0) DEFAULT 1 NOT NULL ENABLE,
        CONSTRAINT "A_PHASE_MEMBERSHIP_PK" PRIMARY KEY ("MPM_ID"))
    Insert into A_PHASE_MEMBERSHIP (MPM_ID,MPM_ENG_ID,PHASE_NUMBER,DATE_STARTED,DATE_FINISHED,NOTES,ACTIVE) values (1,1,'PHASE ONE',to_date('15/09/12','DD/MM/RR'),to_date('20/09/12','DD/MM/RR'),null,1);
    Insert into A_PHASE_MEMBERSHIP (MPM_ID,MPM_ENG_ID,PHASE_NUMBER,DATE_STARTED,DATE_FINISHED,NOTES,ACTIVE) values (2,1,'PHASE TWO',to_date('21/09/12','DD/MM/RR'),to_date('29/09/12','DD/MM/RR'),null,1);
    Insert into A_PHASE_MEMBERSHIP (MPM_ID,MPM_ENG_ID,PHASE_NUMBER,DATE_STARTED,DATE_FINISHED,NOTES,ACTIVE) values (3,2,'PHASE ONE',to_date('12/09/12','DD/MM/RR'),null,null,1);
    Insert into A_PHASE_MEMBERSHIP (MPM_ID,MPM_ENG_ID,PHASE_NUMBER,DATE_STARTED,DATE_FINISHED,NOTES,ACTIVE) values (4,3,'PHASE ONE',to_date('20/09/12','DD/MM/RR'),to_date('01/10/12','DD/MM/RR'),null,1);
    Insert into A_PHASE_MEMBERSHIP (MPM_ID,MPM_ENG_ID,PHASE_NUMBER,DATE_STARTED,DATE_FINISHED,NOTES,ACTIVE) values (5,3,'PHASE TWO',to_date('02/10/12','DD/MM/RR'),to_date('15/10/12','DD/MM/RR'),null,1);
    Insert into A_PHASE_MEMBERSHIP (MPM_ID,MPM_ENG_ID,PHASE_NUMBER,DATE_STARTED,DATE_FINISHED,NOTES,ACTIVE) values (6,4,'PHASE ONE',to_date('03/10/12','DD/MM/RR'),to_date('10/10/12','DD/MM/RR'),null,1);
    Insert into A_PHASE_MEMBERSHIP (MPM_ID,MPM_ENG_ID,PHASE_NUMBER,DATE_STARTED,DATE_FINISHED,NOTES,ACTIVE) values (7,3,'PHASE THREE',to_date('17/10/12','DD/MM/RR'),null,null,0);
    Insert into A_PHASE_MEMBERSHIP (MPM_ID,MPM_ENG_ID,PHASE_NUMBER,DATE_STARTED,DATE_FINISHED,NOTES,ACTIVE) values (8,1,'PHASE THREE',to_date('30/09/12','DD/MM/RR'),to_date('16/10/12','DD/MM/RR'),null,1);
    The requirements are:
    The user must be able to request the extract for one or more calendar months, e.g.
    May 2013
    May 2013 – Sep 2013.
    The file must contain a separate row for each calendar month in the requested range. Each row must contain the statistics computed for that calendar month.
    The file must also include a row of totals.
    The user must be able to request the extract for either Waitakere or Auckland or Consolidated (both courts’ statistics accumulated).
    Then the part that I am stuck is
    For each monitoring phase:
    Phase name (e.g. “Phase One”)
    Avg_time_in_phase_all_particip
    for each phase name,
    Add up days in each “phase name” Monitoring Phase, calculated as:
    If Monitoring Phase.Date Finished is NULL or > month end date,
    +(*Month end date* Minus Monitoring Phase.Date Started Plus 1)+
    Otherwise (phase is complete)
    +(Monitoring Phase.Date Finished Minus Monitoring Phase.Date Started Plus 1.)+
    Divide by the numbers of all participants who have engaged in “phase name”.
    This is the words of the Business Analyst,
    I try to do as required but still struggle to identify end_month for the above formula to display for the range of months.
    Of course, I can write two nested cursor. The first one run the list of month, then for each month, run the parameterised report.
    But I prefer if possible just use SQL statements, or at least a PL/SQL but return a query.
    With this way, I can create an APEX report, and use their CSV Extract function.
    Yes, you are right, court_name is one of the selection parameters.
    And the statistics is not exactly for one month. It is kind of trying to identify all phases that are running through the specified month (even phase.date_started is before the month start).
    This is the reason why I put the condition AND ph.date_started <= last_day(TO_DATE('Oct 2012','MON YYYY')) (otherwise I get negative avg_days)
    User can choose either one court "AA" or "BB" or combined which is all figures.
    Sorry for bombarding you a lot of information.
    Thanks a lot, again.
    Edited by: Ann586341 on Oct 29, 2012 9:57 PM
    Edited by: Ann586341 on Oct 29, 2012 9:59 PM

  • Custom report outer-join display problem

    I have written a custom report for Grid that produces info on database options, combined with info on the hardware of the servers where the databases reside. It is a customer requirement that all output be displayed as one huge table, with duplicate cells where logic dictates... so I've used a couple of nested queries + outer joins.
    My SQL query provides the correct data, however Grid appears to be acting clever, and instead of displaying one big table with duplicate values where required, it is splitting the output into a series of tables.
    It might look neater, but it's not what I've been asked to provide.
    Is there anything I can do to prevent this, and force Grid to display the info as one table?
    Thanks,
    Chris

    Hello Chris,
    did you already try to create a View based on your query and use this view in a Report Element?
    Regards
    Rob
    For more info, tips and tricks on oem gc check: http://oemgc.wordpress.com

  • Need to adjust SQL query for left outer join in Crystal Reports 2008.

    I need to change this SQL 2005 query.....
    SELECT     omnicell_anl.DeviceIDsLastMetricTable.member_id, omnicell_anl.DeviceIDsLastMetricTable.[Device Name],
                          omnicell_anl.DeviceIDsLastMetricTable.Account, omnicell_anl.labeledLastMetrics.PROPERTY_NAME,
                          omnicell_anl.labeledLastMetrics.latest_monitor_value
    FROM         omnicell_anl.DeviceIDsLastMetricTable LEFT OUTER JOIN
                          omnicell_anl.labeledLastMetrics ON omnicell_anl.DeviceIDsLastMetricTable.member_id = omnicell_anl.labeledLastMetrics.member_id
    WHERE
        omnicell_anl.labeledLastMetrics.PROPERTY_NAME = ?MyProperty
    To this query in Crystal Reports Report Writer:
    SELECT     omnicell_anl.DeviceIDsLastMetricTable.member_id, omnicell_anl.DeviceIDsLastMetricTable.[Device Name],
                          omnicell_anl.DeviceIDsLastMetricTable.Account, omnicell_anl.labeledLastMetrics.PROPERTY_NAME,
                          omnicell_anl.labeledLastMetrics.latest_monitor_value
    FROM         omnicell_anl.DeviceIDsLastMetricTable LEFT OUTER JOIN
                          omnicell_anl.labeledLastMetrics ON omnicell_anl.DeviceIDsLastMetricTable.member_id = omnicell_anl.labeledLastMetrics.member_id AND
                          omnicell_anl.labeledLastMetrics.PROPERTY_NAME = ?MyProperty
    I can't seem to get the left outer join function of Crystal Reports to emulate the same SQL query in SQL 2005.  Any ideas on how I can create this same query in Crystal 2008?
    Thanks,
    Dominic
    Edited by: Dominic Carissimi on Oct 28, 2008 7:55 PM
    Edited by: Dominic Carissimi on Oct 28, 2008 7:56 PM

    If you want the list of values for command level parameter then you need to add another command like
    select PropertyField from table
    and delete the links between this command and the existing command.
    Now go to field explorer and edit the command level parameter and make it as dynamic and add the property field from newly added command.
    Hope this helps!
    Raghavendra

  • OBIEE not applying outer join syntax to filters

    (Note: I've already thoroughly searched the forums before posting this. Thanks)
    My problem is the following:
    I'm trying to build a report that is a count from my fact table, grouped by month from my date dimension for a given year, resulting in 12 data points. The problem is that not all months have actual data, but I still need those months to show on the report with a count of zero. Typical simple reporting requirement.
    I have already done the obvious and within my business layer made the join between my fact table and my date dimension an outer join on the fact side, just like you'd do if writing the query by hand. And when tested by hand this includes all dates for the year anyway, and when coupled with the appropriate null test on the count measure I'd get my 12 data points with zeros were appropriate.
    The problem is that there are additional filters I need to apply on the fact data (there are a couple text-based code values that didn't warrant full tables themselves so are just degenerate dimensions directly on the fact table.)
    When these filters are applied at the Answer level, I'm only getting back the months that actually have data, and lose the months where the count should be zero. A check of the session log for the query that was generated shows the problem. While OBI properly generates the outer-join syntax for the join itself between the two tables (my date dim and fact table) it does NOT apply the outer-syntax to the constant-based filter against the fact, effectively negating the outer join.
    Actual query from the log (I simply changed the table aliases from the ugly T##### stuff OBI generates to something more readable for posting here):
    select D.DT_MONTH_NAME as c1,
    D.DT_MONTH_NUM as c2,
    I.INC_TYPE as c3,
    I.INC_EMP_GROUP as c4,
    sum(case when I.INC_KEY is null then 0 else 1 end ) as c5
    from DATE_DIM D, INCIDENT_F I
    where ( D.DATE_KEY = I.DATE_KEY (+) ) and ( D.DT_YEAR = 2010 and I.INC_EMP_GROUP = 'CONTRACTOR' )
    group by D.DT_MONTH_NUM, D.DT_MONTH_NAME, I.INC_TYPE, I.INC_EMP_GROUP
    order by c2
    You can see that the outer syntax (+) is applied to the join, but not to the filter on I.INC_EMP_GROUP. If I take this query and drop it in something like SQL Developer, it only returns the months with data. If I throw the (+) after I.INC_EMP_GROUP like I'd do if writing this by hand, the desired zero-months results pop back in.
    I have already searched the forums and while lots of people seem to have asked this question, the only solutions involve things like trickery in the business layer using dummy fact tables followed by manipulations at the report level etc. Unfortunately I can't rely on these as the system is eventually to be turned over to users who can't be expected to apply various hacks to write reports.
    Anyone ever get to the bottom of getting OBI to apply outer join logic in filters as well, when the filtered table is meant to be outer-joined to?
    Any comments are appreciated.
    John

    I know that this thread is a bit old thought it might be helpful to some one...
    The Issue is, when using Degener@teDimen$ion ( this is !nner joned to FACT tables in BMM) and if any of the dimensions {other than theDegener@teDimen$ion (Let us say Dim X) } have an ()uter join to any of the fact tables, and you were doing your analysis using Degener@teDimen$ion,  Dim X, Measure value you will face the following issues.
    when filtering the analysis on the ()uter join dimension ( Dim X), the IN filter will not work. Reason is that the filter is getting applied to both the Dimension and FACT tables and the values that exist in Dimension Dim X but not in FACT table wont show up.
         The above issue can be fixed by changing the join between the fact and Degener@teDimen$ion from inner to outer. I think this is a bug.. because  it is supposed to filter the fact  table after the entire outer joined result is obtained but not filter the fact table for the Dim X values and do a outer join. I think the BI should be intelligent enough.

  • OBIEE 10g Getting wrong results when adding calculated columns to a report

    Hi,
    I'm experiencing a possible misbehaviour with OBIEE 10g (10.1.3.4.1).
    I have a simple report with a table. Columns are simply selected from dimensions and facts. In this case the generated query is:
    WITH
    SAWITH0 AS (select sum(T30604.TOTAL_TIME) as c1,
    sum(T30604.MATERIALS_QTT_COST) as c2,
    sum(T30604.AMNT) as c3,
    sum(T30604.QNTY) as c4,
    T30622.BRANCH_CODE as c5,
    T25064.SRP1_CODE as c6,
    T25064.SRP1_DESC as c7,
    T25064.SRP2_CODE as c8
    from
    THK_BRANCHES T30622,
    THK_ITEMS T25064,
    THK_INVENTORY_TRANSACTIONS T30604
    where ( T25064.ITEM_ID = T30604.ITEM_ID and T30604.BRANCH_ID = T30622.BRANCH_ID )
    group by T25064.SRP1_CODE, T25064.SRP1_DESC, T25064.SRP2_CODE, T30622.BRANCH_CODE)
    select distinct SAWITH0.c5 as c1,
    SAWITH0.c6 as c2,
    SAWITH0.c7 as c3,
    SAWITH0.c8 as c4,
    SAWITH0.c4 as c5,
    SAWITH0.c3 as c6,
    SAWITH0.c2 as c7,
    SAWITH0.c1 as c8,
    SAWITH0.c4 as c9,
    SAWITH0.c3 as c10,
    SAWITH0.c2 as c11,
    SAWITH0.c1 as c12,
    SAWITH0.c4 as c13,
    SAWITH0.c3 as c14,
    SAWITH0.c2 as c15,
    SAWITH0.c1 as c16,
    SAWITH0.c4 as c17,
    SAWITH0.c3 as c18,
    SAWITH0.c2 as c19,
    SAWITH0.c1 as c20
    from
    SAWITH0
    Results of this report / query are correct.
    I then add a simple calculation (subtraction between two fields). The generated query is:
    WITH
    SAWITH0 AS (select sum(T30604.MATERIALS_QTT_COST) as c1,
    sum(T30604.AMNT) as c2,
    T30622.BRANCH_CODE as c3,
    T25064.SRP1_CODE as c6,
    T25064.SRP1_DESC as c7,
    sum(T30604.TOTAL_TIME) as c8,
    sum(T30604.QNTY) as c11,
    T25064.SRP2_CODE as c12
    from
    THK_BRANCHES T30622,
    THK_ITEMS T25064,
    THK_INVENTORY_TRANSACTIONS T30604
    where ( T25064.ITEM_ID = T30604.ITEM_ID and T30604.BRANCH_ID = T30622.BRANCH_ID )
    group by T25064.SRP1_CODE, T25064.SRP1_DESC, T25064.SRP2_CODE, T30622.BRANCH_CODE),
    SAWITH1 AS (select D1.c1 as c1,
    D1.c2 as c2,
    D1.c3 as c3,
    D1.c4 as c4,
    D1.c5 as c5,
    D1.c6 as c6,
    D1.c7 as c7,
    D1.c8 as c8,
    D1.c9 as c9,
    D1.c10 as c10,
    D1.c11 as c11,
    D1.c12 as c12
    from
    (select sum(SAWITH0.c1) over (partition by SAWITH0.c3) as c1,
    sum(SAWITH0.c2) over (partition by SAWITH0.c3) as c2,
    SAWITH0.c3 as c3,
    sum(SAWITH0.c1) over (partition by SAWITH0.c6, SAWITH0.c3) as c4,
    sum(SAWITH0.c2) over (partition by SAWITH0.c6, SAWITH0.c3) as c5,
    SAWITH0.c6 as c6,
    SAWITH0.c7 as c7,
    sum(SAWITH0.c8) over (partition by SAWITH0.c6, SAWITH0.c12, SAWITH0.c3) as c8,
    sum(SAWITH0.c1) over (partition by SAWITH0.c6, SAWITH0.c12, SAWITH0.c3) as c9,
    sum(SAWITH0.c2) over (partition by SAWITH0.c6, SAWITH0.c12, SAWITH0.c3) as c10,
    sum(SAWITH0.c11) over (partition by SAWITH0.c6, SAWITH0.c12, SAWITH0.c3) as c11,
    SAWITH0.c12 as c12,
    ROW_NUMBER() OVER (PARTITION BY SAWITH0.c3, SAWITH0.c12 ORDER BY SAWITH0.c3 ASC, SAWITH0.c12 ASC) as c13
    from
    SAWITH0
    ) D1
    where ( D1.c13 = 1 ) ),
    SAWITH2 AS (select sum(T30604.MATERIALS_QTT_COST) as c1,
    sum(T30604.AMNT) as c2
    from
    THK_INVENTORY_TRANSACTIONS T30604)
    select SAWITH1.c3 as c1,
    SAWITH1.c6 as c2,
    SAWITH1.c7 as c3,
    SAWITH1.c12 as c4,
    SAWITH1.c11 as c5,
    SAWITH1.c10 as c6,
    SAWITH1.c9 as c7,
    SAWITH1.c8 as c8,
    SAWITH1.c10 - SAWITH1.c9 as c9,
    SAWITH1.c11 as c10,
    SAWITH1.c10 as c11,
    SAWITH1.c9 as c12,
    SAWITH1.c8 as c13,
    SAWITH1.c11 as c15,
    SAWITH1.c10 as c16,
    SAWITH1.c9 as c17,
    SAWITH1.c8 as c18,
    SAWITH1.c11 as c20,
    SAWITH1.c10 as c21,
    SAWITH1.c9 as c22,
    SAWITH1.c8 as c23,
    SAWITH1.c5 as c26,
    SAWITH1.c4 as c27,
    SAWITH1.c2 as c28,
    SAWITH1.c1 as c29,
    SAWITH2.c2 as c30,
    SAWITH2.c1 as c31
    from
    SAWITH1,
    SAWITH2
    Results of this report / query are wrong: it seems as if some rows "disappear".
    If I delete the filter in SAWITH1 query above ( D1.c13 = 1 ) results are correct.
    Anyone experiencing the same problem? The strange thing is that I have a number of similar reports (on other subject areas) and everyting is working fine.
    Please also note that I don't want to add this kind of calculated items in the RPD (they can be simple calculations that are made on-the-fly).
    Any help would be greatly appreciated.
    Thanks a lot and regards,
    Cristina

    I have the same issue, everything OBIEE server generate query using ROW_NUMBER() over () function, it will hardcode Dx.cx = 1, this will cause issue if you have rows of the same distinct value, thus causing missing rows and the final results will be wrong.
    I have open a SR with Oracle Support since March 2011, but till today, they have not resolve the issue yet.
    Hope they solve the issue soon.
    Best Regards
    KT

  • Problem in navigating from one report to another in OBIEE 10g

    Hi,
    I am facing an issue with OBIEE 10g while applying navigation on my reports.
    Lets suppose I made a report showing list of all items(in broad categories) sold on a particular day, say Dairy, Frozen Foods, Chocolates etc.In this report there is a date prompt showing the date of sale.
    Now there are certain items that are distributed within these categories, like dairy includes milk, cheese, butter etc.
    Hence, my navigation should be like when I click on a particular item category, the control should move on to the report which has all items under that particular category and the prompt for this report should show the same date as passed in the previous report.
    But sometimes what happens is that on clicking the navigation from first report to the second one, the date is not persisting in the prompt. I say sometimes because at times the navigation does work correctly. This is a bug of Obiee or something which is giving unexpected results.
    Kindly help with your suggestions.
    Thanks
    Ankita

    Ankita,
    This is not a bug in OBIEE...I'm sure something is missing. If this is working for some cases and not working for some other case then you will need to find the root cause. Try in bits and pieces...Step by Step with some dates (unit testing). Ideally this shud work properly.
    For an instance try with OBIEE drilldown feature and not with navigation with a single sale date and observe the behavior.
    Hope its clear...

Maybe you are looking for

  • I changed Java settings and now Firefox crashes as it opens, even in safe mode; how can I fix this?

    I was trying to change settings to access the comments section of Slate.com. Right or wrong, I changed a Java setting from -1 to 2. The setting was in about:config and I believe it involved some sort of max. As I cannot open anything, I am not sure.

  • PDF Portfolio: I am not allowed to reduce its size nor to optimize it. Urgent help!

    I have the trial version of Adobe Acrobat XI. I have created a portfolio. I need to reduce the size of this portfolio, but when I try I keep getting a message that says that I don't have "enought permissions to do this". What do I have to do to be ab

  • Link from QBE-report to form not working when published as portlets

    I've created a simple QBE-report where I've linked (using a LINK) keyvalues to a detail FORM. Query and linking and automatically display of selected record works fine in the App.builder, - but when I publish the elements as portlets and access the Q

  • Saving a file with audio

    Hi. I'm unable to save a Keynote slideshow that I made with an iTunes song associated with it. I see the "Copy Audio & Movies into Document" in the Save As box, and it's selected but greyed out. I need to be able to play this show, with audio, on my

  • Photo '11 bugs - Faces and Places

    I'm reading a lot of bugs about iPhoto '11. I would not upgrade until these kinks are worked out. Three bugs that are really "bugging" me: 1) *Names of Faces changing.* I had an album with all the Faces properly named. After I uploaded the album to F