Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
stekol61
Creator
Creator

Combine AND and OR in an expression

Hi!

I have  some data in a Sense as below.

What I want to do is when the 'Ordering Code' is empty and 'Telsims_Product_Group' contains 'LAN' or 'Telefoni', I want to add 'Broadband' for 'LAN' and 'Voice' for 'Telefoni 'in a new column (Order_new).

 

I have tried with and expression looking like this but it doesn't work as i want :

 

=if ((isnull([Ordering Code])and isnull(Product)) and (Telsims_Product_Group='LAN'),('Broadband') or
(Telsims_Product_Group='Telefoni'),('Voice'))

Any suggestion?

 

AND and OR.PNG

 
 
 

 

1 Solution

Accepted Solutions
lorenzoconforti
Specialist II
Specialist II

=if( isnull([Ordering Code])and isnull(Product), if(Telsims_Product_Group='LAN', 'Broadband', if(Telsims_Product_Group='Telefoni', 'Voice')))

 

Please note that if statements in general are not efficient; it would be better, after you get the function to work, to use a combination of pick match

View solution in original post

2 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try this:

=if ((isnull([Ordering Code]
    , If(Telsims_Product_Group = 'LAN'
        , 'Broadband'
        , If( Telsims_Product_Group='Telefoni'
            , 'Voice'
        )
    )
)

 


talk is cheap, supply exceeds demand
lorenzoconforti
Specialist II
Specialist II

=if( isnull([Ordering Code])and isnull(Product), if(Telsims_Product_Group='LAN', 'Broadband', if(Telsims_Product_Group='Telefoni', 'Voice')))

 

Please note that if statements in general are not efficient; it would be better, after you get the function to work, to use a combination of pick match