Grouping of multiple criterias as expression

Dear all
I want to do a grouping of multiple criterias as expression .
Single grouping is possible , but when group within a group comes things doesnt work for me.
User would define the comibination
For example i have 4 criterias
C1
C2
C3
C4
Basic grouping works for example :
(C1&C2) | (C3&C4)
Complicated grouping i have no idea how to implement it.
(((C1&C2) | (C3&C4))&(C1&C2) )
I need validate if the expression is correct and need to pick up all the groups and do the AND or OR.
Any help woul dbe appriciated
Regards
pacs

fiveohg wrote:
Complicated grouping i have no idea how to implement it.
(((C1&C2) | (C3&C4))&(C1&C2) )
I need validate if the expression is correct and need to pick up all the groups and do the AND or OR.As already suggested: you could write your own grammar and let a parser-generator create a lexer/parser for you.
Another option is to use some scripting engine and bind your C-variables before evaluating your expression:
import javax.script.*;
public class Foo {
  public static void main(String[] args) throws Exception {
      String expression = "(((C1 && C2) || (C3 && C4)) && (C1 && C2))";
      ScriptEngineManager manager = new ScriptEngineManager();
      ScriptEngine engine = manager.getEngineByName("js");
      engine.put("C1", true);
      engine.put("C2", true);
      engine.put("C3", false);
      engine.put("C4", true);
      System.out.println(engine.eval(expression));
}Note that you cannot user '|' and '&', in that case.
The JavaScript (Rhino) engine is built-in in Java 6, but there are more that can be imported: [https://scripting.dev.java.net/]

Similar Messages

  • Create Dynamic groups with multiple criteria

    Hello,
    I want to create a dynamic group of sql computers in a particular domain.
    What should be the criteria?
    System creates this:
    ((object is windows computer and (dns domain name equals contoso.com) and true) OR (object is SQL computers and (display name matches wildcard *) and True))
    How can I set to below?
    ((object is windows computer and (dns domain name equals contoso.com) and true)
    AND (object is SQL computers and (display name matches wildcard *) and True))
    Thanks

    Use
    the link that Blake already supplied to the site of Jonathan and use this XML part.
    Replace the XXXXXXXXXX of course with the name of your class/group. Don't forget to add a reference to the SQL Server Core Library Management Pack. 
    <RuleId>$MPElement$</RuleId>
    <GroupInstanceId>$MPElement[Name="XXXXXXXXXX"]$</GroupInstanceId>
    <MembershipRules>
    <MembershipRule>
    <MonitoringClass>$MPElement[Name="Windows!Microsoft.Windows.Computer"]$</MonitoringClass>
    <RelationshipClass>$MPElement[Name="SC!Microsoft.SystemCenter.ComputerGroupContainsComputer"]$</RelationshipClass>
    <Expression>
    <Contains>
    <MonitoringClass>$MPElement[Name="MicrosoftSQLServerLibrary!Microsoft.SQLServer.DBEngine"]$</MonitoringClass>
    <Expression>
    <RegExExpression>
    <ValueExpression>
    <HostProperty>
    <MonitoringClass>$MPElement[Name="Windows!Microsoft.Windows.Computer"]$</MonitoringClass>
    <Property>$MPElement[Name="Windows!Microsoft.Windows.Computer"]/DNSName$</Property>
    </HostProperty>
    </ValueExpression>
    <Operator>MatchesRegularExpression</Operator>
    <Pattern>domain.(dev|net)/Pattern>
    </RegExExpression>
    </Expression>
    </Contains>
    </Expression>
    </MembershipRule>
    </MembershipRules>
            </Configuration>

  • Counting rows with multiple criteria

    I know this is a silly beginner question, but is there an easy way to count the number of rows in a table which match criteria based on different columns (sort of a countif with multiple criteria). For example, if Column A in a table has "All, Some, None" responses and Column B has "Main, Off" responses, is there an easy way to count the number of rows in which Column A has All and Column B has Off?

    Neondiet wrote:
    From an intellectual and philosophical view I agree with you. But from a practical view what I really want to do is just use one application for my spreadsheet tasks, not jump back and forth because one sheet I share with MS Windows users, and another with Numbers users, and another with OS X users who don't have Numbers or Excel but do have NeoOffice. Maybe I have to settle for that though.
    Yeah... this kind of situation stinks. Its like needing to writing software that will run on both Macs and PCs.
    Anyway, I've followed the advise in this forum and resorted to using a hidden column with concatenated values to solve my own problem, though it does seem like a bit of a hack compared to managing a single formula in a single cell. Horses for courses I suppose.
    jaxjason has posted a very elegant pivot table like solution that utilizes this technique. See http://www.numberstemplates.com/forums/showthread.php?t=36
    Btw, from what I've read on the net to date, SUM (in Excel) with an array formula answers the original authors problem of counting occurrences of values, not SUMPRODUCT; which I believe sums up the contents of cells in a range, if cells in other ranges match specific criteria.
    Yes, if you use the '*' (as indicated above) then SUM() is sufficient though SUMPRODUCT() will work as it degenerates to SUM when there is only one argument. If you use two arrays as arguments (like: = SUMPRODUCT((A1:A4="All"), (B1:B4="Off")), then SUMPRODUCT() is necessary. Here's my understanding of how it works (I hope your able to follow my abuse of algebraic techniques):
    =SUM((A1:A4="All") * (B1:B4="Off"))
    expanding the array expressions...
    =SUM((A1="All", A2="All", A3="All", A4="All") * (B1="Off", B2="Off", B3="Off", B4="Off"))
    at this point Excel computes the equality expressions, for example...
    =SUM((TRUE, FALSE, TRUE, FALSE) * (TRUE, TRUE, FALSE, FALSE))
    expanding the array multiplication...
    =SUM((TRUE * TRUE, FALSE * TRUE, TRUE * FALSE, FALSE * FALSE))
    Excel, apparently, then, when forced to multiply Boolean values, maps TRUE -> 1 and FALSE -> 0...
    =SUM((1 * 1, 0 * 1, 1 * 0, 0 * 0))
    performing the multiplications...
    =SUM((1, 0, 0, 0))
    summing...
    =1 + 0 + 0 + 0
    resulting...
    =1
    I'm afraid, now, if I continue any further, Yvan will chastise me.

  • Hide Particular Item Group from Selection Criteria of Sales Analysis Report

    Hello Experts,
    Is this possible to Hide Particular Item Group from Selection Criteria of Sales Analysis Report?
    I have one Item Group as 'Special Items'.
    Now, when I open  Item wise sales analysis report, I want to hide above mentioned group from selection criteria.
    Thanks in advance.
    Best Regards,
    Pankit Sheth

    Hi,
    1. Not possible to put validation for selection criteria windows.
    2. In standard, I don't think it is possible to hide only one item group.
    3. Alternatively don't give authorization to user for running sales reports. If still need create customized query and ask user run every month.
    Thanks & Regards,
    Nagarajan

  • SSL Multiple Tunnel Groups with Multiple group policies

    Hello folks.
    Have a query and cant seem to find an answer on the web.
    I have configured SSL Clientless VPN on a lab ASA5510, using 2 tunnel groups, one for enginneers and one for staff, mapped to 2 different group policies, each with different customisation. I have mapped the AD groups to the tunnel groups using both ACS and now LDAP (currently in use), both working successfully, using group lock and LDAP map of IETF-Radius-Class to Group name ensures engineers get assigned to the engineers tunnel group and staff get mapped to the staff tunnel group only.
    The question i have is....is there a way to use a single tunnel group to map the user based on AD group which will then use the correct Group-policy (1 tunnel group to multiple group-polciies). I have seen examples of doing this with different URLs but want to know if they can all use the same URL and avoid using the drop down list using aliases.
    It may be a simple "No" but it would be nice to know how to do it without using the URLs or drop down list. Users are easily confused ......

    Easy. Disable the drop-down list, and use the authentication-server (LDAP or Radius) in the DefaultWEBVPNGroup. By default when you browse to the ASA, it will be using the DefaultWEBVPNGroup. Let LDAP or Radius take care of the rest.
    You will get the functionality you are looking for.
    HTH
    PS. If this post was helpful, please rate it.

  • Tollerence group for multiple user

    hii all
    can any one tell me how shall i assign multiple tollerence group to multiple user? and also tell me, while creating tollerence group am i have to give the tollerence group with co code? or just only co code?? please solve
    regards rajesh Kr Mahato

    Hi,
    'assign multiple tollerence group to multiple user'-it's not possible,in table V_T043 the key is USNAM
    'while creating tollerence group am i have to give the tollerence group with co code? or just only co code??'-I don't understand. In table V_T043T you need to put CC and Tol.group

  • E-mail group for multiple contacts

    I want to creat an e-mail group for multiple contacts so I only need to select the group and then send an e-mail to all the contacts in that group. How do i creat a distribution group in icloud from my Outlook Address book?

    Hi,
    Yes, when logon to ePrint Center, at the top frame, left hand side, there is a place you can +Add Printer. Click to this and follow the instructions.
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • Can't 'find' using multiple criteria anymore

    Did something change in Finder such that we can't set multiple criteria for searches any more? Or is my Finder corrupt in some way?
    In a finder "Find" window, I have the search bar showing "This Mac" the current folder and the options "Contents" and "File Name" -- then there's "Save" and the little '+' icon. It used to be I could add additional search criteria by clicking the '+' (such as file visibility, extension, etc.) -- but now, clicking the '+' just opens an empty space below the existing search bar.
    Is there a 'Simple Finder' setting somewhere that got switched without my knowledge causing this? Or is my Finder borked?
    Thanks,
    Scott

    Well, I'd try moving the finder prefs file, but last night when I went to restart my MBP to deal with something else, on restart all video was gone. I even tried booting into the Apple Hardware Test on the Leopard install DVD, and while it seemed to boot up okay, there was nothing on the screen at all.
    Took it into an Apple Store this morning, and they ran a test, and found the graphics card/chip not even registering - so it looks like I'm into a new logic board. Thanks goodness I got AppleCare this time!!
    So, when I get my baby back, I'll see if the Finder issue is still there, and if so, then I'll try moving the finder prefs file out.
    Thanks,
    Scott

  • Handling Multiple Group ID - Multiple Departments of the same Enterprise

    http://www.b2bgurus.com/2008/07/handling-multiple-group-id-multiple.html
    In step 4 it is mentioned that we have to create just one agreement. Should i create one agreement for each department or will creating one agreement for any department will automatically process the documents for both the departments?

    Create only one Agreement. Make sure to disable the validation.
    Another way of enabling this feature is by using the following tip.property.
    oracle.tip.adapter.b2b.edi.ignoreValidation=<values>
    Provide those identifier which will be different from the configured one. Few of the sample identifiers are as follows:
    InterchangeReceiverID,InterchangeSenderID,GroupReceiverID,GroupSenderID,GroupSenderQual,GroupReceiverQual,InterchangeSenderQual,InterchangeReceiverQual

  • Totals Based on Multiple Criteria in Repeating Rows

    Hi All,
    I have 3 dropdowns (DD1, DD2, DD3) and one textfield (TF1) in repeating rows (not in a table).  Each dropdown has two choices and the textfield is free-form. Outside of the rows (in a different subform) I want totals based on multiple criteria from the dropdowns and textfields.
    The following script works great to get a total number of one choice from one dropdown.
    this.rawValue = xfa.resolveNodes('form1.Form.row[*].DD1.[$.rawValue == "2"]').length;
    Problem is how do I calculate the totals for the following based on the criteria listed in each row.
    Find the totals for ML
    Number of New Forms 1-2 Pages: (result should be 2)
    Number of New Forms 3+ Pages: (result should be 1)
    Number of Revised Form: (result should be 0)
    In row #1:  select “New” as a choice from DD1, “Form” as choice from DD2, “ML” as a choice from DD3 and enter “5” in TF1.
    In row #2:  select “New” as a choice from DD1, “Form” as choice from DD2 , “ML” as a choice from DD3 and enter “1” in TF1.
    In row #3:  select “New” as a choice from DD1, “Form” as choice from DD2, “ML” as a choice from DD3 and enter “2” in TF1.
    In row #4:  select “Revised” as a choice from DD1, “Series” as choice from DD2, “ML” as a choice from DD3 and enter “1” in TF1.
    In row #5:  select “New” as a choice from DD1, “Form” as choice from DD2, “PM” as a choice from DD3 and enter “1” in TF1.

    Try something like;
    var mlNewForms1or2Pages = 0;
    var mlNewFormsOver3Pages = 0;
    var mlRevisedForms = 0;
    var rows = xfa.resolveNodes('form1.Form.row[*]');
    for (var i = 0, limit = rows.length; i < limit; i++)
    var currentRow = rows.item(i);
    if (currentRow.DD1.rawValue == "1") // new
      if (currentRow.DD2.rawValue == "1") // form
       if (currentRow.DD3.rawValue == "1") // ML
        if (parseInt(currentRow.TF1.rawValue, 10) > 2)
         mlNewFormsOver3Pages++;
        else
         mlNewForms1or2Pages++;
    else // revised
      if (currentRow.DD2.rawValue == "1") // form
       if (currentRow.DD3.rawValue == "1") // ML
        mlRevisedForms++
    console.println(mlNewForms1or2Pages);
    console.println(mlNewFormsOver3Pages);
    console.println(mlRevisedForms);
    To do the same using predicates you could do;
    var mlNewForms1or2Pages = 0;
    var mlNewFormsOver3Pages = 0;
    var mlRevisedForms = 0;
    mlNewForms1or2Pages = xfa.resolveNodes('form1.Form.row.[DD1 == 1 and DD2 == 1 and DD3 == 1 and TF1 <= 2]').length;
    mlNewFormsOver3Pages = xfa.resolveNodes('form1.Form.row.[DD1 == 1 and DD2 == 1 and DD3 == 1 and TF1 > 2]').length;
    mlRevisedForms = xfa.resolveNodes('form1.Form.row.[DD1 == 2 and DD2 == 1 and DD3 == 1]').length;
    But if you wanted totals for all the permutations then this could become slow.
    Regards
    Bruce

  • Assignment of single Sales group to multiple Sales offices not possible

    Hi all,
    We need to assign single sales group to multiple sales offices in CRM. When we try to assign a Sales group to more than one Sales office the first assignment between Sales group and Sales office is removed. Only the new assignment is available.
    Instead of having two assignments I still only get one.
    First I transfered the ECC organization as Standard backend integration. When I realize I needed multiple backend assignment I ran the Conversion to multiple assignments. However, I am not able to realize multiple assignments.
    Is it not possible to realize multiple assignment if you first transfered the ECC organization as standard (single) assignment?
    Please let me know how to overcome this problem.
    Regards
    Anders

    Hello Anders,
    Starting CRM 4.0 multiple hierarchy with this enhanced org data model
    works the following way:
    - 1 R/3 org data mapped to ONLY 1 CRM org unit.
    - multiple hierarchy (1 sales office assigned to several sales org,
    1 sales group assigned to several sales office) is managed in the detail
    of the org unit with tab Function and with sub tab sales office
    and sales group.
    For example if you have following R/3 org structure:
    Sales org SOr1
    _ Sales office Sof1
          _ Sales Group Sg1
    _ Sales office Sof2
          _ Sales Group Sg1
    Sales org SOr2
    _ Sales office Sof1
    In PPOMA_CRM you have to do the following:
    For the R3 mapping :
    Sor1 mapped to org unit 50000001
    Sor2 mapped to org unit 50000002
    Sof1 mapped to org unit 50000003
    Sof2 mapped to org unit 50000004
    Sg1 mapped tp org unit 50000005
    And for the multiple assignment
    - For sales org 50000001 and 50000002 you just have to maintain in tab
    function, sub tab Sales org the Distribution channel division values
    - For sales office 50000003 in sub tab Sales office the assignment to
    sales org Sor1 and Sor2
    - For sales office 50000004 in sub tab Sales office the assignment to
    sales org Sor1
    - For sales group 50000005 in sub tab sales group the assignment to
    sales office Sof1 and Sof2.
    If you have different division distribution channel on sales office sale
    group compared to the sales org you can maintain manually the values.
    Or if is it always the same values you can use * value for distribution
    channel division (in that case please read carefully notes
    691015 and 735020 if needed)
    In addition regarding report CRMC_R3_ORG_GENERATE I would like to
    clarify that this report can only be used for initial download, as
    written in the customzing documentation of this report (spro-CRM -
    master data -  org management - data transfer - Copy SAP R/3 sales
    structure ) it can only be executed once and so following org
    modifications have to be done manually in PPOMA_CRM.
    So for this report the correct way to use it is to create all the R/3
    org data in 1 shot.
    If only 1 R/3 org data is already mapped to a CRM org unit in ppoma_Crm
    you will have red light and so it will be impossible to create all
    dependent org data.
    Hoping i have been able to clarify how it works.
    Regards, Gerhard

  • Adding Multiple Records with Express

    Hello All,
    We have a CRUD application written in Express 2.0 that allows users to
    enter part numbers and associated information. Our part numbers are
    structured as a prefix, alpha, suffix and 'M' or 'P' number variations :
    1 AB 2 P3 for example. We have provided functionality to allow the
    user to enter multiple P or M variations all at once, say 1 AB 2 P1 thru
    P100,
    using a dialog box where they enter the starting number, ending number
    and step.
    The problem comes in the AddRecordsToSave method.
    This method correctly builds the array of BusinessClass needed to be
    passed to the Save method, however, the Save method adds only the
    initial record (the one from the original Express data entry screen)
    to the database.
    I have traced the problem to the BusinessClient.Update method called
    from
    Save. I believe I am missing some query information that should be
    built into
    AddRecordsToSave, but I am completely unsure of how to provide this.
    As you can see in the attached code, we are using the LogAttr method to
    post
    changes. Apparently this is not enough. What am I missing here?
    The InstanceStatus key of the added records is set to ST_EMPTY by
    default....
    I have tried forcing this to ST_UPDATE, only to receive an error that it
    should
    be ST_EMPTY......?? I am confused. If anyone can shed some light on this
    for me,
    I would appreciate it. Thanks for any help.
    Scott Guman E-mail: [email protected]
    IRM Analyst II Phone: (610) 709-2144
    Mack Trucks, Inc. Fax: (610) 709-4713
    Allentown, PA 18105

    Hi There,
    If attr is not specified in your LogAttr() call, the
    BusinessClass
    will be put in the update state but not attributes will
    be logged.
    That may be the reason why only the displayed record(
    fetched from
    the DB ) is getting logged, but not the new records.
    I think you should use ATTR_SIMPLE with LogAttr. This
    will cause
    all the attributes to be logged and a proper query to
    be built
    to insert the newly created record. I am no Express
    Guru,
    but it works fine for me. Also, try not to modify
    InstanceStatus directly.
    Sometimes it might lead to inconsistencies. The online
    help
    The Add Records to Save example really helps.
    Good luck!
    Ajith Kallambella. M.
    Forte Systems Engineer,
    International Business Corporation
    -----Original Message-----
    From: Scott Guman [SMTP:[email protected]]
    Sent: Wednesday, September 16, 1998 9:34 AM
    To: 'Forte Users'
    Subject: Adding Multiple Records with Express
    Hello All,
    We have a CRUD application written in Express 2.0 that
    allows users to
    enter part numbers and associated information. Our
    part numbers are
    structured as a prefix, alpha, suffix and 'M' or 'P'
    number variations :
    1 AB 2 P3 for example. We have provided functionality
    to allow the
    user to enter multiple P or M variations all at once,
    say 1 AB 2 P1 thru
    P100,
    using a dialog box where they enter the starting
    number, ending number
    and step.
    The problem comes in the AddRecordsToSave method.
    This method correctly builds the array of BusinessClass
    needed to be
    passed to the Save method, however, the Save method
    adds only the
    initial record (the one from the original Express
    data entry screen)
    to the database.
    I have traced the problem to the BusinessClient.Update
    method called
    from
    Save. I believe I am missing some query information
    that should be
    built into
    AddRecordsToSave, but I am completely unsure of how to
    provide this.
    As you can see in the attached code, we are using the
    LogAttr method to
    post
    changes. Apparently this is not enough. What am I
    missing here?
    The InstanceStatus key of the added records is set to
    ST_EMPTY by
    default....
    I have tried forcing this to ST_UPDATE, only to receive
    an error that it
    should
    be ST_EMPTY......?? I am confused. If anyone can shed
    some light on this
    for me,
    I would appreciate it. Thanks for any help.
    Scott Guman E-mail:
    [email protected]
    IRM Analyst II Phone: (610) 709-2144
    Mack Trucks, Inc. Fax: (610) 709-4713
    Allentown, PA 18105
    << File: AddRecordsToSave.txt >>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

  • Share an ASM disk group among multiple nodes

    According to Oracle documentation:
    *“To share an ASM disk group among multiple nodes, you must install Oracle Cluster ware on all of the nodes, regardless of whether you install Oracle RAC on the nodes”.*
    And if I understand it right to share the same ASM storage group from multiple nodes from separate RACs or multiple non-RAC nodes ASM instances in those nodes need to communicate to synchronize ASM related metadata using same technique like cache fusions.
    My question is how this ASM communication take place among different ASM instances located in different RACs and standalone servers. Do we have to have some kind of Interconnect settings among the nodes?

    Hi,
    ASM and database instances require shared access to the disks in a disk group. ASM instances manage the metadata of the disk group and provide file layout information to the database instances.
    ASM instances can be clustered using Oracle Clusterware; there is one ASM instance for each cluster node. If there are several database instances for different databases on the same node, then the database instances share the same single ASM instance on that node.
    If the ASM instance on a node fails, then all of the database instances on that node also fail. Unlike a file system failure, an ASM instance failure does not require restarting the operating system. In an Oracle RAC environment, the ASM and database instances on the surviving nodes automatically recover from an ASM instance failure on a node.
    see this link
    http://download.oracle.com/docs/cd/B28359_01/server.111/b31107/asmcon.htm :)

  • Grouping & Back-references with regular expressions on Replace Text window

    I really appreciate the inclusion of the Regular Expressions in the search & replace feature. One thing I am missing is back-references in the replacement expression. For instance, in the unix tools vi or sed, I might do something like this:
    s/\(firstPart\) \(secondPart\) \(oldThirdPart\)/\2 \1 newThirdPart/g
    which would allow me to switch the places of firstPart and secondPart, and totally replace thirdPart. If grouping and back-references are already present in the Replace Text window, how does one correctly invoke them?

    duplicate of Grouping & Back-references with regular expressions on Replace Text window

  • Item Group on Multiple WH

    Dear all,
    is it possible in SBO to maintain item group on multiple Warehouse. For example, I have Item 0100001 that has item group A in warehouse I and II. Each item group in each Warehouse has different account determination. so, I can show in Balance Sheet, value amount of group A in warehouse I and group A in warehouse II.
    Thanks for the help

    It is possible to set G/L's only Warehouse Wise, Item Group Wise or Item Wise.
    Even if the G/L codes are set, it is possible for the user to choose the G/L code in the Transaction screen of the Marketing documents through which you can achieve your required functionality.

Maybe you are looking for

  • HELP NEEDED ,Syntax Error.

    Whenever i try to execute the following program, i get the following syntax error. "ALPHA AND IT-F1 ARE TYPE-INCOMPATIBLE." data: begin of it occurs 12,           f1,           end of it,           alpha(12) value 'ABCDEFGHIJKL'. do 12 times varying

  • Is there a way to change the snooze interval for reminders?

    I've dug around in the preference and looked online, but I can't see a way to change how often it reminds you about an alert if you hit snooze.  I liked having the option to delay things by an hour or a day like I could for alerts in Lion.  Thanks!

  • Cannot install Adobe Air on new MacBook Pro - Help!

    I have a brand new MacBook Pro and I am trying to install a program from Real Networks called Rinse (cleans up your iTunes).  When installing Rinse, I get a message that says the program requires Adobe Air and that I will need to download and install

  • Photo orientation with AppleTV

    Hello all I have been having some problems with photo orientation in AppleTV screen saver and in viewing the iPhoto library on AppleTV. I did all the usual things, restarted the Apple TV, restarted computer, etc. What was really strange was the photo

  • ADL in Adobe AIR 3.1 crashes then works then crashes then works

    Hi, I'm using Adobe AIR 3.1 to create an HTML/Javascript application. Whenever I go to run the application using "adl", I'll get the message "Adobe AIR Debug Launcher has stopped working".  If I repeat this several times, the application will eventua