Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
JustinDallas
Valued Contributor II

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

Re: Can't add second "and" to expression

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

)

1 Reply

Re: Can't add second "and" to expression

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

)