Rules with IF AND and IF OR

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Rules with IF AND and IF OR


      i am struggling with finding the right syntax for using rule formulaes with IF AND / IF OR.

      So for example

      What is syntax for;

      1) IF AND : IF !'Product' == "Car" AND !'Color' == "Green" THEN xxxx ELSE yyyy
      2) IF OR : IF !'Product' == "Bicycle" OR !'Color' = "Blue" THEN xxxx ELSE yyyy

      Thank you,
      Joergen Dalby
    • Hi Joergen,
      in Cube Rules you have to think a bit like in Excel when you're combining functions.
      So your IF AND rule would look like this:
      If (AND (!'Product' == "Car", !'Color' == "Green"), xxxx, yyyy)

      If you are unsure of the syntax of some rules, try using the editor first. It's a lot of clicking, but you get the syntax and can do the editing in the Rule itself then.

      EDIT: Same applies for OR:
      If (OR (!'Product' == "Bycicle", !'Color' == "Blue"), xxxx, yyyy)