Joining within a collection/Selecting a large set of values

Hello everyone,
I'm testing DocumentDB for a new project, and at the moment I'm not sure if and how I can realize my use case. Lets say I have the following in my collection:
About 500000 employee records:
{  "Id": "1", "Type": "Employee", "Name": "testname", "Lastname": "testlastname" } // and much more
and I have team records
{  "Id": "45612354", "Type": "Team", "Teamname": "GreatTeam", "members": [ 1, 55049, 29969, 23492 ] }
There can be up to 50000 Teams with up to 10000 members each.
As Input, I've a specific team Id and I want to return all employee records of the team. In an RDBMS I would create two tables, query the team id and look for all member IDs in the employee table. How would I do this here?
I could let each member have a personal team list and look for the id, but then every query would need to look in the list of every employee -> potentially check millions of ids.
Is the join operator applicable in this case? Can I do it efficiently with an UDF like this one:
http://stackoverflow.com/questions/25637142/select-with-multiple-values-in-documentdb ? Is this a case where I should not use DocumentDB?
Thanks for your help.
Sebastian

not sure I want to be an employee that belongs to 1,000 teams, but ok :)
ok, so then you have a classic many:many relationship.
except in your case you really are talking about many.
have you read http://azure.microsoft.com/en-gb/documentation/articles/documentdb-modeling-data/ ?
in here I talk about how to model many:many relationships.
you basically have 2 options;
1. use mapping documents as you would have used a mapping table.
2. embed the relationship information on to the employee record and on to the team record.
because you can have up to 10,000 entries in an array you might start running in to some issues in terms of doc size if you embedded the data. depends on how many other properties an employee has.
try the following;
"employee": 1,
"teams": [
{"team": "A"},
{"team": "B"},
{"team": "C"},
{"team": "D"},
{"team": "E"}
"team" : "A",
"employees" : [
{"employee": 1},
{"employee": 2},
{"employee": 3},
{"employee": 4},
{"employee": 5}
that way you can search for employees given a team, and for teams given an employee.
however, like I said, I am not sure what this is going to do simply because you have very very very large arrays.
you will need to try it and see.

Similar Messages

  • How to hide PNP selection windows and set default values for PNP.

    Hi expert,
         I am using HR logical database PNP, but I don't want to display selection windoes for running program on PNP, whereas I want to set default value for some selection items in the program. could you please tell me how to get those two targets?
    Many Thanks,

    Hi
    You have mentioned 2 things.
    1. Don't want selection windows for running program for PNP - this can be achieved using the HR Report category - You can get more details on HR Report Category on
    HR Report Category
    2.  I want to set default value for some selection items - This you need to achieve in initialization event of your program.
    How you can get this can be explained by INITIALIZATION (SAP Library - ABAP Programming (BC-ABA))
    Thanks,
    Sreeram

  • Problem while having a large set of data to work on!

    Hi,
    I am facing great problem with processing large set of data. I have a requirement in which i'm supposed to generate a report.
    I have a table and a MView, which i have joined to reduce the number of records to process. The MView holds 200,00,000 records while the table 18,00,000. Based on join conditions and where clause i'm able to break down the useful data to approx 4,50,000 and i'm getting 8 of my report columns from this join. I'm dumping these records into the table from where i'll be generating the report by spooling.
    Below is the block which takes 12mins to insert into the report table MY_ACCOUNT_PHOTON_DUMP:
    begin
    dbms_output.put_line(to_char(sysdate,'hh24:mi:ss'));
    insert into MY_ACCOUNT_PHOTON_DUMP --- Report table
    (SUBSCR_NO, ACCOUNT_NO, AREA_CODE, DEL_NO, CIRCLE, REGISTRATION_DT, EMAIL_ID, ALT_CNTCT_NO)
    select crm.SUBSCR_NO, crm.ACCOUNT_NO, crm.AREA_CODE, crm.DEL_NO, crm.CIRCLE_ID,
    aa.CREATED_DATE, aa.EMAIL_ID, aa.ALTERNATE_CONTACT
    from MV_CRM_SUBS_DTLS crm, --- MView
    (select /*+ ALL_ROWS */ A.ALTERNATE_CONTACT, A.CREATED_DATE, A.EMAIL_ID, B.SUBSCR_NO
    from MCCI_PROFILE_DTLS a, MCCI_PROFILE_SUBSCR_DTLS b
    where A.PROFILE_ID = B.PROFILE_ID
    and B.ACE_STATUS = 'N'
    ) aa --- Join of two tables giviing me 18,00,000 recs
    where crm.SUBSCR_NO = aa.SUBSCR_NO
    and crm.SRVC_TYPE_ID = '125'
    and crm.END_DT IS NULL;
    INTERNET_METER_TABLE_PROC_1('MCCIPRD','MY_ACCOUNT_PHOTON_DUMP'); --- calling procedure to analyze the report table
    COMMIT;
    dbms_output.put_line(to_char(sysdate,'hh24:mi:ss'));
    end; --- 12 min 04 secFor the rest of the 13 columns required i am running a block which has a FOR UPDATE cursor on the report table:
    declare
    cursor cur is
    select SUBSCR_NO, ACCOUNT_NO, AREA_CODE, DEL_NO,
    CIRCLE, REGISTRATION_DT, EMAIL_ID, ALT_CNTCT_NO
    from MCCIPRD.MY_ACCOUNT_PHOTON_DUMP --where ACCOUNT_NO = 901237064
    for update of
    MRKT_SEGMNT, AON, ONLINE_PAY, PAID_AMNT, E_BILL, ECS, BILLED_AMNT,
    SRVC_TAX, BILL_PLAN, USAGE_IN_MB, USAGE_IN_MIN, NO_OF_LOGIN, PHOTON_TYPE;
    v_aon VARCHAR2(10) := NULL;
    v_online_pay VARCHAR2(10) := NULL;
    v_ebill VARCHAR2(10) := NULL;
    v_mkt_sgmnt VARCHAR2(50) := NULL;
    v_phtn_type VARCHAR2(50) := NULL;
    v_login NUMBER(10) := 0;
    v_paid_amnt VARCHAR2(50) := NULL;
    v_ecs VARCHAR2(10) := NULL;
    v_bill_plan VARCHAR2(100):= NULL;
    v_billed_amnt VARCHAR2(10) := NULL;
    v_srvc_tx_amnt VARCHAR2(10) := NULL;
    v_usg_mb NUMBER(10) := NULL;
    v_usg_min NUMBER(10) := NULL;
    begin
    dbms_output.put_line(to_char(sysdate,'hh24:mi:ss'));
    for rec in cur loop
    begin
    select apps.TTL_GET_DEL_AON@MCCI_TO_PRD591(rec.ACCOUNT_NO, rec.DEL_NO, rec.CIRCLE)
    into v_aon from dual;
    exception
    when others then
    v_aon := 'NA';
    end;
    SELECT DECODE(COUNT(*),0,'NO','YES') into v_online_pay
    FROM TTL_DESCRIPTIONS@MCCI_TO_PRD591
    WHERE DESCRIPTION_CODE IN(SELECT DESCRIPTION_CODE FROM TTL_BMF_TRANS_DESCR@MCCI_TO_PRD591
    WHERE BMF_TRANS_TYPE
    IN (SELECT BMF_TRANS_TYPE FROM
    TTL_BMF@MCCI_TO_PRD591 WHERE ACCOUNT_NO = rec.ACCOUNT_NO
    AND POST_DATE BETWEEN
    TO_DATE('01-'||TO_CHAR(SYSDATE,'MM-YYYY'),'DD-MM-YYYY') AND SYSDATE
    AND DESCRIPTION_TEXT IN (select DESCRIPTION from fnd_lookup_values@MCCI_TO_PRD591 where
    LOOKUP_TYPE='TTL_ONLINE_PAYMENT');
    SELECT decode(count( *),0,'NO','YES') into v_ebill
    FROM TTL_CUST_ADD_DTLS@MCCI_TO_PRD591
    WHERE CUST_ACCT_NBR = rec.ACCOUNT_NO
    AND UPPER(CUSTOMER_PREF_MODE) ='EMAIL';
    begin
    select ACC_SUB_CAT_DESC into v_mkt_sgmnt
    from ttl_cust_dtls@MCCI_TO_PRD591 a, TTL_ACCOUNT_CATEGORIES@MCCI_TO_PRD591 b
    where a.CUST_ACCT_NBR = rec.ACCOUNT_NO
    and a.market_code = b.ACC_SUB_CAT;
    exception
    when others then
    v_mkt_sgmnt := 'NA';
    end;
    begin
    select nvl(sum(TRANS_AMOUNT),0) into v_paid_amnt
    from ttl_bmf@MCCI_TO_PRD591
    where account_no = rec.ACCOUNT_NO
    AND POST_DATE
    BETWEEN TO_DATE('01-'||TO_CHAR(SYSDATE,'MM-YYYY'),'DD-MM-YYYY')
    AND SYSDATE;
    exception
    when others then
    v_paid_amnt := 'NA';
    end;
    SELECT decode(count(1),0,'NO','YES') into v_ecs
    from ts.Billdesk_Registration_MV@MCCI_TO_PRD591 where ACCOUNT_NO = rec.ACCOUNT_NO
    and UPPER(REGISTRATION_TYPE ) = 'ECS';
    SELECT decode(COUNT(*),0,'PHOTON WHIZ','PHOTON PLUS') into v_phtn_type
    FROM ts.ttl_cust_ord_prdt_dtls@MCCI_TO_PRD591 A, ttl_product_mstr@MCCI_TO_PRD591 b
    WHERE A.SUBSCRIBER_NBR = rec.SUBSCR_NO
    and (A.prdt_disconnection_date IS NULL OR A.prdt_disconnection_date > SYSDATE )
    AND A.prdt_disc_flag = 'N'
    AND A.prdt_nbr = b.product_number
    AND A.prdt_type_id = b.prouduct_type_id
    AND b.first_level LIKE 'Feature%'
    AND UPPER (b.product_desc) LIKE '%HSIA%';
    SELECT count(1) into v_login
    FROM MCCIPRD.MYACCOUNT_SESSION_INFO a
    WHERE (A.DEL_NO = rec.DEL_NO or A.DEL_NO = ltrim(rec.AREA_CODE,'0')||rec.DEL_NO)
    AND to_char(A.LOGIN_TIME,'Mon-YYYY') = to_char(sysdate-5,'Mon-YYYY');
    begin
    select PACKAGE_NAME, BILLED_AMOUNT, SERVICE_TAX_AMOUNT, USAGE_IN_MB, USAGE_IN_MIN
    into v_bill_plan, v_billed_amnt, v_srvc_tx_amnt, v_usg_mb, v_usg_min from
    (select rank() over(order by STATEMENT_DATE desc) rk,
    PACKAGE_NAME, USAGE_IN_MB, USAGE_IN_MIN
    nvl(BILLED_AMOUNT,'0') BILLED_AMOUNT, NVL(SRVC_TAX_AMNT,'0') SERVICE_TAX_AMOUNT
    from MCCIPRD.MCCI_IM_BILLED_DATA
    where (DEL_NUM = rec.DEL_NO or DEL_NUM = ltrim(rec.AREA_CODE,'0')||rec.DEL_NO)
    and STATEMENT_DATE like '%'||to_char(SYSDATE,'Mon-YY')||'%')
    where rk = 1;
    exception
    when others then
    v_bill_plan := 'NA';
    v_billed_amnt := '0';
    v_srvc_tx_amnt := '0';
    v_usg_mb := 0;
    v_usg_min := 0;
    end;
    -- UPDATE THE DUMP TABLE --
    update MCCIPRD.MY_ACCOUNT_PHOTON_DUMP
    set MRKT_SEGMNT = v_mkt_sgmnt, AON = v_aon, ONLINE_PAY = v_online_pay, PAID_AMNT = v_paid_amnt,
    E_BILL = v_ebill, ECS = v_ecs, BILLED_AMNT = v_billed_amnt, SRVC_TAX = v_srvc_tx_amnt,
    BILL_PLAN = v_bill_plan, USAGE_IN_MB = v_usg_mb, USAGE_IN_MIN = v_usg_min, NO_OF_LOGIN = v_login,
    PHOTON_TYPE = v_phtn_type
    where current of cur;
    end loop;
    COMMIT;
    dbms_output.put_line(to_char(sysdate,'hh24:mi:ss'));
    exception when others then
    dbms_output.put_line(SQLCODE||'::'||SQLERRM);
    end;The report takes >6hrs. I know that most of the SELECT queries have ACCOUNT_NO as WHERE clause and can be joined, but when i joining few of these blocks with the initial INSERT query it was no better.
    The individual queries within the cursor loop dont take more then 0.3 sec to execute.
    I'm using the FOR UPDATE as i know that the report table is being used solely for this purpose.
    Can somebody plz help me with this, i'm in desperate need of good advice here.
    Thanks!!
    Edited by: user11089213 on Aug 30, 2011 12:01 AM

    Hi,
    Below is the explain plan for the original query:
    select /*+ ALL_ROWS */  crm.SUBSCR_NO, crm.ACCOUNT_NO, ltrim(crm.AREA_CODE,'0'), crm.DEL_NO, >crm.CIRCLE_ID
    from MV_CRM_SUBS_DTLS crm,
            (select /*+ ALL_ROWS */  A.ALTERNATE_CONTACT, A.CREATED_DATE, A.EMAIL_ID, B.SUBSCR_NO
            from MCCIPRD.MCCI_PROFILE_DTLS a, MCCIPRD.MCCI_PROFILE_SUBSCR_DTLS b
            where A.PROFILE_ID = B.PROFILE_ID
            and   B.ACE_STATUS = 'N'
            ) aa
    where crm.SUBSCR_NO    = aa.SUBSCR_NO
    and   crm.SRVC_TYPE_ID = '125'
    and   crm.END_DT IS NULL
    | Id  | Operation              | Name                     | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT       |                          |  1481K|   100M|       |   245K  (5)| 00:49:09 |
    |*  1 |  HASH JOIN             |                          |  1481K|   100M|    46M|   245K  (5)| 00:49:09 |
    |*  2 |   HASH JOIN            |                          |  1480K|    29M|    38M| 13884   (9)| 00:02:47 |
    |*  3 |    TABLE ACCESS FULL   | MCCI_PROFILE_SUBSCR_DTLS |  1480K|    21M|       |  3383  (13)| 00:00:41 |
    |   4 |    INDEX FAST FULL SCAN| SYS_C002680              |  2513K|    14M|       |  6024   (5)| 00:01:13 |
    |*  5 |   MAT_VIEW ACCESS FULL | MV_CRM_SUBS_DTLS_08AUG   |  1740K|    82M|       |   224K  (5)| 00:44:49 |
    Predicate Information (identified by operation id):
       1 - access("CRM"."SUBSCR_NO"="B"."SUBSCR_NO")
       2 - access("A"."PROFILE_ID"="B"."PROFILE_ID")
       3 - filter("B"."ACE_STATUS"='N')
       5 - filter("CRM"."END_DT" IS NULL AND "CRM"."SRVC_TYPE_ID"='125')Whereas for the modified MView query, the plane remains the same:
    select /*+ ALL_ROWS */ crm.SUBSCR_NO, crm.ACCOUNT_NO, ltrim(crm.AREA_CODE,'0'), crm.DEL_NO, >crm.CIRCLE_ID
    from    (select * from MV_CRM_SUBS_DTLS
             where SRVC_TYPE_ID = '125'
             and   END_DT IS NULL) crm,
            (select /*+ ALL_ROWS */  A.ALTERNATE_CONTACT, A.CREATED_DATE, A.EMAIL_ID, B.SUBSCR_NO
            from MCCIPRD.MCCI_PROFILE_DTLS a, MCCIPRD.MCCI_PROFILE_SUBSCR_DTLS b
            where A.PROFILE_ID = B.PROFILE_ID
            and   B.ACE_STATUS = 'N'
            ) aa
    where crm.SUBSCR_NO  = aa.SUBSCR_NO
    | Id  | Operation              | Name                     | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT       |                          |  1481K|   100M|       |   245K  (5)| 00:49:09 |
    |*  1 |  HASH JOIN             |                          |  1481K|   100M|    46M|   245K  (5)| 00:49:09 |
    |*  2 |   HASH JOIN            |                          |  1480K|    29M|    38M| 13884   (9)| 00:02:47 |
    |*  3 |    TABLE ACCESS FULL   | MCCI_PROFILE_SUBSCR_DTLS |  1480K|    21M|       |  3383  (13)| 00:00:41 |
    |   4 |    INDEX FAST FULL SCAN| SYS_C002680              |  2513K|    14M|       |  6024   (5)| 00:01:13 |
    |*  5 |   MAT_VIEW ACCESS FULL | MV_CRM_SUBS_DTLS_08AUG   |  1740K|    82M|       |   224K  (5)| 00:44:49 |
    Predicate Information (identified by operation id):
       1 - access("CRM"."SUBSCR_NO"="B"."SUBSCR_NO")
       2 - access("A"."PROFILE_ID"="B"."PROFILE_ID")
       3 - filter("B"."ACE_STATUS"='N')
       5 - filter("CRM"."END_DT" IS NULL AND "CRM"."SRVC_TYPE_ID"='125')Also took your advice and tried to merge all the queries into single INSERT SQL, will be posting the results shortly.
    Edited by: BluShadow on 30-Aug-2011 10:21
    added {noformat}{noformat} tags.  Please read {message:id=9360002} to learn to do this yourself                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Order by the names in hashMaps which are contained within a collection

    Hi All,
    Is there a way to order by the names in hashMaps which are contained within a collection?
    Collection-->hmp1(nrPerson1, nameB);
    hmp2(nrPerson2, nameC);
    hmp3(nrPerson3, nameA);
    Now what i need to display is (nrPerson3,nameA), (nrPerson1,nameB), (nrPerson2, nameC)...
    Any suggestion will be greatly appreciated!
    Shuaibing

    I just set the TreeSet with the values as you suggested, but the results seems to the same as usual, Can you check the following codes? I think I need have to give a initial parameter for the TreeSet constructor, but I do not know how to write the Comparator.
    public String getIntermediaryCO(){
    Contact contact=new Contact();
              Collection colnNrContactsInterCo=contact.getAllIntermediaryCompany();
              //test
              TreeSet treeSet=new TreeSet();
              HashMap hmpForOrder=new HashMap();
              if(colnNrContactsInterCo!=null && !colnNrContactsInterCo.isEmpty()){
                   Iterator iter=colnNrContactsInterCo.iterator();
                   while(iter.hasNext()){
                           HashMap hmp=(HashMap)iter.next();
                           hmpForOrder.put(hmp.get("name"),hmp.get("nrContact"));
              treeSet.add(hmpForOrder.keySet());
              //print the ordered, unique set
            Iterator iterator = treeSet.iterator();
            while( iterator.hasNext() ) {           
                System.out.println( "the list of sorted intermediary companies' names="+iterator.next() );
              //test
    public Collection getAllIntermediaryCompany(){
               Collection colnContacts=new ArrayList();
               ContactCov contactCov=new ContactCov();
             try{
                    String sql="SELECT DISTINCT NR_CONTACT from CONTACT_TYPE where CD_CONTACT_TYPE=5";
                    jdbc = new JDBCConnection("1");
                    rs=jdbc.executeQuery(sql);
                    if(rs!=null){
                         while(rs.next()){
                                   String nrContact=rs.getString("NR_CONTACT");
                                   VOContact voContact=contactCov.getContactByNrContact(nrContact);
                                   if(voContact!=null){
                                        HashMap hmp=new HashMap();
                                        hmp.put("name",voContact.getName());
                                        hmp.put("nrContact",nrContact);
                                        colnContacts.add(hmp);
                  }catch(Exception e){
                      logger.error(e.toString());
                   }finally{
                       try{
                            if(rs!=null)rs.close();
                            if(jdbc!=null)jdbc.close();
                       }catch(Exception e){}
               return colnContacts;     
            }     

  • Is it possible to give each page within one pdf document a specific set of print settings?

    I have a complex document (catalogue) that requires printing. There are several different printer settings required and each one is specific to each page within the document. For instance pg 1 is single sided in colour, page 2-3 is duplexed in b&w, page 3-8 is duplexed in colour, etc.... Is it possible to give each page within the pdf document a given set of print settings and then print the entire document as a whole?

    Hi jennyskop
    I assume that is not feasible ...You need to give the print command again and select the respective pages and their settings !

  • Moving images within a collection?

    Having just watched Julieanne K's tutorial re making a Blurb book, she began with her images in a story order.  How does one move images within a collection to an order different from how they were uploaded or taken?  I guess it is simple, but I cannot seem to do it.

    Actually, you don't have to select User Order.  In Library mode, view the grid and simply drag and drop the thumbnails into the order you want, and that prompt will automatically change to User Order from whatever order it was in before. 
    John

  • SELECT records larger than date specified in sub query

    Dear All
    Thank you for your attention.
    I would like to select records larger than date specified in sub query
    query should be something like the following
    SELECT my_order_number, my_date, my_task
    FROM MYTB
    WHERE my_order_number IN order_no AND my_date > date (SELECT order_no, date FROM MySubQueryResult)
     (it is incorrect)
    Sub query result:
    order_no | date
    A1    | 2014-12-21 09:06:00
    A2    | 2014-12-20 09:07:00
    A3    | 2014-12-20 08:53:00
    A4    | 2014-12-20 08:57:00
    MYTB:
    my_order_number | my_task | my_date
    A1  |  T1  |  2014-12-21 09:06:00
    A1  |  T2  |  2014-12-22 10:01:00
    A2  |  T1  |  2014-12-20 09:07:00
    A3  |  T2  |  2014-12-20 08:53:00
    A3  |  T4  |  2014-12-21 09:30:00
    A3  |  T8  |  2014-12-23 20:32:00
    A4  |  T6  |  2014-12-20 08:57:00
    expected result:
    my_order_number |  my_task | my_date
    A1  |  T2  |  2014-12-22 10:01:00
    A3  |  T4  |  2014-12-21 09:30:00
    A3  |  T8  |  2014-12-23 20:32:00
    Any ideas?  Thanks.
    swivan

    Hi,
    try this
    SELECT my_order_number, my_date, my_task
    FROM MYTB
    WHERE my_order_number IN (SELECT order_no FROM MySubQueryResult)
    AND my_date > (SELECT date FROM MySubQueryResult)
    Alternatively, you can also make use of joins to achieve the same.
    Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
    Praveen Dsa | MCITP - Database Administrator 2008 |
    My Blog | My Page
    Dear Praveen Dsa
    Thanks for your reply, but order_no and date are paired and related, cannot separate.
    each order have its own date, so it is not working
    Best Regards
    swivan

  • Illegal cross join within the same dimension caused by incorrect subject ar

    hi!
    Imagine the following BMM:
    There is one Logical Dimension Table "Service Account" with the following LTS:
    - LTS "D_SERVICE"
    - LTS "D_SERVICE_CLASS"
    - LTS "D_SERVICE_STATUS"
    This Logical Tabe "Service Account" joins (One-to-many) with several Fact Tables (other Logical Tables).
    In the Physical Layer the joins for the "Service Account" LTS are:
    - One-to-many between D_SERVICE_CLASS and D_SERVICE
    - One-to-many between D_SERVICE_STATUS and D_SERVICE
    The problem is that when I build a report in Answers using only the following columns of the Logical Table "Service Account":
    - Service Class Desc (which exists in the Logical Table "Service Account" and in the Physical Table D_SERVICE_CLASS)
    - Service Status Desc (which exists in the Logical Table "Service Account" and in the Physical Tabl D_SERVICE_STATUS)
    - MSISDN (which existis in the Logical Table "Service Account" and in the Phsyical Table D_SERVICE)
    the following error appears:
    Estado: HY000. Código: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 14065] Illegal cross join within the same dimension caused by incorrect subject area setup: [ (select * from prd.D_SERVICE where SOURCE_SYS in ('ARBOR','PPB') and DW_SERV_ST_ID in (100000003,100000009)) as T1836, D_SERVICE_CLASS T1916] with [ D_SERVICE_STATUS T1948] (HY000)
    SQL emitido: SELECT "SERVICE ACCOUNT"."TLC MSISDN9" saw_0, "SERVICE ACCOUNT"."IWS Service Class Desc" saw_1, "SERVICE ACCOUNT"."TLC Service Status Desc" saw_2 FROM "VFPT - Upgrade Siebel" WHERE "SERVICE ACCOUNT"."TLC MSISDN9" = '917330340' ORDER BY saw_0, saw_1, saw_2
    Help, please!
    Thanks.

    Physically, only D_SERVICE is joined to the facts. Then D_SERVICE_CLASS is joined to D_SERVICE (one-to-many) and D_SERVICE_STATUS is joined also to D_SERVICE (one-to-many).
    In the BMM, there is only one Logical Dimension Table for those 3 physical tables. This Logical Dimension Table is called "Service Account" and has 3 LTS: D_SERVICE, D_SERVICE_CLASS, D_SERVICE_STATUS. The Logical Dimension Table has several logical columns that are associated to those 3 LTS: SERVICE_KEY, SERVICE_CLASS_KEY, SERVICE_STATUS_KEY, SERVICE_MSISDN, SERVICE_CLASS_DESC, SERVICE_STATUS_DESC.
    The Logical Dimension Table "Service Account" is then joined to a fact table (one-to-many).
    I didn't understand the suggestion about the 3 LTS... Aren't we doing that already? Can you explain it better, please?
    thanks.

  • Different Order Types within a Collective Order

    Dear PP Gurus,
    I have a requirement for having different order types with in a collective order. For example, in a BOM of 3 levels, the order type for each assembly should be different say ZPP1, ZPP2 and ZPP3.
    For this, I have maintained separate production scheduling profiles in each of these assemblies with the respective order types. Also, I have maintained MRP groups separately for each of these materials. Further, in Plant Parameters, no default order type is assigned.
    However, when I create the order, the system creates all orders with order type ZPP1 which is for the header material.
    As per SAP help, this is possible but I am not able to create collective order with different order types.
    Please suggest any SAP Note or configuration changes which I have missed out.
    Thanks!
    With Regards,
    Nitin

    Dear Sabine,
    Thanks for your reply.
    However, as per SAP help, this is possible. Please refer to the link http://help.sap.com/saphelp_470/helpdata/en/ee/b6532cae8011d19e97080009b0db33/content.htm
    In this link, under Pre-reuisites section, in Point 2 it is mentioned
    "This indicator is transferred into the order header (master data) of the orders. If there are differing order types within the collective order, the setting of the indicator of the order type of the leading order takes precedence. This indicator is transferred to all lower-level orders and overrides their original indicators."
    The above line implies that different order types are possible with in a collective order.
    Please suggest some way out.
    Thanks!
    With Regards,
    Nitin

  • Problems sorting larger sets of XMLType columns/tables

    Hi,
    Here's something I tried to wrap my head around:
    I'm using Oracle 11g r1 for Windows Server 2003.
    I've imported a fairly large set of XML files into a temporary XMLType table. Now
    I want to sort the contents of the table and put them into another table which
    uses a sequence to get primary keys (would be a longer story to explain, basically
    sorting by this non-XML primary key is super-fast as opposed to everything else
    I've tried, plus I need something unique):
    INSERT INTO realtable SELECT 0, object_value
    FROM tmptable ORDER BY extractValue(object_value, '/some/*/field');It works fine for a very small number of rows but when I tried with about 30000 rows,
    still not too much, two kinds of things can happen. Either, Oracle gobbles up a huge amount
    of memory (>1,5GB) until the statement breaks:
    ORA-04030: Zu wenig Prozessspeicher fⁿr Versuch 33292 Bytes zuzuweisen
    (callheap,kllcqgf:kllsltba)Or I get something like this:
    ORA-00600: Interner Fehlercode, Argumente: [kqludp2], [0x1F31EC94], [0], [], [], [], [], []I haven't wasted too much time looking into this. I tried storage options clob and binary xml
    for tmptable. Clob seems to induce the latter problem and binary xml the former but I haven't
    made further experiments.
    I can create a workaround from outside Oracle I think, so it's not serious however I'd would
    be interesting to know what happened or if there is a better way to do this.
    Thanks!

    Unfortunately, the problems are not reproducible in a meaningful way. All I can say is that once a statement will result in a kqludp2, it will always fail with the exactly same error message until I reinstall the database from scratch. On the other
    side, when I found a configuration that works, I could delete and rebuild/refill a table multiple times without the thing ever breaking.
    As the most recent example, after the latest trouble I deleted the database and changed my DDL scripts to the last configuration I wanted to try and broke the last time (several tables with two normal columns and an XMLType column each), everything worked like a breeze.
    I can file a TAR when I get a support ID from my employer, however I installed the database on a virtual machine (I should have mentioned that earlier) and Oracle doesn't officially support that configuration from what I know so I'll doubt they'll do anything about it. I've procured a physical computer now and try to reproduce any of the problems when I get to it.

  • [nQSError: 14065] Illegal cross join within the same dimension

    Hey guys,
    I'm stumped. I have two dimension tables that are joined 1:N (there is NOT an M:N relationship between them) and I have them joined in the Physical Layer and the Business Model and Mapping Layer. The two tables are F4101 (the "1") and F4102 (the "N") in the 1:N relationship. F4102 then joins to a fact table, and F4101 joins to NOTHING else. So I don't believe I have a circular condition or a need for a bridge table. Both tables are published to the Presentation Layer for reporting.
    The error occurs in Answers when I want to do something as trivial as display the three primary key columns together from F4101: F4101.col1, F4101.col2, F4101.col3 (all three make up the PK). When I do that, the following error occurs:
    "nQSError: 14065] Illegal cross join within the same dimension caused by incorrect subject area setup: [ F4101 T28761] with [ F4102 T1805] "
    What I can't figure out is WHY the F4102 table is listed in this error. I didn't try to report on it at all. See the logical SQL below from my query:
    "SQL Issued: SELECT "Item Master (F4101)".IMITM saw_0, "Item Master (F4101)".IMLITM saw_1, "Item Master (F4101)".IMAITM saw_2 FROM "Sales Analysis" ORDER BY saw_0, saw_1, saw_2"
    As soon as I take out one of the three PK columns and add in another non-PK column from F4101, it works just fine. And reporting on each of the three PK columns individually works as well in Answers.
    Any ideas? I would greatly appreciate it.
    Thanks.

    Try this;
    1. In the logical layer, create one folder called F4101_F4102.
    2. Map both F4101 and F4102 as logical table sources in that folder.
    3. Join from the folder F4101_F4102 to the fact using a Logical (new complex join) join.
    Chris.

  • Joins between DATA COLLECTIONS and TABLES

    I would like to know if is there any way to create one data collection with a query result, but I must join this data collection with an exist table, I cant use the GLOBAL TEMPORARY TABLE because I cant create a table in the module. I would like to do just what the SQL Server do with the @.

    sql>create type tnumbercollection as table of number;
      2  /
    Type created.
    sql>declare
      2    c  tNumberCollection;
      3  begin 
      4    select employee_no bulk collect
      5      into c
      6      from mrt_user_master
      7     where rownum <= 5;  -- build collection of 5 employee numbers
      8 
      9    for r in (select um.last_name
    10                from user_master um, table(cast(c as tNumberCollection)) t
    11               where um.employee_no = t.column_value) loop  -- join the collection to the table
    12 
    13      dbms_output.put_line( r.last_name);          
    14 
    15    end loop; 
    16  end;
    17  /
    PL/SQL procedure successfully completed.

  • Getting Error : Illegal cross join within the same dimension

    Hi All,
    At database there are 4 tables - XLE_Entity_profiles (A) , XLE_ETB_profiles (B) ,XLE_Registration (C),XLE_Reg_Function(D) .
    Attribute info is as below -
    A.Le_name
    B.LRU_name
    C. Registraton name
    D. Function_code
    I have to model a single dimension which contains the attributes from these tables and dimension should also support queries which contains attributes from this dimension only without selecting any fact.
    For Exp - query is as below -
    Le_name,Le-Registraton name,Le_Function_code,LRU_name,LRU_Registraton name,LRU_Function_code
    To support such query , i created aliases of table XLE_Registration,XLE_Reg_Function.
    Aliases names are - XLE_Registration_LE (E),XLE_Registration_LRU (F),XLE_Reg_Function_LE (G).,XLE_Reg_Function_LRU (H)
    Attributes from aliases are as below -
    XLE_Registration_LE- Le-Registraton name
    XLE_Registration_LRU -LRU_Registraton name
    XLE_Reg_Function_LE - Le_Function_code
    XLE_Reg_Function_LRU - LRU_Function_code
    i have renamed the attributes For LE and LRU.
    The Physical layer diagram is as below
    A < B
    E F
    G H
    [A:B (1:M) , A:E(1:M), E:G(1:M),B:F(1:M),F:H(1:M)]
    At logical layer , i have created a dimension DIM-LE with below logical table sources -
    A ,B,E,F,G,H
    Using the properties of LTS B , i mapped B to A.
    Using the properties of LTS E , i mapped E to A.
    Using the properties of LTS F , i mapped F to B.
    Using the properties of LTS G , i mapped G to E.
    Using the properties of LTS H , i mapped H to F.
    Now when i run the query , i am getting the error -
    Query - Le_name,Le-Registraton name,Le_Function_code,LRU_name,LRU_Registraton name,LRU_Function_code
    +++Administrator:2a0000:2a0004:----2008/11/07 19:39:03
    Query Status: Query Failed: [nQSError: 14065|http://forums.oracle.com/forums/] Illegal cross join within the same dimension caused by incorrect subject area setup: [
    XLE_REGISTRATIONS T1218 On XLE_REGISTRATIONS_LRU.REGISTRATION_ID = XLE_REG_FUNCTIONS_LRU.REGISTRATION_ID,
    XLE_REG_FUNCTIONS T5737,
    XLE_ETB_PROFILES T900 On XLE_ETB_PROFILES.ESTABLISHMENT_ID = XLE_REGISTRATIONS_LRU.SOURCE_ID,
    XLE_ENTITY_PROFILES T836 On XLE_ENTITY_PROFILES.LEGAL_ENTITY_ID = XLE_ETB_PROFILES.LEGAL_ENTITY_ID] with [
    XLE_REGISTRATIONS T1155 On XLE_REGISTRATIONS_LE.REGISTRATION_ID = XLE_REG_FUNCTIONS_LE.REGISTRATION_ID,
    XLE_REG_FUNCTIONS T5703,
    XLE_ENTITY_PROFILES T836 On XLE_ENTITY_PROFILES.LEGAL_ENTITY_ID = XLE_REGISTRATIONS_LE.SOURCE_ID]
    But when i run below query,which resembles the BI Answer query, against the database ,
    select distinct A.NAME as c1,
    B.REGISTERED_NAME as c2,
    E.Function_code as c5,
    C.NAME as c3,
    D.REGISTERED_NAME as c4,
    F.Function_code as c6
    from
    XLE_ENTITY_PROFILES A,
    XLE_REGISTRATIONS B,
    XLE_REG_FUNCTIONS E,
    XLE_ETB_PROFILES C,
    XLE_REGISTRATIONS D,
    XLE_REG_FUNCTIONS F
    where (A.LEGAL_ENTITY_ID = C.LEGAL_ENTITY_ID and
    A.LEGAL_ENTITY_ID = B.SOURCE_ID and
    C.ESTABLISHMENT_ID = D.SOURCE_ID and
    B.SOURCE_TABLE = 'XLE_ENTITY_PROFILES' and
    D.SOURCE_TABLE = 'XLE_ETB_PROFILES' and
    E.Registration_id = B.Registration_id and
    F.Registration_id = D.Registration_id)
    order by c1, c2,c5, c3, c4,c6
    i don't get any error.
    Please let me know , why am i getting this error and how can i resolve this issue?

    Hi All,
    Is there any update on this ?
    Thanks,Ashish

  • Illegal cross join within the same dimension

    Hi,
    When certain fields are selected within the presentation table an "illegal cross join" error is returned by the BI Server. However if a FACT is added from one of the other presentation tables the "illegal cross join" error goes away. we need to query without fact column.
    We are getting following error
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 14065] Illegal cross join within the same dimension caused by incorrect subject area setup: [ CALL_CENTER.COUNSELOR_MANAGER T782130] with [ CALL_CENTER.COUNSELOR_HR T781594 On CALL_CENTER.COUNSELOR_HR.MASTER_STAFF_COUNSELOR_ID = CALL_CENTER.MASTER_STAFF_COUNSELOR.MASTER_STAFF_COUNSELOR_ID, CALL_CENTER.MASTER_STAFF_COUNSELOR T781739] (HY000)
    Can anybody help me solving this issue.
    Thanks,
    KS.

    Please give us an example of what you need.
    OBIEE perform a query in the dimension or through the fact table.
    You can't join two dimensions in the repository without going through a fact table.
    If you need to query without fact column, it's because you have design two dimensions where
    normally you can do one.
    You have then two solutions :
    * change the design of your logical model to make only one dimension.
    * use the OBIEE logical SQL in answer.
    http://gerardnico.com/wiki/dat/obiee/bi_server/design/obiee_logical_sql
    Success
    Nico

  • ***What is your favorite VI or other software to view large sets of waveform data?

    What is your favorite VI or other software to view large sets of
    waveform data?
    I have to look at waveforms with several sets of y data of 10000 or so
    points. Should I put this into Excel? There are no cursors, or zoom
    capabilities, and so on in Excel.
    Using a graph in LV is very slow when loaded down with this much data.
    Frankly a scope is easier for viewing waveforms. A scopelike utility
    for Windows?
    MathCAD?
    Is there any neat shareware out there?
    Thanks for your opinion,
    Mike

    There are a large number of analysis packages on the market that can display very large datasets. The one to choose depends largely on the nature of the data and what you want to do with it after you have loaded it in. Wandering down the software aisle at your local Staples you will find at least two or three.
    With datsets the size you are contemplating, a major feature to look for is a zoom function that initially shows the entire waveform but lets you narrow in on the data you want to see.
    DIGRESSION ALERT
    Actually, this sort of algorithm isn't to hard to code. I wrote a viewer once that allowed you to view datasets of arbitrarily large size (in V3 I think... though it may have been in V4). The code initally presented an overview of the entire dataset
    by decimating it down to a size that LV could display rapidly. As the user zoomed in using the cursors (not LV's graph zoom) the code would extract the selected portion of the data, redecimate it if necessary and redraw the display. (Which by the way is all the fancy packages really do anyway.)
    The tricky part is selecting a decimation function that retains the overall shape of the data.
    ENDOF DIGRESSION
    Several years ago I wrote an article for a magazine (Personal Engineering and Instrumentation News) that dealt with graphing packages that could handle a million datapoints at that time (late eighties) there were over a dozen programs--and they were all better than Excel...
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

Maybe you are looking for