1 Reply Latest reply: Apr 11, 2017 9:47 AM by Sunny Talwar RSS

    Can't add second "and" to expression

    Justin Dallas

      Hello Everyone,

       

      I am using an expression on a Dimension in a chart.  As of now, the expression looks like this, and it is deemed correct by the system.

      if(
        (Num#(ord_number)) 
          and ((ord_startdate < '11/01/2010') 
          or (ord_startdate > today() + 5) 
          or (ord_startdate < '11/01/2010') 
          or (ord_startdate > today() + 5)
         ), ord_number, Null()
       )
      

       

       

      However, as soon as I attach another "and" to the statement, it fails to parse and I get "Error in Expression".  For example.


      FAILS with "Error in expression :')' expected
      
       if(
       (Num#(ord_number)) 
          and (ord_status != 'CAN')
          and ((ord_startdate < '11/01/2010') 
          or (ord_startdate > today() + 5) 
          or (ord_startdate < '11/01/2010') 
          or (ord_startdate > today() + 5)
         ), ord_number, Null()
       )
      

       

       

      How on earth do I add to my statement that "the status should NOT equal 'CAN' to my query?

       

       

      Any help is greatly appreciated.