Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
JustinDallas
Specialist III
Specialist III

Can't add second "and" to expression

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.

1 Solution

Accepted Solutions
sunny_talwar

Try <> instead of !=

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()

)

View solution in original post

1 Reply
sunny_talwar

Try <> instead of !=

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()

)