Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
aschmeelk
Contributor III
Contributor III

Can someone have a look at my code below and maybe point me in the right direction?

I'm trying to filter out certain results from my report and replace a column value with a message.  I'm new to Qlik and not sure that this is legal in the expression editor as I keep getting the error " expected ')' ".  Any help will be appreciated! Code Follows:

if([Casing Status] != ('RELEASED')

OR [Casing Status] != ('SHOP_FLOOR')

    OR [Casing Status] != ('DELETED')

        OR [Casing Status] != ('Casing Completion')

            OR [Casing Status] != ('Complete')

                OR [Casing Status] != ('Posted'), 'Casing not in process', )

8 Replies
sunny_talwar

May be try this

If(NOT Match([Casing Status], 'RELEASED', 'SHOP_FLOOR', 'DELETED', 'Casing Completion', 'Complete', 'Posted'), 'Casing not in process')

its_anandrjs

Or may change the symbol simply

if([Casing Status] <> ('RELEASED')

OR [Casing Status] <> ('SHOP_FLOOR')

    OR [Casing Status] <> ('DELETED')

        OR [Casing Status] <> ('Casing Completion')

            OR [Casing Status] <> ('Complete')

                OR [Casing Status] <> ('Posted'), 'Casing not in process', )

aschmeelk
Contributor III
Contributor III
Author

Thank you Sunny!  That does work great.  But why didn't my nesting OR's work? Is that not allowed in the Expression Syntax?

sunny_talwar

Few issues with it...

1) Not equal in Qlik is <>, not !=

if([Casing Status] != ('RELEASED')

2) Not sure why you use parenthesis around the search string

if([Casing Status] != ('RELEASED')

aschmeelk
Contributor III
Contributor III
Author

The parens were a last ditch experiment to see what happens.  I have not been able to find any concise document concerning Expression Syntax yet, so I try different things based on my experiences with other programming languages.  I appreciate your help, I'm slowly learning what I can and can't do in Qlik.

its_anandrjs

Sunny is right you dont need brackets parenthesis because it is string values and it get manipulate or checked by the if condition.

You can use it both on load script or as well as on calculated dimension

=if([Casing Status] <> 'RELEASED'
OR [Casing Status] <> 'SHOP_FLOOR'
OR [Casing Status] <> 'DELETED'
OR [Casing Status] <> 'Casing Completion'
OR [Casing Status] <> 'Complete'
OR [Casing Status] <> 'Posted', 'Casing not in process')



if([Casing Status] <> 'RELEASED'
OR [Casing Status] <> 'SHOP_FLOOR'
OR [Casing Status] <> 'DELETED'
OR [Casing Status] <> 'Casing Completion'
OR [Casing Status] <> 'Complete'
OR [Casing Status] <> 'Posted', 'Casing not in process') as FieldName


its_anandrjs

It is appreciated Raymond keep doing good things and learn new things in Qlik.

sunny_talwar

We are all learning my friend... I am sure you will learn the syntax in no time