Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
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

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