Using Logical operators in filters

Hi All,
I want to filter rows from an XML using AND logical operator.
<?xml version="1.0" encoding="UTF-8" ?>
<RowSet>
<Row>
<Name>jake</Name>
<Sem>First</Sem>
<Score>100</Score>
</Row>
<Row>
<Name>jake</Name>
<Sem>second</Sem>
<Score>200</Score>
</Row>
<Row>
<Name>pete</Name>
<Sem>First</Sem>
<Score>300</Score>
</Row>
</RowSet>
I want all the results with Name='jake' and Sem='First'.I tried this usig the AND operator but couldnt get the result .
I tried :
<?for-each-group: Row/{./Name='jake'} AND Row/{./Sem='Score'}?>
<?Name?>
<?Score?>
<?end for-each?>
This doesnt seem to work(with flower brackets repalced by square brackets).Although the OR operator works with the '|'(pipe) symbol in the same manner.
Any suggestion on how to use the logical operators.
Thanks!!
Edited by: rick_me on May 23, 2009 2:09 AM
Edited by: rick_me on May 23, 2009 2:10 AM

Hi,
Use:
<?for-each:Row[./Name='jake' and ./Sem='First']?>
<?Name?>
<?Score?>
<?end for-each?>Regards,
Colectionaru

Similar Messages

  • How to use Logical operators in Essbase Studio?

    I want to add a new Dimension Element like
    if ( connection : \'SH'::'SH.CUSTOMERS'.'CUST_GENDER' == "M" ) then "Male"
    else "Female"
    However, there isn't 'if ... then ...' expression in Essbase Studio. I'm puzzled to the usage of logical operators such as '==', '!=', and so on.

    The == and !== are to set conditions for filtering. the ! meand not. In esscense these allow you to get a subset of rows that meet the conditions specified. In your case where Gender == "M" you will only get those rows where the value is "M". What you want to do is transform rows not filter them. I have not looked at studio enough yet to know how to do this, but a few things come to mind. First, you could use text to create the outline menbers instead of values from the tables, you could crete a reference table with the M = Male and F = Female and join to it to get the values or you could use a standard load rule and sql interface to load the data and just build the dimensions and drill through from Studio. I think I would opt for the second option

  • Using logical operators when creating software groups

    Is there a way to use simple logical operators when using filters for creating software groups?
    An example of what I want to do is to select all updates for the past month - but not include Definition Updates for instance. So all update classifications but NOT definition updates.

    The '-' trick only works for ADRs to my knowledge.
    For searching within the console, anytime you add criteria for the same attribute, it always adds it with an OR. This is a known design shortfall.
    For your question specifically though, you need to reverse your thinking and instead of being exclusive, think inclusively. Thus, you can add an attribute multiple times to the search criteria by selecting and adding it multiple times  -- once for each
    classification that's not definition updates. Then, save the search as pointed out by Torsten.
    Jason | http://blog.configmgrftw.com

  • How to use logical operators with the fields, this feature is avaliable?

    Hi, I need in a form to compare the content of two fields, i.e.  email and confirmation email, is this possible in Forms Central?, how I can do it?
    Thanks you

    Not Supported
    Hi,
    This is not something we currently support but you can add or vote on feature ideas:
    http://forums.adobe.com/community/formscentral?view=idea
    If you need to add a new idea click "Create an idea" under "Actions" in the top right.
    Thanks,
    Jeff

  • Logical operators using "AND" and "OR" operators

    I currently have written code which has two for loops to search a user query. I am able to search user queries entered for a simple and composed query. Eg. Simple query can be "Hello" and composed query can be "Hello World".
    What i would like to do now is be able to use logical operators such as "AND", "OR" when searching e.g. "Hello AND World" or "Hello OR World" Once this is done i would like to score the highest point depending on where the query is found.
    Could someone please help me with either giving me some tips of going about this or some starting code and hints. I have attached some code below which explains what i am currently doing to do the simple query.
    private void SearchButtonActionPerformed(java.awt.event.ActionEvent evt) {                                            
    /* Gets the simple query enterted into the text field. It then looks at the strippedFile in memmory */
    long start = System.currentTimeMillis();
    // long elapsed = System.currentTimeMillis() - start;
    String userQuery = SearchTextField.getText();
    StringTokenizer userQ = new StringTokenizer(userQuery);
    String[] brokenStrings = new String[userQ.countTokens()];
    int counter2 = 0;
    while (userQ.hasMoreTokens()) {
    String moreStrings = userQ.nextToken();
    brokenStrings[counter2] = moreStrings;
    counter2++;
    int Simplematches = 0;
    for (int i = 0; i < strippedFile.length; i++) {
    String LongCurrentLine = strippedFile;
    StringTokenizer st = new StringTokenizer(LongCurrentLine);
    String[] currentline = new String[st.countTokens()];
    int counter = 0;
    while (st.hasMoreTokens()) {
    String moreStrings1 = st.nextToken();
    currentline[counter] = moreStrings1;
    counter++;
    highlighter.highlight(HTMLOutputTextArea, userQuery);
    for (int j = 0; j < brokenStrings.length; j++) {
    for (int k = 0; k < currentline.length; k++) {
    if (brokenStrings[j].equalsIgnoreCase(currentline[k])) {
    long elapsed = System.currentTimeMillis() - start;
    Simplematches++;
    String output = "\"" + currentline[k] + "\" was found on line " + (i + 1) + "." + " At postion " + (k + 1) + " and took " + elapsed + " milliseconds." + " Found " + Simplematches + " matches" + "\n";
    //String output = "\"" + currentline[k] + "\" was found on line " + (i + 1)+ "." + " At postion " + (k + 1) + " Found "+ Simplematches+ " matches"+ "\n";

    jschell wrote:
    london_guy86 wrote:
    jschell wrote:
    Not clear what you search, but....
    First you need to specifically define the syntax. For example what does the following mean?
    a OR b AND c OR d
    Once you do that then you parse the input to create an expression tree. Then you write an interpreter to run the expression tree.Is there any chance you could give me a starter code or soe sources i could look at. I really dont understand how to go about doing what you have mentioned. As in i have declared the syntax at the moment and i am then using the replaceAll() and calling in what i have declared. with empty strings.
    Is this what you mean?Hard to say since I don't understand your statement.
    There are three parts
    1. Parse the expression.
    2. Interpret the expression
    3. Do the "search", this is actually part of 2 however it should be possible to implement some or all of it separate from 1 and 2.
    Do NOT mix the three parts until you are ready to mix them.
    Your posted code is mixing them.
    Presumably what you posted is mostly search. So to start re-write JUST the search code as a class.
    However you can't really do that until you define what the expressions do.After doing everything you mentioned do you think it would be hard to get a score on the best match search found?
    If not could you also give me some tips towards that if you know any.
    Thanks

  • Logical operators in Oracle select query

    Hello all,
    Can i use logical operators in oracle select queries?
    for 1 and 0 =0 ; 1 or 0 =0
    if i have two fileds in a table COL1 have a value of 1010 and COL2 have a value of 0001.
    Is there any way to use select col1 or col2 from table? where or is a logical operator?
    Regards,

    Hi,
    NB wrote:
    Hello all,
    Can i use logical operators in oracle select queries?Sure; Oracle has the logical operators AND, NOT and OR. All the comparison operators, including >, >=, = !=, EXISTS, IN, IS NULL, LIKE and REGEXP_LIKE are really logical operators, since they return logical values. You can use them in SELECT statements, and other places, too.
    for 1 and 0 =0 ; 1 or 0 =0
    if i have two fileds in a table COL1 have a value of 1010 and COL2 have a value of 0001.It's unclear what you want. Maybe you'd be interested in the BITAND function:
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/functions014.htm#sthref1080
    BITAND is the only logical function that I know of. Many other functions, especially numberical fucntions such as MOD, have applications in logic.
    Is there any way to use select col1 or col2 from table? where or is a logical operator?Whenever you have a question, please post a little sample data (CREATE TABLE and INSERT statements), and also post the results you want from that data.
    Explain how you get those results from that data.
    Always say which version of Oracle you're using.

  • Search format with logical operators in TREX

    We've  activated the index for business object BUS1001006 for material master on SES_ADMIN. The index was created successfully and the two new search help was activated as well. Now testing it in development, I'm trying to figure out how you include logical operators (AND, OR, etc...) inside your search term.
    For example I want to search materials that has ADAPTOR or AMPLIFIER. If I specify exactly "ADAPTOR or AMPLIFIER" (without the quotes) it does not return any search results.
    I'm trying this both on the two new search help and on program COM_SE_SEARCH_IIF_TEST.
    Can you let me know how to do this please ?
    Thanks in advance.

    You have to distinguish between attribute search and full text search:
    In attribute search you can use logical operators by using the generic Select Options just like in any other search help.
    In full text search all entered search words are interpreted with AND conditions.
    If you just press the generic F1 for help on the field "Full Text Search" you will receive the complete standard documentation.
    OR conditions in full text search are not supported because of the restrictions of the generic F4 UI.
    If you want to support OR conditions you should consider installing the SAP product NetWeaver Enterprise Search. The full text search in it's generic search UI contains a query parser that supports the following (and more) features:
    [http://help.sap.com/saphelp_nwes72/helpdata/en/d0/297dfa25a24a57a31e8364ee2ad7eb/frameset.htm]
    Instead of contructing OR conditions it's sometimes much more convenient to browse with NetWeaver Enterprise Search through the distinct value lists of attributes: Read "Narrowing Down Results" in:
    [http://help.sap.com/saphelp_nwes72/helpdata/en/df/f2fb01b6844246b121497b633d83a5/frameset.htm]
    Enjoy! - Klaus

  • How to use logical operator

    Hi ,
    I hava a problem while using logical operators.
    I wrote a procedure to compare two strings.please check the following.
    CREATE OR REPLACE PROCEDURE comp_str(sour_str IN varchar2,targ_str IN varchar2) AS
    leng_sour_str number:=NVL(length(sour_str),0);
    leng_targ_str number:=NVL(length(targ_str),0);
    leng_str number:=NULL;
    BEGIN
    IF sour_str IS NULL THEN
    dbms_output.put_line(leng_targ_str);
    elsif targ_str IS NULL THEN
         dbms_output.put_line(leng_sour_str);
    ELSE
         select utl_match.edit_distance(leng_sour_str,leng_targ_str) into leng_str from dual;
    END IF;
    dbms_output.put_line(leng_str);
    IF (leng_str > 0) OR (leng_sour_str > 0) OR (leng_targ_str > 0) THEN
    dbms_output.put_line('Strings are not same');
    ELSE
    dbms_output.put_line('Strings are same');
    END IF;     
    END comp_str;
    IF (leng_str > 0) OR (leng_sour_str > 0) OR (leng_targ_str > 0) statement is not verifying the conditions properly.
    Please suggest me that how to write multiple conditions with OR Operator or any alternative.
    thanks in advance.

    They are working exactly as you expect it. The problem in your code is probably the "utl_match.edit_distance"-procedure. Do you know the outcome of this procedure?
    Why don't you try something like
    declare
      l_string1   varchar2(255) := 'String1';
      l_string2   varchar2(255) := 'String 2';
    begin
      if length(l_string1) > length(l_string2) then
        dbms_output.put_line('String 1 is longer than String 2');
      else
        dbms_output.put_line('String 1 is shorter than String 2');
      end if;
    end;This way, you can change one string or the other and see, how it works. With utl_match.edit_distance you need to know what exactly they are computing to see what the logical comparison is doing.

  • Spatial query w/ logical operators in a subquery on Linux using Oracle 1

    Hello...
    I'm being given XML that I need to parse and create SQL from it. Below my signature is the SQL that I generate (its a simple example) and can be more elaborate due to the logical operators (AND and OR) given in the XML.
    The problem that we're seeing is performance-based: when one of the logical operator queries is Spatial-based, like below. Running it in JDBC, the query never returns.
    The spatial query just by itself returns ~300 rows (takes approximately 0.2 seconds). The "PERCENTAGE" query by itself returns about ~40000 rows (takes approximately ~.8 seconds).
    If we run the query below with 2 non-spatial subqueries, the result returns and performance is very acceptable (~ 0.9 seconds)-- the result set is about 80000 rows.
    Thanks,
    Jim
    =========================
    SELECT
    COLUMN_WE_WANT , RESULTS
    FROM
    TABLE_A
    WHERE
    COLUMN_WE_WANT IN
    SELECT
    COLUMN_WE_WANT
    FROM
    TABLE_A
    WHERE
    SDO_OVERLAPBDYINTERSECT(TABLE_A.MY_SPATIAL_COLUMN,
    SDO_GEOMETRY(2003,
    4326,
    null,
    SDO_elem_info_array( 1 , 3 , 1 ),
    SDO_ORDINATE_ARRAY( lng_1,lat_1 , lng_2,lat_2 , lng_3,lat_3 , lng_4,lat_4 , lng_1,lat_1 )
    ) = 'TRUE'
    OR
    COLUMN_WE_WANT IN
    SELECT
    COLUMN_WE_WANT
    FROM
    TABLE_B
    WHERE
    SOME_PERCENTAGE_RATE_COLUMN < 90
    )

    Its difficult to comment without seeing the execution plan. You should trace this query to get a better idea of exactly what's happening.
    Depending on the complexity of the logical operators, I would look at doing this using set operations. So for an OR you might have...
    SELECT COLUMN_WE_WANT, RESULTS
    FROM TABLE_A
    WHERE COLUMN_WE_WANT IN (
         SELECT COLUMN_WE_WANT
         FROM TABLE_A
         WHERE SDO_OVERLAPBDYINTERSECT(TABLE_A.MY_SPATIAL_COLUMN,SDO_GEOMETRY(2003,4326,
         NULL, SDO_elem_info_array( 1 , 3 , 1 ),
         SDO_ORDINATE_ARRAY( lng_1,lat_1 , lng_2,lat_2 , lng_3,lat_3 , lng_4,lat_4 , lng_1,lat_1 ) )) = 'TRUE'
    UNION
         SELECT COLUMN_WE_WANT
         FROM TABLE_B
         WHERE SOME_PERCENTAGE_RATE_COLUMN < 90)For an AND, you would use INTERSECT.
    Edited by: Reggie to remove the extra INTERSECT

  • Advanced Search using conditional & logical operators+ sharepoint 2010

    Hi Team,
    We have an requirement something like this. we have to search values from Custom SharePoint List using Conditional & Logical Operators in SharePoint 2010. how can i achieve this ? if some one has worked on something like this, can you please share the
    details to my email id ([email protected]
    Thanks in Advance.
    Cheers, San

    Hi Santhosh,
    If you have only one list, then you can use CAML query to perform search in that list. You can write code to generate dynamic CAML based on selection in the filter.
    If have to perform the search function on multiple list then you can use Search object model and create dynamic query and execute it using Search OM.
    http://msdn.microsoft.com/en-us/library/office/dn423226(v=office.15).aspx
    Best Regards,
    Brij K

  • Regulare Expressions - Uses of logical operators

    I need to make use of logical operators within a regulare expression. (greater than, equal, etc.)
    It seems to me that java.util.regex.Pattern does not support that kind of expression. First of all: Is this true (If I am wrong with my assumption, how would the expression look like). Secondly: Which library does support this expression?
    Thanks in advance!

    Regular expressions deal with characters. In that context all characters are 'equal'. You better explain your question a helluva lot better than that.

  • Spatial query w/ logical operators in a subquery on Linux using Oracle 10g

    Hello...
    I'm being given XML that I need to parse and create SQL from it. Below my signature is the SQL that I generate (its a simple example) and can be more elaborate due to the logical operators (AND and OR) given in the XML.
    The problem that we're seeing is performance-based: when one of the logical operator queries is Spatial-based, like below. Running it in JDBC, the query never returns.
    The spatial query just by itself returns ~300 rows (takes approximately 0.2 seconds). The "PERCENTAGE" query by itself returns about ~40000 rows (takes approximately ~.8 seconds).
    If we run the query below with 2 non-spatial subqueries, the result returns and performance is very acceptable (~ 0.9 seconds)-- the result set is about 80000 rows.
    Thanks,
    Jim
    =========================
    SELECT
    COLUMN_WE_WANT , RESULTS
    FROM
    TABLE_A
    WHERE
    COLUMN_WE_WANT IN
    SELECT
    COLUMN_WE_WANT
    FROM
    TABLE_A
    WHERE
    SDO_OVERLAPBDYINTERSECT(TABLE_A.MY_SPATIAL_COLUMN,
    SDO_GEOMETRY(2003,
    4326,
    null,
    SDO_elem_info_array( 1 , 3 , 1 ),
    SDO_ORDINATE_ARRAY( lng_1,lat_1 , lng_2,lat_2 , lng_3,lat_3 , lng_4,lat_4 , lng_1,lat_1 ) )
    ) = 'TRUE'
    OR
    COLUMN_WE_WANT IN
    SELECT
    COLUMN_WE_WANT
    FROM
    TABLE_B
    WHERE
    SOME_PERCENTAGE_RATE_COLUMN < 90
    )

    There is a spatial forum. You will likely have a far better experience there.

  • Logical operators

    I am trying to run the simple following code:
    import java.util.Scanner;
    public class again
         public static void main(String args[])
              int a;
              Scanner scan = new Scanner(System.in);
              a = 0;
              while (a != 1)&&(a != 5)
                   System.out.print("Informe a:");
                   a = scan.nextInt();
    }and it retrieves me an Illegal start of expression error on the while expression and it is the same when I use ||, so I think it is some error abou logical operators. Can anyone guide me into this?

    while ( (a != 1) && (a != 5) ) // <-- note the enclosing parens...~

  • Query form requires Logical operators and/or Quotes

    In ORACLE 9I Jdeveloper beta I used the BC4J JSP wizard to create a - Query Form. The query form looks nice and runs except I have to also include the logical operators (= > <) and Quotes. For example to query on the name Joe I have to enter it as ="JOE". If I use JOE it gives me a JSP error. The error message shows the generated Select statment with the where clause JOE but is missing the "=" and quotes.
    How do I hard code the "=" and quotes around strings so that the user doesn't have to?

    In ORACLE 9I Jdeveloper beta I used the BC4J JSP wizard to create a - Query Form. The query form looks nice and runs except I have to also include the logical operators (= > <) and Quotes. For example to query on the name Joe I have to enter it as ="JOE". If I use JOE it gives me a JSP error. The error message shows the generated Select statment with the where clause JOE but is missing the "=" and quotes.
    How do I hard code the "=" and quotes around strings so that the user doesn't have to?

  • Using comparison operators to solve several different mathematic​al expression​s is not clear

    Though I found LabVIEW very interesting , still some of its basic fundamentals are not clear, like using comparison operators (>,<,..) for solving different
    mathematical expressions. Please give example showing how to use such operators in advanced mathematical problems.
    Best Regards,
    Allawi

    allawi1 wrote:
    What I am looking for is how to use such functions in selecting different mathematical expressions i.e..(working like logical if statement).
    You need to be more specific. A comparison operation IS like a logical IF statement and the result is either TRUE or FALSE.
    What do you mean by a "mathematical expression"? What do you mean by "different"? Can you give an illustrative example?
    If two alternative mathematical expressions should depend on the comparison, wire the comparison output to a case structure and place the two different expressions in their own case, for example.
    LabVIEW Champion . Do more with less code and in less time .

Maybe you are looking for

  • Where can I go to learn about scaling voltage readings from different AI devices?

    Ex. I have a Vaisala HMP 60 RHT sensor. How do I know what to scale the voltage readings to get the correct RH? I have seen values (such as 20 in the linear range for the Vaisala HMT 100), but I don't know where it comes from or why it is chosen. In

  • Secure link to itunes store failed. Itunes 10.5.

    Here is the result of my diagnostic. Apple people please help me. I'm 17, and no knowledge of these technologies. Microsoft Windows 7 Starter Edition (Build 7600) SAMSUNG ELECTRONICS CO., LTD. N150P/N210P/N220P iTunes 10.5.0.142 QuickTime 7.7 FairPla

  • Crashed Computer - need to retrieve my itunes library

    Hello - My computer recently died and I had to buy a new one. I haven't got my itunes library backed up so am trying to reinstate it using my ipod's memory. I really have no clue what I'm doing. I've tried following some instructions on the support p

  • Using html:select with mutiple

    hy, guys!I need some help:I am developing a form were I use a heml:select wich have to use the mutiple selecting function( the user could select more then one option)it looks like this: <html:select property="sectors" multiple="true" size="3" ><html:

  • Bridge for Mac 3.2

    Hello, I'm a switcher from iPhone to Xperia Z because of the Bridge for mac software. I wanted to hace all my photos and videos from My iPhone 4S. I have bought a 32Ggo Micro SD from Samsung, works fine. I have installed Bridge for mac, works fine. M