Query not retrieving exact results.

I have a query which shows different result from what i have it in the cube.
I have a document number in rows and two key figures one amount and another  which shows no. of days for clearance. In the cube, for the same selection criteria , it gives me three records for the same document no. but in query its is gving me one record with different values in KF.
sample.
In cube
Doc  Amount  No. Days for CLearance
59    100  31
59    400  14
59    500  38
In query the result shows as
59   1000   1
Any Ideas where it is doing wrong.  No of days for clearance is calculated from the difference btw posting date and clearing date. I need No. of Days to further develop this query.Is it something to do with compression, or query cache..
Any Ideas!!1
Thanks in Advance..
Veeru

Sorry, the Result I've shown may be little confusion .. Here is the clear picture..
In query..
DOC -
Amount -
No.of Days to CLearing
59 -
1000 -
1
In Cube
DOC -
Amount -
No.of Days to CLearing
59 -
100----
31
59 -
500-------14
59--400-----18
the value of Days to Clearing is showing as 1.
Properties of that key figure are defined as follows..
KF as NUMBER
Aggregation :Summation
Exp.Aggregation : Counter All Values.
Ref Characteristic : cal day.
Is this something related to the display properties in BEX. Again, In cube the records are correct..
Thanks
Veeru

Similar Messages

  • Query not retrieving correct result set

    I have a query that doesn't seem to be executing its where clause. I used getQuery to check it and ran it in SQL Navigator where it works fine. The same query doesn't work correctly when executed in the OA Framework. Any ideas?
    Thanks.

    Mbolton,
    Try asking on the OA Framework Forum.
    Best regards,
    John "Ask it on the OA Framework Forum" Stegeman

  • MIX sale return problem(query not giving required result)

    i have written following query which is running sucessfully.the concept behind this query is to get a exact quantity of sold items after subtracting the sale return from the sale.now the problem is that when user take sale return against invoice then this query providing ok result but when user take sale return against MIX items not knowing exactly the invoice then query is not showing result means not subtracting MIX sale from sale.please help me to get required result from this query.
    i m using oracle 9i with developer 6i
    select s.price,s.item_code,S.DESCR,
    sum(decode(d.MONno,01,NVL(S.QTY,0),0)) JAN,
    sum(decode(d.MONno,02,NVL(S.QTY,0),0)) FEB,
    sum(decode(d.MONno,03,NVL(S.QTY,0),0)) MAR,
    sum(decode(d.MONno,04,NVL(S.QTY,0),0)) APR,
    sum(decode(d.MONno,05,NVL(S.QTY,0),0)) MAY,
    sum(decode(d.MONno,06,NVL(S.QTY,0),0)) JUN,
    sum(decode(d.MONno,07,NVL(S.QTY,0),0)) JULY,
    sum(decode(d.MONno,08,NVL(S.QTY,0),0)) AUG,
    sum(decode(d.MONno,09,NVL(S.QTY,0),0)) SEP,
    sum(decode(d.MONno,10,NVL(S.QTY,0),0)) OCT,
    sum(decode(d.MONno,11,NVL(S.QTY,0),0)) NOV,
    sum(decode(d.MONno,12,NVL(S.QTY,0),0)) DEC,
    sum(S.qty) TU
    FROM
    (select nvl(sales_detail.qty,0)+NVL(sales_detail.bonus,0) as qty,
    sales_detail.item_code AS ITEM_CODE,stock_reg.price price,
    stock_reg.descr AS descr,
    s_date as sale_date FROM
    SALES_DETAIL,SALES_HEADER,STOCK_REG
    WHERE SALES_DETAIL.S_ID = SALES_HEADER.S_ID AND
    SALES_DETAIL.STOCKCODE = STOCK_REG.STOCKCODE AND
    STOCK_REG.COMCODE=:COM AND
    STOCK_REG.GROUPID = :GID
    UNION ALL
    SELECT -1*QTY,ITEM_CODE,PRICE,DESCR,SALE_DATE FROM
    (select nvl(sales_detailR.qty,0)+NVL(sales_detailR.bonus,0) as qty,
    sales_detailR.item_code AS ITEM_CODE,stock_reg.price as price,
    stock_reg.descr AS descr,
    RETURN_date as sale_date FROM
    SALES_DETAILR,SALES_HEADERR,STOCK_REG
    WHERE SALES_DETAILR.SR_ID = SALES_HEADERR.SR_ID AND
    SALES_DETAILR.STOCKCODE = STOCK_REG.STOCKCODE AND
    STOCK_REG.COMCODE=:COM AND
    STOCK_REG.GROUPID = :GID
    UNION ALL
    select  -1nvl(sales_detailR.qty,0)+NVL(sales_detailR.bonus,0) as qty,*
    sales_detailR.item_code AS ITEM_CODE,stock_reg.price as price,
    stock_reg.descr AS descr,
    RETURN_date as sale_date  FROM
    SALES_DETAILR,SALES_HEADERR,STOCK_REG
    WHERE SALES_DETAILR.SR_ID = SALES_HEADERR.SR_ID AND
    SALES_DETAILR.STOCKCODE = STOCK_REG.STOCKCODE AND
    SALES_HEADERR.S_ID = 'MIX' AND
    STOCK_REG.COMCODE=:COM AND
    STOCK_REG.GROUPID = :GID)) S,
    (select level as MONno
    from dual
    connect by level <= 12) d
    where d.MONno = to_char(s.sALE_date, 'MM') AND trunc(S.SALE_DATE,'MONTH') BETWEEN TO_DATE(:FDATE,'MMYY') AND TO_DATE(:TDATE,'MMYY')
    GROUP BY S.ITEM_CODE,S.DESCR,S.PRICE
    ORDER BY S.DESCR ASC

    Gaurav,
    Can you print all the binding variables and update the ouput here.
    And I didn't get this date format 'dd-mon-rrrr', normally it will be like 'dd-mon-yyyy' right?
    Thanks,
    With regards,m
    Kali.
    OSSI.

  • Search Query not showing up results

    Hi ,
    I m firing a UCM query using the UCM admin console ,something like xLanguage <contains> `it-IT`,but it is not returning any results,although the content matching this condition exists in the content server in Released state.I have also rebuild the search indexes.
    I m not seeing any errors in the logs as well.
    Can anyone tell me what might be going wrong here and what more can i do to debug this.

    If this is Oracle Text Search, you might be hitting a stop word. ('It' would likely be considered a stop word.)
    Try searching using Repository Manager. If the document returns, then in the web ui, try enclosing the search phrase in braces
    xLanguage <contains> `{it-IT}`

  • Query not showing detailed result when run through query Designer or Portal

    Hi,
    There is one query which not showing detailed result while running through Query Designer or run in Portal.
    But strange thing is that it is showing the detailed result when i run it through BeX Analyzer.
    While all the other queries don't have this problem in system. All showing the correct detailed result.
    If anyone have some idea on this issue plz let me know.
    Regards,
    Javed
    Edited by: Javed Akhtar on Jul 7, 2009 3:59 PM

    Hi,
    We can do this setting in WAD. Please check the web template and try to remove that setting. When you have hierarchy then we can display only till certain level in portal, this setting is done in web template APIs, but in bex analyzer you can see all the detailed information.
    Edited
    Go through this thread for some more detailed information
    http://help.sap.com/saphelp_nw2004s/helpdata/en/44/7b5f0a95ce12d0e10000000a422035/frameset.htm
    Regards,
    rik

  • Basic NOT EXISTS query not returning any results

    DB Version: 10gR2
    One of our tables in the test schema is having less number of columns than the PROD shema.
    To determine which are missing columns in this table in Test schema i did the following.
    -----In Test Schema
    CREATE TABLE XYZ2
    (COL1 NUMBER);        ----------only one column
    SQL > CREATE TABLE tables_test_list AS SELECT TABLE_NAME,COLUMN_NAME FROM USER_TAB_COLS;
    Table created.--- In the prod schema
    SQL> CREATE TABLE XYZ2
      2  (COL1 NUMBER,
      3  COL2 NUMBER       ----------- same table name with an extra column
      4  );
    Table createdAnd from the PROD schema i execute the following SQL to determine what are the columns that are missing in the TEST schema
    select column_name from User_Tab_Cols  outer
    where table_name='XYZ2'
    and not exists (select 1 from TEST_SCHEMA.tables_test_list inner where outer.TABLE_NAME=inner.TABLE_NAME )But the above query is not returning any results. Any idea why?

    Actually, the example from the link I posted earlier:
    [email protected]> (
      2  select 'IN T1, NOT T2', column_name,data_type,data_length
      3    from user_tab_columns
      4   where table_name = 'T1'
      5  MINUS
      6  select 'IN T1, NOT T2', column_name,data_type,data_length
      7    from user_tab_columns
      8   where table_name = 'T2'
      9  )
    10  UNION ALL
    11  (
    12  select 'IN T2, NOT T1', column_name,data_type,data_length
    13    from user_tab_columns
    14   where table_name = 'T2'
    15  MINUS
    16  select 'IN T2, NOT T1', column_name,data_type,data_length
    17    from user_tab_columns
    18   where table_name = 'T1'
    19  )
    20  /

  • Personnel Admin AdHoc Query not retrieving all records

    Hi, I recently added a custom info type to a copy of the SAP ad hoc query for Personnel Admin by using the menu path in SQ02>Edit>Change Infotype selection . The query is picking up the new info type and runs fine but does not retrieve all records from the table for a given personnel id. It only retrieves 1 record per id.
    Has anyone dealt with this before and have an easy/quick fix for this?

    Have other users try the query, preferably a user with end user authorization.
    I've had this issue before, I'm an IT person and I customized a Standard infoset.
    During testing, I'm only getting 1 (in my case) Insurance record per employee.
    The end user can see multiple record per employee.
    Btw, did you customize a Global or a Standard Infoset?
    Regards,
    Olekan

  • Goto link query is not giving exact results

    Hi Folks
    I am having issue with GOTO query.
    My main query gives details of Employee seperation in particular year.
    For this query i have goto query.
    When i am checking the details of goto query ,it is giving incorrect results.
    Your help is appreciated.
    Thanks & Regards,
    Hari Reddy

    Hi Hari,
        Check in RSBBS, whether you specified the receiver query correctly...
    Check the link:
    [http://help.sap.com/saphelp_nw04/helpdata/en/99/08629bd3e41d418530c6849df303c9/content.htm]
        Hope this helps you.
    Regards,
    Yokesh.

  • SQL query not retrieving special characters in like O', M÷ and û

    Hi,
    I have a sql script to query database. The output is a string. When I execute this script through a Korn shell script to send the query result to a .csv file, it is showing some characters of the output as below.
    The characters O’ is displayed as ?
    The characters M÷ is displayed as ?
    The characters û is displayed as u
    I am able to retrieve the data as it is while running the script through SQL * Plus and spooling the output to a .csv file.
    If anybody is having solutions for this please reply.
    Thanks in advance for your kind help
    Regards,
    Sreesha
    Edited by: user530278 on Oct 18, 2008 2:56 PM

    user530278 wrote:
    Hi,
    I have a sql script to query database. The output is a string. When I execute this script through a Korn shell script to send the query result to a .csv file, it is showing some charcters of the output as below.
    The characters O’ is displayed as ?
    The characters M÷ is displayed as ?
    The characters û is displayed as uThis sounds like an NLS client setting issue.
    Note that there are scenarios where the data is "incorrectly" stored in the database but can be retrieved "successfully" from some clients. This is the case if you specify the same character set at your client as you have as database character set and this client character set setting is wrong, which means you ought to have specified a different client character set than you have in the database.
    Specifying the same character set on client and server prevents any conversion from taking place, so as long as the database can store the data (e.g. multi-byte characters won't be stored correctly in single-byte character set database no matter what you do) it will be stored "as is". If you now retrieve the data using the same setting, it looks correct, but if you use a client with a different character set setting that requires conversion the data will be mangled.
    The database character set can be identified using the dictionary view NLS_DATABASE_PARAMETERS, parameter "NLS_CHARACTERSET".
    The client character set can be identified by issuing the following at the SQL*Plus prompt:
    SQL> @[%NLS_LANG%]You'll get a message similar to:
    "Unable to open file [AMERICAN_AMERICA.WE8MSWIN1252]"
    The string after the dot represents the client character set.
    If you get this:
    Unable to open file "[%NLS_LANG%]"
    then the NLS_LANG client setting is undefined.
    Please follow this very useful link regarding client NLS issues and how to resolve them, in particular to determine what is your correct client NLS_LANG setting:
    http://www.oracle.com/technology/tech/globalization/htdocs/nls_lang%20faq.htm
    I am able to retreive the data as it is while running the script through SQL * Plus and spooling the output to a .csv file.You mean that when using SQL*Plus interactively the data is shown/spooled correctly, whereas if you run a script non-interactively then the data is mangled?
    Note that if you e.g. use "cron" to schedule/execute your script that you need to take care of the Oracle specific environment variables yourself because no logon scripts are executed when cron forks the process to run. May be you need to define the NLS_LANG variable explicitly or call/source the corresponding script to define your default Oracle environment that includes the NLS_LANG setting.
    It probably depends on your environment, operating system, etc. and how you set the Oracle specific settings, e.g. environment variables under Unix, registry settings under Windows etc.
    Use the above mentioned check regarding NLS_LANG setting in the different cases that you encounter to get started.
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • Log application query not showing correct results

    Hi,
    We are running Dataguard (DG) in our production environment. EBS 11.5.10.2 and DB 10.2.0.4.
    Every morning we run the following query on both primary and standby to confirm that the logs are being transported and applied to the standby:
    select sequence#,applied,to_char(first_time,'mm/dd/yy hh24:mi:ss') first from v$archived_log order by first_time;
    Once the logs are transported and applied, a response of 'Yes' is returned for each log generated. We have noticed within the last week that when we run the query on primary, 'No' is being returned, but on standby, 'Yes' is returned. I have confirmed that standby is reflecting the correct results. I've tried restarting the DG service (alter database recover managed standby....) in an attempt to have primary 'refresh' itself but that didn't work.
    Does anyone have any idea why primary keeps returning 'No' to the query, and how we can get it to reflect to correct results?
    Thanks,
    Lia.

    Hi Werner,
    Thanks for your response. Given what you're saying I find that a little strange since prior to this, the query would return a value of 'YES' on the primary. Actually, to be exact, on the primary, each log would should up twice. One would show 'NO' and the other 'YES'- the second indicating transporting and shipping was successful.
    This is how the results were before:
    SEQUENCE   APP   FIRST
    +154623 NO 04/07/09 08:03:22+
    +154623 YES 04/07/09 08:03:22+
    +154624 NO 04/07/09 08:05:27+
    +154624 YES 04/07/09 08:05:27+
    This is how the results are now:
    SEQUENCE   APP   FIRST
    +154754 NO 04/22/09 07:22:22+
    +154754 NO 04/22/09 07:22:22+
    +154755 NO 04/22/09 07:25:27+
    +154755 NO 04/22/09 07:25:27+
    I'm not doubting that what you're saying is correct, it just adds an element of confusion for me...
    Lia.

  • Query not showing desired result

    Hi All,
    DB :-10.2.0.3
    I am using following query to extarct the backuppice, which falls between the dates specified by query. I am really amazed, why it's not giving me the expected results.
    select handle, to_char(start_time, 'dd-mon-yy hh24:mi:ss') "start_time" , to_char(completion_time, ' dd-mon-yy hh24:mi:ss') "end_time" from
    v$backup_piece where
    to_char(start_time,'dd-mon-yy hh24:mi:ss') >'27-oct-10 23:00:00'
    and
    to_char(completion_time,'dd-mon-yy hh24:mi:ss')<'28-oct-10 04:20:53'
    Results truncated, just to fit in this window.
    23:02:25
    /data/oracle/LNEVRPP1/backup/database/c-465769364-20100927-0c                         27-sep-10 23:02:39           27-sep-10
    23:02:40
    /data/oracle/LNEVRPP1/backup/database/LNEVRPP1_ctl_l1_t730854174_s32554_p1.rmn        27-sep-10 23:02:58           27-sep-10
    23:02:59
    /data/oracle/LNEVRPP1/backup/database/c-465769364-20100927-0d                         27-sep-10 23:03:02           27-sep-10
    23:03:02
    /data/oracle/LNEVRPP1/backup/database/LNEVRPP1_arc_l1_t730854220_s32556_p1.rmn        27-sep-10 23:03:41           27-sep-10
    23:03:44
    /data/oracle/LNEVRPP1/backup/database/c-465769364-20100927-0e                         27-sep-10 23:03:51           27-sep-10
    23:03:51
    /data/oracle/LNEVRPP1/backup/database/LNEVRPP1_dbf_l0_t733532449_s33531_p1.rmn        27-oct-10 23:00:50           27-oct-10
    23:36:00
    /data/oracle/LNEVRPP1/backup/database/LNEVRPP1_dbf_l0_t733534566_s33532_p1.rmn        27-oct-10 23:36:07           27-oct-10
    23:48:38
    HANDLE                                                                                start_time                  end_time
    /data/oracle/LNEVRPP1/backup/arc2adsm/LNEVRPP1_arc_l0_t733536053_s33534_p1.rmn        28-oct-10 00:00:54           28-oct-10
    00:01:13
    /data/oracle/LNEVRPP1/backup/database/c-465769364-20101028-00                         28-oct-10 00:01:22           28-oct-10
    00:01:23
    /data/oracle/LNEVRPP1/backup/database/LNEVRPP1_dbf_l0_t733535322_s33533_p1.rmn        27-oct-10 23:48:43           28-oct-10
    00:20:06
    /data/oracle/LNEVRPP1/backup/database/LNEVRPP1_dbf_l0_t733537209_s33536_p1.rmn        28-oct-10 00:20:10           28-oct-10
    00:33:44
    /data/oracle/LNEVRPP1/backup/database/c-465769364-20101028-01                         28-oct-10 00:33:47           28-oct-10
    00:33:48
    /data/oracle/LNEVRPP1/backup/database/LNEVRPP1_ctl_l0_t733538041_s33538_p1.rmn        28-oct-10 00:34:04           28-oct-10
    00:34:04
    /data/oracle/LNEVRPP1/backup/database/c-465769364-20101028-02                         28-oct-10 00:34:06           28-oct-10
    00:34:07

    Hi
    Try:
    select handle, to_char(start_time, 'dd-mon-yy hh24:mi:ss') "start_time" , to_char(completion_time, ' dd-mon-yy hh24:mi:ss') "end_time"
    from v$backup_piece
    where start_time > to_date ('27-oct-10 23:00:00','dd-mon-yy hh24:mi:ss')
    and completion_time < to_date ('28-oct-10 23:00:00','dd-mon-yy hh24:mi:ss')
    Regards,
    Tycho

  • Group by Query not giving desired results

    Hi,
    I've a requirement to find minimum month based on status:
    The following query is giving error :
    SELECT
              b.app_name,
              DECODE (a.status,
              'C','Closed',
              'O','Open',
              'F','Future',
              'W','Pending',
              'N','Not Opened') decode_status
              MIN(a.period_name)
    FROM     table a,
         table b
    WHERE     a.app_id     =     b.app_id
    AND          b.app_name      =     'NAME1'
    AND          a.book_id     =     &book_id
    AND          a.status      =      'O'
    GROUP BY      b.app_name,
              DECODE (a.status,
              'C','Closed',
              'O','Open',
              'F','Future',
              'W','Pending',
              'N','Not Opened') decode_status
    for ex: in the above query if I've four records with status 'O' and period_name as 'May-12', 'Jun-12','Jul-12' ,'Aug-12' then I need to pick 'May'
    Thanks,
    Kiran

    Hi, Kiran,
    user518071 wrote:
    Hi,
    I've a requirement to find minimum month based on status:
    The following query is giving error :
    SELECT
              b.app_name,
              DECODE (a.status,
              'C','Closed',
              'O','Open',
              'F','Future',
              'W','Pending',
              'N','Not Opened') decode_status
              MIN(a.period_name)
    FROM     table a,
         table b
    WHERE     a.app_id     =     b.app_id
    AND          b.app_name      =     'NAME1'
    AND          a.book_id     =     &book_id
    AND          a.status      =      'O'
    GROUP BY      b.app_name,
              DECODE (a.status,
              'C','Closed',
              'O','Open',
              'F','Future',
              'W','Pending',
              'N','Not Opened') decode_status
    for ex: in the above query if I've four records with status 'O' and period_name as 'May-12', 'Jun-12','Jul-12' ,'Aug-12' then I need to pick 'May'
    Thanks,
    KiranIt looks like you're almost there.
    If period_name is a DATE, then
    MIN (a.period_name)is finidng the earliest period name, such as 5 May 2012 17:03:49. If you just want to see 'May 2012', then change that to
    TO_CHAR ( MIN (a.period_name)
            , 'Mon YYYY'
            )If a.period_name is a VARCHAR2, then change it to a DATE. The best way to do this is permanently. There is no reason to store date information in VARCHAR2 columns. Oracle supplies DATE columns; there's no extra cost for using them. DATE columns were designed for storing date information, use them to do that.
    if you must keep your date information in VARCHAR2 a column, then use TO_DATE in the query. It will be slow, and you'll have run-time errors if any of the information is in the wrong format. That's what happens when you store date information in VARCHAR2 columns.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using.
    See the forum FAQ {message:id=9360002}

  • SCCM query not returning the results I want

    I would like to use a query that will query my systems that have a particular piece of software (Flash), but I do not want it to include servers that are in a particular group.
    Explanation: I have about 20 servers with Flash installed that require it.  About half of them I can update regularly, the other half I can't.  So, I have an AD group for each - the ones I can patch, and the ones I can't.  I want the query
    to look for systems with "Adobe Flash" in the display name, but exclude the servers in both of these groups.  That way I can create a collection of computers that have Flash installed where it shouldn't be and can keep an eye on where it is
    being installed.
    The query looks like this in the criteria tab;
    Add/Remove Programs.Display Name is like "%Adobe Flash%"
    and
    System Resource.System Group Name is not equal to "LAB\FlashPatchGroup"
    The query language looks like this;
    select distinct SMS_R_System.Name, SMS_R_System.description, SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName, SMS_G_System_ADD_REMOVE_PROGRAMS.Version from  SMS_R_System inner join SMS_G_System_ADD_REMOVE_PROGRAMS on SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceID
    = SMS_R_System.ResourceId where SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName like "%Adobe Flash%" and SMS_R_System.SystemGroupName != "LAB\\FlashPatchGroup"
    The problem I am having is that when I run the query, it is pulling everything with Flash, including the ones in the AD group.  Anyone see a problem with the way I'm doing this?

    Hi Jorgen,
       Thank you for that - very helpful because I actually knew nothing about sub-select queries.  So now the overall logic makes sense, but unfortunately the only examples I've been able to find don't cover exactly what I want to do.
    The overall examples I have found work like this;
    - Create a query to find computers with a particular application installed
    - Create a subselect query that says find users that are NOT subject to the preceeding query
    What I need to do, however, is this;
    - A query finds computers with a particular piece of software installed
    - It compares the computer to 2 Active Directory groups I have created.
    - The query produces all computers with that particular piece of software that is NOT in the AD groups I have created.  This way I can easily identify servers that have Flash installed that shouldn't.
    Any ideas?  I have been trying to follow the subselect queries to do something similar but I just cannot make it work.  I've tried to create a subselect query that says "Add/Remove Programs Display Name contains "%Adobe Flash%" but is not in (subselect
    query)" and it just doesn't like it.
    Regards
    Juice

  • IPTObjectManager.Query not returning correct result (Java)

    Hi,
    I am having a problem with the IPTObjectManager.Query method. The code is given below. The issue I am having is, that when I search for a community in a specific folder not results are returned. However if I search in all folders (using -1 as the second parameter to the method) it returns multiple communities including the one I need. Anyone else had the same issue with this??
    // THIS CODE WORKS AND RETURN MULTIPLE COMMUNITIES
    // THE hotelCode VARIABLE IS A STRING VARIABLE CONTAINING A VALUE
    // WHICH IS THE COMMUNITY NAME.
    // Create a ObjectManager object
    IPTObjectManager objectManager = session.GetObjectManagers(ObjectClass.Community.toInteger());
    // define the query based on the passed string
    Object[][] vQueryFilter = {
         new Object[]{new Integer(PT_PROPIDS.PT_PROPID_NAME)},
         new Object[]{new Integer(PT_FILTEROPS.PT_FILTEROP_CONTAINS)},
         new Object[]{hotelCode}};
    // Run the query and return results
    IPTQueryResult ptQueryResult = objectManager.Query(
         PT_PROPIDS.PT_PROPID_ALL, -1, PT_PROPIDS.PT_PROPID_NAME, 0, -1, vQueryFilter);
    // THIS CODE DOES NOT WORK. I AM PASSING IS THE FOLDER ID OF THE
    // FOLDER WHICH CONTAINS THE COMMUNITY
    // Create a ObjectManager object
    IPTObjectManager objectManager = session.GetObjectManagers(ObjectClass.Community.toInteger());
    // define the query based on the passed string
    Object[][] vQueryFilter = {
         new Object[]{new Integer(PT_PROPIDS.PT_PROPID_NAME)},
         new Object[]{new Integer(PT_FILTEROPS.PT_FILTEROP_CONTAINS)},
         new Object[]{hotelCode}};
    // Run the query and return results
    IPTQueryResult ptQueryResult = objectManager.Query(
         PT_PROPIDS.PT_PROPID_ALL, 303, PT_PROPIDS.PT_PROPID_NAME, 0, -1, vQueryFilter);

    I don't know about G6, however in version 5 there does not appear an easy way of doing it. I guess the "easiest" way would be to query sub-folders first, build and array of their ids, and then query for communities in those folders. This is using server API. Something like this (.NET):
    publicvoidGetFolderCommunities(intfolderId){    IPTAdminFolder folder =this.session.GetAdminCatalog().OpenAdminFolder(folderId, false);    IPTQueryResult qr =folder.QuerySubfolders(PT_PROPIDS.PT_PROPID_ALL, [b]1, null, 0, -1, newobject[][] {             newobject[] { PT_PROPIDS.PT_PROPID_FOLDER_FOLDERTYPE }, newobject[] { PT_FILTEROPS.PT_FILTEROP_EQ } , newobject[] { PT_ADMIN_FOLDER_TYPES.PT_ADMIN_FOLDER_TYPE_COMMUNITYFOLDER } } ); int[] folderIds =newint[qr.RowCount()]; Console.WriteLine("------ sub-folders for communities -------"); for(inti =0; i <qr.RowCount(); i++) {        intobjectId =qr.ItemAsInt(i, PT_PROPIDS.PT_PROPID_OBJECTID);        stringobjectName =qr.ItemAsString(i, PT_PROPIDS.PT_PROPID_NAME);        intparentFolderId =qr.ItemAsInt(i, PT_PROPIDS.PT_PROPID_FOLDER_PARENTFOLDERID);        folderIds[i] =objectId; Console.WriteLine("{0}: {1}; parent: {2}", objectId, objectName, parentFolderId); } qr =this.session.GetCommunities().Query( PT_PROPIDS.PT_PROPID_ALL, -1, (object) null, 0, -1, newobject[][] {            newobject[] { PT_PROPIDS.PT_PROPID_FOLDERID }, newobject[] { PT_FILTEROPS.PT_FILTEROP_IN } , newobject[] { folderIds } } ); Console.WriteLine("------ communities from sub-folders -------"); for(inti =0; i <qr.RowCount(); i++) {        intobjectId =qr.ItemAsInt(i, PT_PROPIDS.PT_PROPID_OBJECTID);        stringobjectName =qr.ItemAsString(i, PT_PROPIDS.PT_PROPID_NAME);        int parentFolderId =qr.ItemAsInt(i, PT_PROPIDS.PT_PROPID_FOLDERID);        Console.WriteLine("{0}: {1}; folder: {2}", objectId, objectName, parentFolderId); }}
    Or you could use EDK RPC search. Again, in .NET:
    publicvoidSearchForCommunities(intfolderId){ IPortalSearchRequest searchRequest =this.ptSession.GetSearchFactory().CreatePortalSearchRequest(); searchRequest.SetObjectTypesToSearch(newObjectClass[] { ObjectClass.Community }); searchRequest.SetDocFoldersToSearch(newint[] {}, true); searchRequest.SetAdminFoldersToSearch(newint[] { folderId}, true); searchRequest.SetResultsCount(0, 100); searchRequest.SetResultsOrderBy(PortalField.OBJECT_ID); searchRequest.SetFieldsToReturn(newPlumtreeField[] {}); searchRequest.SetQuery("*"); ISearchResponse searchResponse =searchRequest.Execute(); intreturnedMatches =searchResponse.GetReturnedCount(); ISearchResultSet resultSet =searchResponse.GetResultSet(); IEnumerator enumerator =resultSet.GetResults(); while(enumerator.MoveNext()) { ISearchResult result =(ISearchResult) enumerator.Current; Console.WriteLine( result.GetFieldAsInt(PortalField.OBJECT_ID) +": "+ result.GetFieldAsString(PlumtreeField.NAME) ); }}
    Ruslan.

  • Query not executing the results

    Hi,
    I have created a Custom Virtual Cube with a custom function module. This Cube displays data when i check it through the transaction code - LISTCUBE.
    I have a query which has to be executed on this Virtual Cube. When i execute this Query , it does not display any data at all. It always displays "No applicable data found".
    I have tried with the combination of inputs for which the data is available in the cube. but still it gives "No applicable data found".
    Can someone suggest me what i have to do to correct this problem.
    Thanks
    Maddy

    Hi Maddy,
    I also encountered similar problem in BI 7.0, which doesn't happen in BW 3.5, though I was using Basic Cube, not Virtual Cube. I could finally work it out. Here are the steps I used:
    - Right click on the InfoCube > choose "Manage".
    - In the "Requests" tab, click the traffic light button in the "Request Status" column, set it to "Status OK".
    - The "Request for Reporting Available" column will show the "Request is available for reporting" icon automatically.
    - Try to execute your query again.
    Hope this might be relevant to your situation as well.
    Regards,
    arie

Maybe you are looking for

  • How to get the number from a xml file to flash as3 Text Box "Get_Days"?

    Hi, I have to daily update the number of days finished from the specified days. Say, One work to be finished in 30 days. And the start day is today. So, tomorrow it will be 29 days left. and so on.... So, instead of reducing one number everyday from

  • Voice Receiver

    Currently I am not able to talk on my phone for more than about 10 minutes before the person on the other end of the phone only hears static. I am able to hear them clearly but they cant hear me. I think this is also affecting videos when they record

  • Still shows Windows 8.1

    My Windows 10 Installation still says Windows 8.1 with Media Center in the lower right corner. The same in This PC Properties. Is that correct?  Thanks

  • How to burn movie in idvd without themes, chapters, etc.....

    I just want to burn some video I edited in imovie in idvd without the themes, chapters and all. How do I do this? I tried going to file>'onestep dvd from movie' and when trying to import received a message that said 'unsupported movie type - make sur

  • I cannot play the avi video file on my macbook!!! Need help please

    hi there i have a macbook and it plays other avi video file but i recently downloaded this video off of utorrent and when i play on it, it says quicktime couldnt recognize this video and suggests me and takes me to another link. I have already downlo