Hierarchies in planning query

Hi All,
I am unable to ristrict planning key figure with infoprovider(0INFOPROV) hierarchy. It is giving error "characteristic 0INFOPROV allows no complex selection " .  But it is working fine with BW queries. Please provide any inputs.
Thanks & Regards,
Reshma.

Hi,
Thanks for your reply.
we are  using single value selction only for infoprovider.
In  single value selction we selected one hier node which contains only one infoprovider. Even if we select info provider directly form hierarachy list, then also it is showing same error. please provide any help.
Thanks & Regards,
Reshma.

Similar Messages

  • Not getting 'actual data' in the planning query

    Hi all,
    I am debug other's query. This cube stores 'actual' and 'plan' data and I loaded 'actual' and can see it in the cube. But I cannot see 'actual data' when I run the planning query.
    I checked all restrictions in the KFs and CHARs and fliters in the query. There are only 'value type 10', 'fiscal year variant Z1', and 'currency CAD' restricted and actual data does contain those values in all line items.
    Can someone point it out what it could be the issue? Thank you.
    R.

    Hi,
    if you enter some data (plan data) you cannot see it again. Is that correct?
    are you using the same query to enter and to see plan data?
    Because if you are entering data in an aggregate level and you are executing your query over the infocube you will not see the data from the yellow request. If you execute query over the aggregate you should be able to see all data in the cube (yellow and green requests).
    Also check if your query is defined as per note 1136163.
    I hope this helps.
    Lucimar

  • Help with Planning Query - 0CALMONTH not showing up

    Hi, I have a simple planning query where I am trying to allow users to input or change an Amount by Material/Month.  The User inputs a Version and a Date Range to maintain.  The selected dates should show up going across the screen even if there is no existing data.  These Variables are in the Query Filter along with a few other characteristic Filters.  So in my query I have 0MATERIAL in the Rows and I have 0CALMONTH and my Key Figure.  Under advanced for the characteristic 0CALMONTH it is set as Master Data.
    When I run the query for some reason the 0CALMONTHS do not show up going across.  If I run the query and put in one value then the 12 months show up.  Seems like a bug.  I have another similar query where this works.  Can anyone take a look at the screen shots and help me figure this out?
    [Query Def Screen 1|http://i35.tinypic.com/1h8con.png]
    [Query Def Screen 2|http://i36.tinypic.com/1f781c.png]
    [0MATERIAL Def|http://i36.tinypic.com/xefq8i.png]
    [0CALMONTH Def|http://i35.tinypic.com/ej8qpv.png]
    Thanks!
    Edited by: Kenneth Murray on Nov 5, 2009 3:12 PM

    Dear  Kenneth,
    I think its a bug.  If we post the value without the drilldown on 0CALMONTh then its open for the input, and after that if we drill down it with 0CALMONTH for same selection, it opens for input.  but for new selection of month it not opens.
    Have you solved the problem?
    Regards,
    V B Udani

  • Daily Production Plan query changes

    Dear Experts,
    I was tried  to do a daily production plan query,  but i need to add one more feild in the below query, (ie) In sale order Document, Row level feild of Quantity ( RDR1,Quantity) should be in that query,
    SELECT T0.[ItemCode],T1.[ItemName], T0.[PlannedQty] as 'Planned Qty', T0.[DocNum] as 'Doc No', T0.[PostDate], T0.[OriginNum] as 'Sale Order No', T0.[CardCode], T0.[CmpltQty] as 'Completed Qty' FROM OWOR T0 join OITM T1 on T0.Itemcode = t1.ItemCode WHERE T0.[PostDate] >='[%0]' and T0.[PostDate] <='[%1]'
    Plz help me.
    Thanks and Regards,
    Manikandan

    Hello Manikandan,
    You can add the sales order into the production order, but you should now: there is no connection defined between sales order lines and production order, only the item code can be used as reference to sales order lines
    I mean:
    *if you have the same item in sales order lines in different position the query always multiplies the result. *
    So you can join the sales order header for Origin Number and DocNum, and sales order lines by Itemcode
    SELECT
         T0.[ItemCode],T1.[ItemName], T0.[PlannedQty] as 'Planned Qty', T0.[DocNum] as 'Doc No', T0.[PostDate],
         T0.[OriginNum] as 'Sale Order No', T0.[CardCode], T0.[CmpltQty] as 'Completed Qty',
         T3.[Quantity] [Sales order Qty], T3.LineNum [Sales order Postion]
    FROM
         OWOR T0 join OITM T1 on T0.Itemcode = t1.ItemCode     
         left outer join ORDR T2 on T0.[OriginNum] = T2.[DocNum]
         left outer join RDR1 T3 on T2.[DocEntry] = T3.[DocEntry] and T3.[ItemCode] = T0.[ItemCode]
    WHERE T0.[PostDate] >='[%0]' and T0.[PostDate] <='[%1]'
    Regards
    J.

  • Issue creating planning query on cube partitioned by fiscal period

    I have a cube that is partitioned by fiscal period (0FISCPER).  This requires that there is a constant value for fiscal year variant (0FISCVARNT).  When I try to create an agg level on this cube 0FISCVARNT is automatically pulled into the agg level.  However, because 0FISCVARNT is set to a constant value it is not available in query designer to add into a planning query...as such, I cannot create a planning query on this cube.
    I can repartition the cube (i.e. remove the partitioning), but does anyone know of any other work arounds?
    Thanks.

    We resolved this.

  • Planning query donu2019t show current data

    Hello,
    I have an input ready query over an aggregation level of a real time cube. Whenever the yellow request is closed and a new request is opened, the input ready query does not show the old data. And sometimes it shows incorrect data. We found that the issue is with the Cache.
    In RSRT when opening the input ready query in debug mode with "Do not use cache setting", the query returns correct data. But the surprise thing is that, the input ready query has Cache setting as inactive (0) in RSRT. So we had to generate the Delta buffer query <infoprovider>/!!1<infoprovider> in RSRT where <infoprovider> is the name of the real time cube.
    This solved our problem and the query brought in correct data. But again when I close the second request, the input ready query again shows me no data or shows me wrong data. So again we need to generate the delta buffer query in RSRT <infoprovider>/!!1<infoprovider>.
    This is very annoying when considering the fact that you have to generate the delta buffer query every time the request is closed. This could be a overhead in maintenance and will not go well with people.
    Does anybody have any solutions for solving this issue. Is there any setting by which we can turn off cache altogether or delete cache when a request is closed etc? or worst conditions how to automate the generation of delta buffer queries every time the request is closed?
    Any help is really appreciated.
    Regards,
    Anand

    please check the below;
    Delta buffer query in RSRT for BI-IP ("<infoprovider>/!!1<infoprovider>)
    Planning query donu2019t show the current data
    Edited by: Hymavathi Yanamadala on Sep 9, 2009 5:47 AM

  • No auth error while executing BI integrated planning Query

    Hi to all,
    I have created integrated planning Query in Bex Query designer.
    But while executing BI integrated planning query in portal, its giving errror.
    1.     No authorization for query "IP"
    2.     You are not authorized to edit this aggregation level CUBE_IP
    3.     Cannot load query u201CIPu201D (data provider u201CDP_1u201D: No authorization for requested service)
    Can any one tell me the solution for that.
    Regards
    Pavneet Rana

    Hi.
    For to check the authorization errors, you have to use the transaction  ST01 (System Trace) The Steps are:
    ST01 -->  Trace ON  --> In Trace Components, active "Authorization Check" --> Execute the query with the user --> Trace Off > Analysis> In User Name, put the user that execute the query --> F8
    You can see the authorization errors  in Dark Green.
    Regards !!!

  • Help with Planning Query

    I have a planning query with Material in the Rows, 0CALMONTH and Amount in the Columns.
    For a query selection the user puts in only version and month Date range say 04/2009 - 03/2010.  What I would like to happen is initially present the user with 3 empty rows where they input the Material and the different amounts going across for the selected 12 months.  Initially there is no planning data and all my efforts fail I think because I do not have any available values for material to plan against.  Is this possible?
    I have another similar query, but I have fixed values on the left.
    Can anyone help with this?

    Hi thanks for your patience.
    I am trying to get a planning query with 3 empty rows to start.  The User inputs the Month Range.  In each row I would like and empty field for Material input and empty key figure fields for each of the months in the range.  I have a similar query already, but instead of starting with no Materials I have fixed materials and it works fine.  It's just a problem when I'm starting out with no materials.   Any ideas?   Thanks for your help.
              Month 1 Month 2 Month 3,
    Material, Amount, Amount, Amount, ...
    Material, Amount, Amount, Amount, ...
    Material, Amount, Amount, Amount, ...

  • Characteristic selected in Dropdown box does not influence planning query

    Dear all,
    We have a problem filling all the characteristics in a planning query to make it possible to plan, inside a BEx Layout.
    We are using Dropdown boxes to restrict the characteristics in the query so it can be able to plan. Only when we put the characteristic in the lines of the query it is able to being able to plan on the required conditions. This results in a query with many characteristics in the lines and therefore unattractive to the users. We believe that it should be possible to restrict the characteristics in the query by drop-down box. Can you explain us how to achieve this restriction in the planning query.
    Kind Regards,
    Mazzz

    Hi Mazzz,
    you have to insert a dropdown menu, link it to one dataprovider (maybe the same of the query) ad set some simple paramiters in dropdown (chose characteristic end so on..)
    hope this helps
    Michele

  • How to save the data in Planning query in Analyser?

    HI all,
    I am new in Integrated Planning I have made a planning query and I am inputting data in the query, right clicking to excel sheet and saving it saved data into cube but if I want a save button specific to query not specific to workbook how can I make it as generic, as when I run the query in analyser the button should be displayed in the Planning query on clicking it the data gets saved to cube.
    Abhijit.

    Hi Abhi,
    Hope this will be helpful to you.
    http://help.sap.com/saphelp_nw70/helpdata/en/43/a033e0f56e21b5e10000000a1553f6/frameset.htm
    Thanking You,
    Sappie

  • Explain Plan query

    I just changed the hint to pick different indexes inside the same SQL and they have significant different performance. SQL1 is much faster than SQL2 and the explain plain is very different. I found that there is some values like :Q1003, :Q1004 and :Q1005 under Object Code in the explain plan of SQL1. May I know how to interpret this?
    Thanks.
    Edited by: 843672 on Mar 11, 2011 3:42 AM

    Welcome to the forum.
    Before you even think of posting another 'question', first read:
    http://tkyte.blogspot.com/2005/06/how-to-ask-questions.html
    and secondly, when it comes to tuning requests, read:
    When your query takes too long ...
    HOW TO: Post a SQL statement tuning request - template posting
    and there's also a FAQ and a SQL and PL/SQL FAQ....
    http://forums.oracle.com/forums/ann.jspa?annID=1535

  • Oracle 10g Diff in execution plan query with binding var Vs without

    We recently did 10g upgrade. In 10g, execution plan differs for query with binding var(thru jdbc etc) Vs without it as given below. For query with binding var,
    it chooses poor execution plan(no index is used, full scan is done etc). everything worked fine in 9i. To rectify the problem, we have to hint query with right index,join etc. but i dont like this solution.
    I would rather prefer to correct database to choose right execution path instead of eacy query level. but not sure what causes the issue.
    Does anybody came across this issue? if so, Please share your experiences. Thanks for the help. Do let me know if you need more info.
    1. Query without binding bar:
    select * from test where col1 = :1 and col2 = :2
    1. Query without binding bar:
    select * from test where col1 = 'foo' and col2= 'bar'

    I am not an expert but in my humble opinion it is the developer's responsability to ensure the correct explain plan is used before deploying code to production, if the explain plan returned by the DB is bad, then the use of a hint is perfectly acceptable.
    Check this out: http://lcgapp.cern.ch/project/CondDB/snapshot/performance.html
    Excerpt:
    Bind variable peeking. If an SQL query contains bind variables, the optimal execution plan may depend on the values of those variables. When the Oracle query optimizer chooses the execution plan for such a query, it may indeed look at the values of all bind variables involved: this is known as "bind variable peeking".
    In summary, the execution plan used for a given SQL query cannot be predicted a priori because it depends on the presence and quality of statistics and on the values of bind variables used at the time the query was first executed (hard-parsed). As a consequence of this instability of execution plans, very different performances may be observed for the same SQL query. In COOL, this issue is addressed by adding Oracle hints to the queries, to make sure that the same (good) plan is used in all cases, even with unreliable statistics or unfavourable bind variables.
    Edited by: Rodolfo Ferrari on Jun 3, 2009 9:40 PM

  • Analyze Explain Plan --Query Stuck

    Hello,
    I am a newbie to Oracle.Urgently need help on a query running on Production Oracle 11g database.
    This query is getting stuck for a very long time while fetching data.Here is the explain Plan for it.Could anyone please point out what is the problem and what needs to be corrected.Thanks in advance.
    Rollback complete.
    Explain complete.
    Commit complete.
    PLAN_TABLE_OUTPUT
    Plan hash value: 3980578161
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Pstart| Pstop |
    | 0 | SELECT STATEMENT | | 155 | 33325 | 716 (1)| 00:00:11 | | |
    | 1 | SORT ORDER BY | | 155 | 33325 | 716 (1)| 00:00:11 | | |
    |* 2 | VIEW | | 155 | 33325 | 715 (1)| 00:00:11 | | |
    |* 3 | WINDOW SORT PUSHED RANK | | 155 | 61535 | 715 (1)| 00:00:11 | | |
    |* 4 | VIEW | | 155 | 61535 | 714 (1)| 00:00:10 | | |
    | 5 | WINDOW BUFFER | | 155 | 34565 | 714 (1)| 00:00:10 | | |
    | 6 | SORT GROUP BY | | 155 | 34565 | 714 (1)| 00:00:10 | | |
    | 7 | TABLE ACCESS BY INDEX ROWID | BTM_EIN | 1 | 19 | 2 (0)| 00:00:01 | | |
    | 8 | NESTED LOOPS | | 155 | 34565 | 712 (1)| 00:00:10 | | |
    |* 9 | HASH JOIN | | 155 | 31620 | 669 (1)| 00:00:10 | | |
    |* 10 | HASH JOIN | | 222 | 28194 | 662 (1)| 00:00:10 | | |
    | 11 | TABLE ACCESS BY LOCAL INDEX ROWID| PR_EMPRESS_PAYROLL_FACT | 194 | 7178 | 658 (1)| 00:00:10 | | |
    | 12 | NESTED LOOPS | | 1001 | 89089 | 658 (1)| 00:00:10 | | |
    | 13 | NESTED LOOPS | | 5 | 260 | 17 (6)| 00:00:01 | | |
    |* 14 | HASH JOIN | | 5 | 200 | 7 (15)| 00:00:01 | | |
    | 15 | NESTED LOOPS | | 6 | 144 | 4 (0)| 00:00:01 | | |
    PLAN_TABLE_OUTPUT
    |* 16 | INDEX UNIQUE SCAN | REPORT_OU_IDX1 | 1 | 14 | 1 (0)| 00:00:01 | | |
    |* 17 | MAT_VIEW ACCESS FULL | PARENT_LEVEL_LOOKUP_MV | 6 | 60 | 3 (0)| 00:00:01 | | |
    | 18 | TABLE ACCESS BY INDEX ROWID | TP_OUC_HIER_CDIM | 5 | 80 | 2 (0)| 00:00:01 | | |
    | 19 | BITMAP CONVERSION TO ROWIDS | | | | | | | |
    |* 20 | BITMAP INDEX SINGLE VALUE | TP_OUC_HI_IDX2 | | | | | | |
    | 21 | TABLE ACCESS BY INDEX ROWID | LEDGER_OUC | 1 | 12 | 2 (0)| 00:00:01 | | |
    |* 22 | INDEX RANGE SCAN | LEDGER_OUC_I1 | 1 | | 1 (0)| 00:00:01 | | |
    | 23 | PARTITION RANGE ALL | | | | | | 1 | 82 |
    | 24 | BITMAP CONVERSION TO ROWIDS | | | | | | | |
    |* 25 | BITMAP INDEX SINGLE VALUE | PR_EMPRES_IDX7 | | | | | 1 | 82 |
    |* 26 | MAT_VIEW ACCESS FULL | TP_TIME_CDIM_MV | 12 | 456 | 3 (0)| 00:00:01 | | |
    |* 27 | TABLE ACCESS FULL | EMPRESS_CODE_DIM | 289 | 22253 | 7 (0)| 00:00:01 | | |
    |* 28 | INDEX RANGE SCAN | BTM_EIN_I1 | 1 | | 1 (0)| 00:00:01 | | |
    Predicate Information (identified by operation id):
    2 - filter("D1"."C16"=1)
    3 - filter(ROW_NUMBER() OVER ( PARTITION BY "SAWITH1"."C5","SAWITH1"."C6","SAWITH1"."C20","SAWITH1"."C21","SAWITH1"."C26","S
    AWITH1"."C27","SAWITH1"."C28","SAWITH1"."C29","SAWITH1"."C30" ORDER BY
    PLAN_TABLE_OUTPUT
    "SAWITH1"."C5","SAWITH1"."C6","SAWITH1"."C20","SAWITH1"."C21","SAWITH1"."C26","SAWITH1"."C27","SAWITH1"."C28","SAWITH1"."C29","
    SAWITH1"."C30")<=1)
    4 - filter(CASE WHEN '@{PR_Allowance}'='London Weighting' THEN "SAWITH1"."C9" WHEN '@{PR_Allowance}'='Pensionable' THEN
    "SAWITH1"."C10" WHEN '@{PR_Allowance}'='Non Pensionable' THEN "SAWITH1"."C11" ELSE "SAWITH1"."C8" END <>0.0)
    9 - access("T808692"."EMPRESS_CODE_KEY"="T808833"."PR_EMPRESS_CODE_KEY")
    10 - access("T808833"."PERIOD_KEY"="T809005"."PERIOD_KEY")
    14 - access("T808816"."LEVEL_FROM_PARENT"="T808999"."LEVEL_FROM_PARENT")
    16 - access("T809014"."TP_REPORT_OUC_KEY"='B')
    17 - filter("T808816"."OUC_TYPE"='Summed')
    20 - access("T808999"."TP_REPORT_OUC_KEY"='B')
    22 - access("T808999"."TP_CHILD_REPORT_OUC_KEY"="REPORT_OUC")
    25 - access("T808833"."TP_LEDGER_OUC_KEY"="LEDGER_OUC")
    26 - filter("T809005"."YEAR_DESC"='2010/11' AND TO_NUMBER("T809005"."PERIOD_KEY")<=201112)
    27 - filter("T808692"."EMPRESS_HIER_3_CODE"=3 OR "T808692"."EMPRESS_HIER_3_CODE"=5 OR "T808692"."EMPRESS_HIER_3_CODE"=13 OR
    "T808692"."EMPRESS_HIER_3_CODE"=17 OR "T808692"."EMPRESS_HIER_3_CODE"=19 OR "T808692"."EMPRESS_HIER_3_CODE"=27 OR
    "T808692"."EMPRESS_HIER_3_CODE"=29 OR "T808692"."EMPRESS_HIER_3_CODE"=31)
    28 - access("A"."EIN"="T808833"."TP_EIN_KEY")
    Note
    - dynamic sampling used for this statement
    63 rows selected.
    Regards
    AD

    Here is the explain plan for the same query run on CT environment.
    Rollback complete.
    Explain complete.
    Commit complete.
    PLAN_TABLE_OUTPUT                                                                                                                                              
    Plan hash value: 3514862671                                                                                                                                    
    | Id  | Operation                                          | Name                    | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     | Pstart| Pstop |    TQ  |I
    N-OUT| PQ Distrib |                                                                                                                                            
    |   0 | SELECT STATEMENT                                   |                         | 58565 |    14M|       |  5558   (1)| 00:01:18 |       |       |        |
         |            |                                                                                                                                            
    |   1 |  PX COORDINATOR                                    |                         |       |       |       |            |          |       |       |        |
         |            |                                                                                                                                            
    |   2 |   PX SEND QC (ORDER)                               | :TQ10011                | 58565 |    14M|       |  5558   (1)| 00:01:18 |       |       |  Q1,11 |
    P->S | QC (ORDER) |                                                                                                                                            
    |   3 |    SORT ORDER BY                                   |                         | 58565 |    14M|    33M|  5558   (1)| 00:01:18 |       |       |  Q1,11 |
    PLAN_TABLE_OUTPUT                                                                                                                                              
    PCWP |            |                                                                                                                                            
    |   4 |     PX RECEIVE                                     |                         | 58565 |    14M|       |  5556   (1)| 00:01:18 |       |       |  Q1,11 |
    PCWP |            |                                                                                                                                            
    |   5 |      PX SEND RANGE                                 | :TQ10010                | 58565 |    14M|       |  5556   (1)| 00:01:18 |       |       |  Q1,10 |
    P->P | RANGE      |                                                                                                                                            
    |*  6 |       VIEW                                         |                         | 58565 |    14M|       |  5556   (1)| 00:01:18 |       |       |  Q1,10 |
    PCWP |            |                                                                                                                                            
    |*  7 |        WINDOW SORT PUSHED RANK                     |                         | 58565 |    24M|    57M|  5556   (1)| 00:01:18 |       |       |  Q1,10 |
    PCWP |            |                                                                                                                                            
    |*  8 |         VIEW                                       |                         | 58565 |    24M|       |  5555   (1)| 00:01:18 |       |       |  Q1,10 |
    PCWP |            |                                                                                                                                            
    |   9 |          WINDOW BUFFER                             |                         | 58565 |    13M|       |  5555   (1)| 00:01:18 |       |       |  Q1,10 |
    PCWP |            |                                                                                                                                            
    |  10 |           SORT GROUP BY                            |                         | 58565 |    13M|    28M|  5555   (1)| 00:01:18 |       |       |  Q1,10 |
    PLAN_TABLE_OUTPUT                                                                                                                                              
    PCWP |            |                                                                                                                                            
    |  11 |            PX RECEIVE                              |                         | 58565 |    13M|       |  5554   (1)| 00:01:18 |       |       |  Q1,10 |
    PCWP |            |                                                                                                                                            
    |  12 |             PX SEND HASH                           | :TQ10009                | 58565 |    13M|       |  5554   (1)| 00:01:18 |       |       |  Q1,09 |
    P->P | HASH       |                                                                                                                                            
    |* 13 |              HASH JOIN                             |                         | 58565 |    13M|       |  5554   (1)| 00:01:18 |       |       |  Q1,09 |
    PCWP |            |                                                                                                                                            
    |  14 |               PX RECEIVE                           |                         | 58565 |    12M|       |  1731   (1)| 00:00:25 |       |       |  Q1,09 |
    PCWP |            |                                                                                                                                            
    |  15 |                PX SEND HASH                        | :TQ10008                | 58565 |    12M|       |  1731   (1)| 00:00:25 |       |       |  Q1,08 |
    P->P | HASH       |                                                                                                                                            
    |* 16 |                 HASH JOIN BUFFERED                 |                         | 58565 |    12M|       |  1731   (1)| 00:00:25 |       |       |  Q1,08 |
    PCWP |            |                                                                                                                                            
    |  17 |                  BUFFER SORT                       |                         |       |       |       |            |          |       |       |  Q1,08 |
    PLAN_TABLE_OUTPUT                                                                                                                                              
    PCWC |            |                                                                                                                                            
    |  18 |                   PX RECEIVE                       |                         |     1 |    14 |       |     1   (0)| 00:00:01 |       |       |  Q1,08 |
    PCWP |            |                                                                                                                                            
    |  19 |                    PX SEND BROADCAST               | :TQ10001                |     1 |    14 |       |     1   (0)| 00:00:01 |       |       |        |
    S->P | BROADCAST  |                                                                                                                                            
    |* 20 |                     INDEX RANGE SCAN               | REPORT_OU_IDX1          |     1 |    14 |       |     1   (0)| 00:00:01 |       |       |        |
         |            |                                                                                                                                            
    |* 21 |                  HASH JOIN                         |                         | 58565 |    11M|       |  1730   (1)| 00:00:25 |       |       |  Q1,08 |
    PCWP |            |                                                                                                                                            
    |  22 |                   BUFFER SORT                      |                         |       |       |       |            |          |       |       |  Q1,08 |
    PCWC |            |                                                                                                                                            
    |  23 |                    PX RECEIVE                      |                         |   383 | 31023 |       |     7   (0)| 00:00:01 |       |       |  Q1,08 |
    PCWP |            |                                                                                                                                            
    |  24 |                     PX SEND BROADCAST              | :TQ10002                |   383 | 31023 |       |     7   (0)| 00:00:01 |       |       |        |
    PLAN_TABLE_OUTPUT                                                                                                                                              
    S->P | BROADCAST  |                                                                                                                                            
    |* 25 |                      TABLE ACCESS FULL             | EMPRESS_CODE_DIM        |   383 | 31023 |       |     7   (0)| 00:00:01 |       |       |        |
         |            |                                                                                                                                            
    |* 26 |                   HASH JOIN                        |                         | 82520 |  9912K|       |  1722   (1)| 00:00:25 |       |       |  Q1,08 |
    PCWP |            |                                                                                                                                            
    |  27 |                    BUFFER SORT                     |                         |       |       |       |            |          |       |       |  Q1,08 |
    PCWC |            |                                                                                                                                            
    |  28 |                     PX RECEIVE                     |                         |     6 |    60 |       |     3   (0)| 00:00:01 |       |       |  Q1,08 |
    PCWP |            |                                                                                                                                            
    |  29 |                      PX SEND BROADCAST             | :TQ10003                |     6 |    60 |       |     3   (0)| 00:00:01 |       |       |        |
    S->P | BROADCAST  |                                                                                                                                            
    |* 30 |                       MAT_VIEW ACCESS FULL         | PARENT_LEVEL_LOOKUP_MV  |     6 |    60 |       |     3   (0)| 00:00:01 |       |       |        |
         |            |                                                                                                                                            
    |* 31 |                    HASH JOIN                       |                         |   136K|    14M|       |  1718   (1)| 00:00:25 |       |       |  Q1,08 |
    PLAN_TABLE_OUTPUT                                                                                                                                              
    PCWP |            |                                                                                                                                            
    |  32 |                     BUFFER SORT                    |                         |       |       |       |            |          |       |       |  Q1,08 |
    PCWC |            |                                                                                                                                            
    |  33 |                      PX RECEIVE                    |                         | 43293 |   845K|       |  1137   (1)| 00:00:16 |       |       |  Q1,08 |
    PCWP |            |                                                                                                                                            
    |  34 |                       PX SEND BROADCAST            | :TQ10004                | 43293 |   845K|       |  1137   (1)| 00:00:16 |       |       |        |
    S->P | BROADCAST  |                                                                                                                                            
    |  35 |                        TABLE ACCESS BY INDEX ROWID | TP_OUC_HIER_CDIM        | 43293 |   845K|       |  1137   (1)| 00:00:16 |       |       |        |
         |            |                                                                                                                                            
    |  36 |                         BITMAP CONVERSION TO ROWIDS|                         |       |       |       |            |          |       |       |        |
         |            |                                                                                                                                            
    |* 37 |                          BITMAP INDEX SINGLE VALUE | TP_OUC_HI_IDX2          |       |       |       |            |          |       |       |        |
         |            |                                                                                                                                            
    |* 38 |                     HASH JOIN                      |                         |   627K|    55M|       |   581   (2)| 00:00:09 |       |       |  Q1,08 |
    {code}
    Edited by: user1128836 on Apr 26, 2012 3:39 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  

  • [8i] Need help with hierarchical (connect by) query

    First, I'm working in 8i.
    My problem is, I keep getting the error ORA-01437: cannot have join with CONNECT BY.
    And, the reason I get that error is because one of the criteria I need to use to prune some branches with is in another table... Is there anyway to work around this? I tried an in-line view (but got the same error). I thought about using the connect by query as an in-line view and filtering off what I don't want that way, but I'm not sure how to filter out an entire branch...
    Here is some simplified sample data:
    CREATE TABLE     bom_test
    (     parent          CHAR(25)
    ,     component     CHAR(25)
    ,     qty_per          NUMBER(9,5)
    INSERT INTO     bom_test
    VALUES     ('ABC-1','101-34',10);
    INSERT INTO     bom_test
    VALUES     ('ABC-1','A-109-347',2);
    INSERT INTO     bom_test
    VALUES     ('ABC-1','ABC-100G',1);
    INSERT INTO     bom_test
    VALUES     ('ABC-1','1A247G01',2);
    INSERT INTO     bom_test
    VALUES     ('ABC-100G','70052',18);
    INSERT INTO     bom_test
    VALUES     ('ABC-100G','M9532-278',5);
    INSERT INTO     bom_test
    VALUES     ('1A247G01','X525-101',2);
    INSERT INTO     bom_test
    VALUES     ('1A247G01','1062-324',2);
    INSERT INTO     bom_test
    VALUES     ('X525-101','R245-9010',2);
    CREATE TABLE     part_test
    (     part_nbr     CHAR(25)
    ,     part_type     CHAR(1)
    INSERT INTO     part_test
    VALUES     ('ABC-1','M');
    INSERT INTO     part_test
    VALUES     ('101-34','P');
    INSERT INTO     part_test
    VALUES     ('A-109-347','P');
    INSERT INTO     part_test
    VALUES     ('ABC-100G','M');
    INSERT INTO     part_test
    VALUES     ('1A247G01','P');
    INSERT INTO     part_test
    VALUES     ('70052','P');
    INSERT INTO     part_test
    VALUES     ('M9532-278','P');
    INSERT INTO     part_test
    VALUES     ('X525-101','M');
    INSERT INTO     part_test
    VALUES     ('1062-324','P');
    INSERT INTO     part_test
    VALUES     ('R245-9010','P');This is the basic query (with no pruning of branches):
    SELECT     LEVEL
    ,     b.component
    ,     b.parent
    ,     b.qty_per
    FROM     bom_test b
    START WITH          b.parent     = 'ABC-1'
    CONNECT BY PRIOR     b.component     = b.parentThe query above gives the results:
          LEVEL COMPONENT                 PARENT                        QTY_PER
          1.000 101-34                    ABC-1                          10.000
          1.000 A-109-347                 ABC-1                           2.000
          1.000 ABC-100G                  ABC-1                           1.000
          2.000 70052                     ABC-100G                       18.000
          2.000 M9532-278                 ABC-100G                        5.000
          1.000 1A247G01                  ABC-1                           2.000
          2.000 X525-101                  1A247G01                        2.000
          3.000 R245-9010                 X525-101                        2.000
          2.000 1062-324                  1A247G01                        2.000
    9 rows selected....but I only want the branches (children, grandchildren, etc.) of part type 'M'.
    e.g.:
          LEVEL COMPONENT                 PARENT                        QTY_PER
          1.000 101-34                    ABC-1                          10.000
          1.000 A-109-347                 ABC-1                           2.000
          1.000 ABC-100G                  ABC-1                           1.000
          2.000 70052                     ABC-100G                       18.000
          2.000 M9532-278                 ABC-100G                        5.000
          1.000 1A247G01                  ABC-1                           2.000Any suggestions?

    Hi,
    user11033437 wrote:
    First, I'm working in 8i.
    My problem is, I keep getting the error ORA-01437: cannot have join with CONNECT BY.
    And, the reason I get that error is because one of the criteria I need to use to prune some branches with is in another table... Is there anyway to work around this? I tried an in-line view (but got the same error). Post your query. It's very hard to tell what you're doing wrong if we don't know what you're doing.
    ...but I only want the branches (children, grandchildren, etc.) of part type 'M'.
    e.g.:
    LEVEL COMPONENT                 PARENT                        QTY_PER
    1.000 101-34                    ABC-1                          10.000
    1.000 A-109-347                 ABC-1                           2.000
    1.000 ABC-100G                  ABC-1                           1.000
    2.000 70052                     ABC-100G                       18.000
    2.000 M9532-278                 ABC-100G                        5.000
    1.000 1A247G01                  ABC-1                           2.000
    You mean you want don't want the descendants (children, grandchildren, etc.) of any component whose part_type is not 'M'.
    The part_type of the component itself doesn't matter: component '101-34' is included, even though its part_type is 'P', and component 'X525-101' is excluded, even though its part_type is 'M'.
    >
    Any suggestions?Sorry, I don't have an Oracle 8.1 database at hand now. All three of the queries below get the correct results in Oracle 10.2, and I don't believe they do anything that isn't allowed in 8.1.
    You can't do a join and CONNECT BY in the same query on Oracle 8.1.
    I believe you can do one first, then the other, using in-line views. The frist two queries do the join first.
    --     Query 1: Join First
    SELECT     LEVEL
    ,     component
    ,     parent
    ,     qty_per
    FROM     (     -- Begin in-line view to join bom_test and part_test
              SELECT     b.component
              ,     b.parent
              ,     b.qty_per
              ,     p.part_type     AS parent_type
              FROM     bom_test     b
              ,     part_test     p
              WHERE     p.part_nbr     = b.parent
         )     -- End in-line view to join bom_test and part_test
    START WITH     parent     = 'ABC-1'
    CONNECT BY     parent          = PRIOR component
         AND     parent_type     = 'M'
    ;Query 2 is very much like Query 1, but it does more filtering in the sub-query, returning only rows hose part_type or whose parent's part_type is 'M". Your desired result set will be a tree taken entirely from this set. Query 2 may be faster, because the sub-query is more selective, but then again, it may be slower because it has to do an extra join.
    {code}
    -- Query 2: Join first, prune in sub-query
    SELECT     LEVEL
    ,     component
    ,     parent
    ,     qty_per
    FROM     (     -- Begin in-line view to join bom_test and part_test
              SELECT     b.component
              ,     b.parent
              ,     b.qty_per
              ,     p.part_type     AS parent_type
              FROM     bom_test     b
              ,     part_test     p
              ,     part_test     c
              WHERE     p.part_nbr     = b.parent
              AND     c.part_nbr     = b.component
              AND     'M'          IN (c.part_type, p.part_type)
         )     -- End in-line view to join bom_test and part_test
    START WITH     parent     = 'ABC-1'
    CONNECT BY     parent          = PRIOR component
         AND     parent_type     = 'M'
    {code}
    Query 3, below, takes a completely different approach. It does the CONNECT BY query first, then does a join to see what the parent's part_type is. We can easily cut out all the nodes whose parent's part_type is not 'M', but that will leave components like 'R245-9010' whose parent has part_type 'M', but should be excluded because its parent is excluded. To get the correct results, we can do another CONNECT BY query, using the same START WITH and CONNECT BY conditions, but this time only looking at the pruhed results of the first CONNECT BY query.
    {code}
    --     Query 3: CONNECT BY, Prune, CONNECT BY again
    SELECT     LEVEL
    ,     component
    ,     parent
    ,     qty_per
    FROM     (     -- Begin in-line view of 'M' parts in hierarchy
              SELECT     h.component
              ,     h.parent
              ,     h.qty_per
              FROM     (     -- Begin in-line view h, hierarchy from bom_test
                        SELECT     component
                        ,     parent
                        ,     qty_per
                        FROM     bom_test
                        START WITH     parent     = 'ABC-1'
                        CONNECT BY     parent     = PRIOR component
                   ) h     -- End in-line view h, hierarchy from bom_test
              ,     part_test     p
              WHERE     p.part_nbr     = h.parent
              AND     p.part_type     = 'M'
         )     -- End in-line view of 'M' parts in hierarchy
    START WITH     parent     = 'ABC-1'
    CONNECT BY     parent     = PRIOR component
    {code}
    I suspect that Query 3 will be slower than the others, but if the CONNECT BY query is extremely selective, it may be better.
    It would be interesting to see your findings using the full tables. Please post your observations and the explain plan output.
    As usual, your message is a model of completeness and clarity:
    <ul>
    <li>good sample data,
    <li> posted in a way people can use it,
    <li>clear results,
    <li> good explanation
    <li> nciely formatted code
    </ul>
    Keep up the good work!

  • Planning query throwing error

    Hi
    I have created an aggregation level on a multiprovider that contains data from plan and actuals cube.
    When I created a query on aggregation level it works for the given selection, but when i change one of the key figures properties to 'plannning' mode, the query throws an error saying "Syntax error in program CL_RSR_RRK0_KEYFIGURE=========CP " showing some exception has occurred.
    We are on version 7, SP 13.
    Appreciate any help regarding the same.

    OK. One last thing to check; you said you restricted the data in the query by 0infoprov right? You did that with a rest key fig or made local selections?
    I sugest to have a rest key fig with your key fig and 0infopro and set this rest key fig as planning enabled.
    Ravi Thothadri

Maybe you are looking for