AND/OR operator while filtering query results

Hello all,
This sounds like very simple requirement but i was not able to show end user a way to do it. This is my requirement.
Employee       Department
A                   ACC
B                   ACC
                     R&D
C                   R&D
D                   HR
So when the user runs the report, after seeing this data now they want to filter like show me all the employees who are in ACC and R&D department. So the user is expecting to see only Employee B on the report. But when the user actually right clicks and selects ACC and R&D in filter screen they see A, B and C since they belong to ACC or R&D is there a way to filter by conditions like ACC "AND" R&D or the other way round like show me all who belong only to R&D and expect to see only employee C.
Let me know if anyone has faced this situation and what can be the best way to solve this
Thanks a lot in advance.

Maybe you can use a calculated keyfigure with exception aggregation for the characteristic employee (~ count all values for characteristic ...). This keyfigure should count how often an employee is in different departements. E.g. employee A is in 2 departements, the calculated keyfigure has the value 2. This can be used in a condition with an input variable (~ show only records with keyfigure greater or equal input value). The user filters the query for let's say 3 departments an wants to know, if an employee is in a least 2 of these departements. The user enters 2 in the input variable and refreshs or activates the condition.
I think this task cannot be done by the user using only context menue and mouse clicks.

Similar Messages

  • Error occurred while sending query result: 'java.lang.NullPointerException'

    I am doing end to end scenario from SQL server to File
    JDBC --XI -- File
    I am getting the following Error while monitoring the sender CC in RWB
    "Error occurred while sending query result: 'java.lang.NullPointerException'
    Please Help !!

    Hi,
    To see the Adapter Error log, try:
    http://<XiServerHostName>:<J2EE-Port>/MessagingSystem
    Try viewing the Audit Log for each message (Newspaper Icon)
    Regards,
    Amitabha

  • Error while sending query result

    Hi all,
    I am working on a JDBC-XI-IDoc scenario. In my sending JDBC adapter configuration, i have given the Query SQL statement as <b>SELECT * FROM SAP_PROMOTION</b> and Update SQL statement as: <b><TEST></b>
    But when i go to adapter monitor, i am seeing an error as follws:
    <b>Error:  Sending query result failed with com.sap.aii.af.service.cpa.impl.exception.CPALookupException: Couldn't retrieve binding for the given channelId: Binding:CID=875514bc047b3557a5b53dfb5ef4babe; - retry
      last retry interval started 10:54:09 2006-05-25
      length 60,000 secs</b>
    Can anybody help me how to solve this problem.
    Regards,
    Divija

    Divija,
    Am not sure if this is the exact cause for your problem, but would anyways suggest that you take a look at it,
    <i>classes12.zip is not compatible with JDK 1.4.</i>
    From the note : <b>831162</b>
    Oracle JDBC Driver (classes12.zip / classes12.jar) Deadlocks
    <b>Q: I have deployed the Oracle classes12.zip / classes12.jar JDBC driver as per the instructions in the XI Configuration Guide.
    Unfortunately, I frequently notice hanging database connections. A thread dump taken according to the instructions in note 710154 shows one or more blocking JDBC Sender/Reciver threads and optionally that the JVM has detected a deadlock.
    A: The Oracle classes12.zip / classes12.jar driver is compatible with Java 1.2 and Java 1.3 only, but not with Java 1.4. Please upgrade to a current driver (ojdbc14.jar), which does support the Java 1.4 JVM you are using.
    Please make sure that you remove classes12.zip / classes12.jar from aii_af_jmsproviderlib.sda prior to adding the new driver as per the instructions in the answer to question #1 above as you will get a class name collision otherwise (all JARs from aii_af_jmsproviderlib.sda are loaded into the same class loader and the driver class name of both driver versions is the same).
    Before deploying the updated driver, ensure that the new version is still compatible with your Oracle database server release. For details, please refer to the release notes provided by Oracle.</b>
    Regards,
    Bhavesh

  • Saving query result to a file

    Hi,
    I have a sql*developer version 1.5 but i am getting a problem while saving query result to a file. When i click on "script output "-> "file icon" nothing is showing.
    Can anyboby guide me whether its a bug or some other settings are required.
    I have oracle 10.2.0.3 working on linux.
    Thanks & regards
    Girish

    I am getting the same thing and as far as I know it is a bug.
    As a workaround, you can either copy the contents of the script output or run the query as a statement (F9) instead of as a script (F5) and export the query results from the results tab.

  • Only last pm_order operation in 0PM_DS04_Q0021 query?

    Hi Experts,
    When I execute query 0PM_DS04_Q0021 - Outstanding Order List,which runs
    over the DSO 0PM_DS04 - Maintenance Orders, Operations and Costs, I
    expect to have actual and planned time by order, but for all operations
    that occur in that PM order.
    I went over some PM orders on IW33 transaction code in R3 system and I
    compared it to query results in Business Explorer Analyzer.
    After a few records I got to think that BW is just geting the actual and planned time for the last operation for that order.
    Can you guve me a hint on how I can solve this?
    Thanks in advance for your help,
    Best Regards,
    André Oliveira

    Hi Experts,
    When I execute query 0PM_DS04_Q0021 - Outstanding Order List,which runs
    over the DSO 0PM_DS04 - Maintenance Orders, Operations and Costs, I
    expect to have actual and planned time by order, but for all operations
    that occur in that PM order.
    I went over some PM orders on IW33 transaction code in R3 system and I
    compared it to query results in Business Explorer Analyzer.
    After a few records I got to think that BW is just geting the actual and planned time for the last operation for that order.
    Can you guve me a hint on how I can solve this?
    Thanks in advance for your help,
    Best Regards,
    André Oliveira

  • IR Essbase Query - Results Exceeds 2^32 cells.

    Hi All,
    I'm working on IR Essbase Query and a Critical Error occured as follows:
    Internal Error: Query output is too large and cannot be executed. Query results exceeds 2^32 cells.
    Are there anyways to go around this?
    Thanks.

    Hi Any one got the solution for this error.
    Please let me know.
    Thanks
    Venu
    [email protected]

  • Iterate query result - put specific rows in a collection and do output

    JDeveloper 11.1.1.3.0
    Oracle Lite: 10.2.0.1.0
    Browser: IE 7
    Hi,
    please help me in working on following requirement:
    1. Iterate the View Object Query Result
    2. Do some calculation on the Rows, lets say:
    Concatination of column1 and column2 and place it in a non database Attribute "column3"
    3. How to handle/place the non database attribute?
    4. Fetch specific rows from the query result; there should be a comparison, like checking master and detail hierachy struktur:
    Take Column1_ID (Master) check in columns2_ID (Detail), when found detail take this Row and place it in a buffer (Maybe ArrayList, or something like that)
    5. Show the Chace(ArrayList) to user, in a form of View Object, with standard functions like sorting and filtering
    Till now my process of solving the above requiremnts are:
    To Point 1:
    Created a service method in Application Implementation Class
       public void iterateEmp(){
         EmployeesVOImpl vo = getEmployeesVO1();
         while (vo.hasNext()){
          EmployeesVORowImpl row = (EmployeesVORowImpl)vo.next();
          System.out.println(row.getEmployeeId() + " | " + row.getFirstName() + " | " + row.getLastName() + " | " +  row.getEmail());   
          //row.setCalcCol(row.getFirstName() + "," + row.getLastName());
         }To point 2:
    Added an attribute to the View Object, with updateable and Queryable options. Place it on the JSPX Page.
    With setter method, filled with values, for example (non Database Attributes Name is CalcCol):
    Name:
    //see above code
    row.setCalcCol(row.getFirstName() + "," + row.getLastName());When doing so, on initial Call the values will be representated, but when sorting o filtering will be done, the values then will be erased.
    3. Added an Attribute in View Object "Attributes Panel".
    Here the XML Code of the View Object:
    <?xml version="1.0" encoding="windows-1252" ?>
    <!DOCTYPE ViewObject SYSTEM "jbo_03_01.dtd">
    <!---->
    <ViewObject
      xmlns="http://xmlns.oracle.com/bc4j"
      Name="EmployeesVO"
      Version="11.1.1.56.60"
      BindingStyle="OracleName"
      CustomQuery="true"
      ComponentClass="model.EmployeesVOImpl"
      PageIterMode="Full"
      UseGlueCode="false"
      RowClass="model.EmployeesVORowImpl">
      <DesignTime>
        <Attr Name="_codeGenFlag2" Value="Access|Coll|VarAccess"/>
        <Attr Name="_isExpertMode" Value="true"/>
        <Attr Name="_isCodegen" Value="true"/>
      </DesignTime>
      <SQLQuery>
        <![CDATA[select employee_id, first_name, last_name, email from employees]]>
      </SQLQuery>
      <ViewAttribute
        Name="EmployeeId"
        IsUpdateable="false"
        IsPersistent="false"
        IsNotNull="true"
        PrecisionRule="true"
        Precision="6"
        Scale="0"
        Type="oracle.jbo.domain.Number"
        ColumnType="NUMBER"
        AliasName="EMPLOYEE_ID"
        Expression="EMPLOYEE_ID"
        SQLType="NUMERIC">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="22"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="FirstName"
        IsUpdateable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="20"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="FIRST_NAME"
        Expression="FIRST_NAME"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="20"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="LastName"
        IsUpdateable="false"
        IsPersistent="false"
        IsNotNull="true"
        PrecisionRule="true"
        Precision="25"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="LAST_NAME"
        Expression="LAST_NAME"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="25"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="Email"
        IsUpdateable="false"
        IsPersistent="false"
        IsNotNull="true"
        PrecisionRule="true"
        Precision="25"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="EMAIL"
        Expression="EMAIL"
        SQLType="VARCHAR">
        <DesignTime>
          <Attr Name="_DisplaySize" Value="25"/>
        </DesignTime>
      </ViewAttribute>
      <ViewAttribute
        Name="CalcCol"
        IsSelected="false"
        IsPersistent="false"
        PrecisionRule="true"
        Type="java.lang.String"
        ColumnType="VARCHAR2"
        AliasName="VIEW_ATTR"
        SQLType="VARCHAR"/>
      <AttrArray Name="KeyAttributes">
        <Item Value="EmployeeId"/>
      </AttrArray>
    </ViewObject>To Point 4:
    There should be a specific sort order, which i have to code in ADF.
    Just to give an overview:
    Colum1 and Column2 (nothing to do with the emp table) have relationship. Several hierachies are existing in the Query Result.
    For identifying the start point of any of these hierachies, i have to iterate through the Query Result and fetch these start point
    and buffer it in an array or something like that.So in the end i have to get the same query Result but with different Sort Order.
    How to buffer theses Rows (Array?) and show in a View Object?
    Can we use the same view Object for solving that, or should we use another View Object which catches the new Result Set?
    To Point 5:
    The Result should be, as mentioned above, a View Object including new Result Set, which can provide standard behavior (sort, filter)
    I hope the requirement is defined clearly enough, so maybe you can make some suggestions on that.
    Thank you for replies.
    Edited by: user9198377 on 13.07.2011 02:52

    Hi.. You can do this without DB View. Have CalcCol transient attribute in VO. Instead of iterating VO rows and setting CalcCol attr, generate View Row Impl class. Inside getCalcCol(), write your logic. This will be called during each and every request so that transient attr data won't become null during sorting and filtering. If your VO is entity driven, do the same in Entity impl class
    Raghu
    Edited by: Raguraman on Sep 5, 2011 9:48 AM

  • Query Result Filtered using User Roles SCSM 2012 R2 RU2

    Hi,
    I have a Query Result setup in a Request Offering that shows the list of Printers using the Printer CI. We have different sites with printers that start with the site location like MTL. There are no filters in the Query Result. What i did is create a Group
    for each site that has the rule "start with" MTL (other groups have other 3 letter prefix). Then i created a user role for each group and only selected the Printer group for the site and i associated the User Role with our AD Site group called MTL-User.
    i did this for each site. Now when i checked the Request Offering at first, with a user that is part of MTL-User group, it showed only the list of printers that started with MTL. Now today i came to check again and the same user is seeing all the printers
    and not just the ones that start with MTL.
    The User Role i made was based on the Read-Only Operator. I just dont know what the problem is

    Thanks for that link. I had thought of something like that but i found it came to the same thing as just using the filter field that is already available when using a Query Result. I retried using User Roles and figured out that the problem is that my test
    user is only part of the MTL-USER group so when i logged in with him into the portal (cireson Portal btw) i would see the proper result. If i logged in with a actual user that is also part of other groups besides MTL-Users, they see all the printers no matter
    which AD group i define in the User Role. 
    So what i figured was that my group is not getting applied as the filter to the query Result and that the Member section in the User role is only to say who can see the Query result list. But then i have my test user for which this setup works...so im confused
    on what exactly is overriding the results.

  • Error in SQL Query The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator. for the query

    hi Experts,
    while running SQL Query i am getting an error as
    The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator. for the query
    select  T1. Dscription,T1.docEntry,T1.Quantity,T1.Price ,
    T2.LineText
    from OQUT T0  INNER JOIN QUT1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN
    QUT10 T2 ON T1.DocEntry = T2.DocEntry where T1.DocEntry='590'
    group by  T1. Dscription,T1.docEntry,T1.Quantity,T1.Price
    ,T2.LineText
    how to resolve the issue

    Dear Meghanath,
    Please use the following query, Hope your purpose will serve.
    select  T1. Dscription,T1.docEntry,T1.Quantity,T1.Price ,
    CAST(T2.LineText as nvarchar (MAX))[LineText]
    from OQUT T0  INNER JOIN QUT1 T1 ON T0.DocEntry = T1.DocEntry LEFT OUTER JOIN
    QUT10 T2 ON T1.DocEntry = T2.DocEntry --where T1.DocEntry='590'
    group by  T1. Dscription,T1.docEntry,T1.Quantity,T1.Price
    ,CAST(T2.LineText as nvarchar (MAX))
    Regards,
    Amit

  • Xml parsing error while selecting whole result set for sql query

    Hi All,
    I am having xml parsing error while selecting whole query result set. The data is coming fine for default result set of 50 rows.
    My exception is below.
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00234: namespace prefix "xsi" is not declared
    Error at line 1
    ORA-06512: at "SYS.XMLTYPE", line 254
    ORA-06512: at line 1
    *31011. 00000 - "XML parsing failed"*
    **Cause: XML parser returned an error while trying to parse the document.*
    **Action: Check if the document to be parsed is valid.*
    My sql query is below that is giving results for default result set of 50 rows.
    select extract(xmlType(clob_xml_colm_name), '//v2:node1//childnode/text()','xmlns:v2="namespace_url"').getStringVal()  from table_name
    My sql developer version is below.
    Java(TM) Platform     1.7.0_04
    Oracle IDE     3.1.07.42
    Versioning Support     3.1.07.42
    My database version is below.
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit
    Please could any one help me urgently as the sql query is supposed to be correct as it is returning query results, but the problem happening when i try to select whole result set.
    Thanks and regards,

    What does the XML look like? It appears that some of the supposed XML stored as a CLOB is not really valid XML. Find the row in the table that is causing your issue and review the "XML" in it.

  • 2.1EA2: Pinning Query Results and changing Connections [fixed in 2.1.0]

    I am on 2.1EA2 (JDK 1.6.0_16) and been playing with the new SQL Worksheet pin query results functionality. I have found that it is possible to run a query against one connection, pin the results and then change connection and run the same (or a different) query against another connection. I really like this, but found a few problems:
    #1 There doesn't seem to be any way to tell which connection a query result tab was actually run against
    #2 Even if all rows are fetched, if I then disconnect from the first connection it can get quite messy. Sometimes I get an empty connection dialog (I can't remember the exact title and it doesn't reproduce consistently) with only the close window X in the corner. Some times I get prompted to log in with a connection information dialog with no reference to the connection it is connecting to - cancelling only brings up the same dialog again until I successfully connect. Some times I get prompted to log in and while that is still on the screen, SQL Developer logs me back in to the connection (even though I don't save passwords) - I even get a new worksheet for the reconnected connection.
    theFurryOne

    Raghu,
    I am happy with both.
    #1 - I would be happy if the connection name was at the start of the tool-tip style pop-up when hovering over Query Results tab and the Query Result SQL dialog that opens on the SQL button. -K-'s suggestion makes it immediately obvious for the currently selected Query Results tab, without having to move the mouse or click on something.
    Ideally, I would like something similar for the other output tabs (ie Script Output), but they seem to show results for all connections that the worksheet has used, so the same concept may not work.
    #2 - I am used to the grid being cleared when disconnecting from earlier versions - I assumed that this was a bug where SQLD was not checking the connection of the results, just the current connection of the worksheet.
    theFurryOne

  • Incorrect query result with Top N condition and two structures

    Hi,
    I have created a query on a FI-GL infocube with the characteristic 0BUS_AREA in rows and two structures in columns. The first structure has two items / selections (each item is a selection of several GL accounts). The second structure has two items (the first one contains the key figure 0BALANCE for the current period and the second item is a formula that calculates the absolute value of the first item. The first item is hidden). The (simplified) result looks like this (sorry, not very pretty!):
    Business Area Clients Clients fae
    Business Area1 10 15
    Business Area2 20 7
    Business Area 3 15 8
    Overall result 45 30
    I then added one condition using the Top N operator. The condition is defined for all the elements of the structures. When I execute the query, I sometimes obtained an incorrect number of Top N records selected. The problem seems to occur when N is greater than the number of available Business Areas for an element of the structure.
    For example, if N = 8 and data only exists for 5 Business Areas for the structure element Clients, I may end up with 10 Business Areas for the second structure element Clients fae when I only expect 9 (i.e. the top 8 Clients fae + 1 of the Top 8 Clients for which there is no data under Clients fae).
    Has anybody encoutered that kind of problem ?
    Many thanks.
    François.

    Pascal,this is a known behavior with conditions.When you apply condition it just hide the extra rows and it does not impact the result row.So your result row actually shows the value irrespective of the condition you apply.
    Now with the help of local functions like calculate result as summation you can show the correct sum after applying the condition but when you try to use that result in some calculation then it takes the original value thereby discarding the calculated value.
    Same is happening in your case as well.Its taking the original value i.e 350 and not the calculated sum after condition i.e 270.
    Hope this helps.
    Regards,
    AL

  • Create SP that returns value and at the same time displays query result in output window

    I would like create an SP which will return the records from the table and also return value to my c# client application.
    For Example:
    Select * from employee returns all the query results in output window.
    Now I want to create an SP
    Create procedure Test
    As
    Declare @ret int,
    Select * from employee
    set @ret = Select count(*) from employee
    if @ret > 0
    return 1
    else
    return 0
    The above algo should return 1 0r 0 to c# client application and at the same time display all employees in sql query output window.
    Can u pls help in this regard.

    The above algo should return 1 0r 0 to c# client application and at the same time display all employees in sql query output window.
    Why?  and No!
    Why?  Your procedure generates a resultset of some number of rows.  You check the resultset for the presence of rows to determine if "anything is there".  You don't need a separate value to tell you this.  Note that it helps
    to post tsql that is syntactically correct.   While we're at it, if you just need to know that rows exist there is no need to count them since that does more work than required.  Simply test for existence using the appropriately-named function
    "exists".  E.g., if exists (select * from dbo.employee). 
    No!  A stored procedure does not display anything anywhere.  The application which executes the procedures is responsible for the consumption of the resultset; it chooses what to do and what to display. 
    Lastly, do not get into the lazy habit of using the asterisk in your tsql code.  That is not best practice.  Along with that, you should also get into the following best practice habits:
    schema-qualify your objects (i.e., dbo.employee)
    terminate every statement - it will eventually be required.

  • Query Generator and SUM operation in column

    Hi
    Is it possible to have SUM operation at the end of each numeric column in query result
    Thanks in advance

    You may use Ctrl+Click to get sum results for each column individually.  Or use Union All to copy query and group by one of identical value field to sum all numerical fields.
    Thanks,
    Gordon

  • Cannot query using both conforming and cached query result

    TopLink doesn't allow me to both use conforming and cached query result at the same time.
    Conforming is certainly not a superset of the [cached query result] features.
    Can you confirm that it's a limitation of TopLink?
    Any know workaround to end-up with the same features as using both conforming and cached query result?
    Conforming is about seeing modifications you do in the same transaction. As a bonus, if you query for one object and specify at least the id as criteria because TopLink will have to check in memory anyway it can avoid going to the database.
    But if I do a query like "give me employees hired before now and after 30 days ago" it's about more than one objects and about finding existance so cached query result is needed to get acceptable performance in a complex application trying to avoid the same SQL generated over and over again.

    Thats where the trace just ends? It doesnt look like there's any LIKE or filtering going on (with respect to the Oracle pieces anyway), apparently MSAccess simply requested the whole table.
    What do you mean by 'hang' exactly? Are you sure it's just not taking a long time to complete? How long have you waited? How fast does it complete on the other environment?
    ODBC tracing isnt likely to help much for that. SQLNet tracing would be better to see what is going on at a lower level. Specifically, what is going on at the network level? Is the client waiting for a packet to be returned from the database?
    Is the database having a hard time processing the query, perhaps due to index/tuning issues?
    Assuming that is indeed the query that is "hung", how much data does that return?
    Are you able to reproduce the same behavior with that query and vbscript for example?
    Greg

Maybe you are looking for