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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Manni_SM
Creator
Creator

where condition not working

Hi 

  @Vegar 

below sql query is not showing results as expected

SELECT *
FROM Data.CASE
where INCOPE LIKE 'In%' and "Country" in ('china')
and "ENTITY" not In ('BUS', 'BCA','SBC China','SBC Chna',' ')
and NOT ("ENTITY" IS NULL) ;

my requirment is   wherever  legal entity  = 'BUS', 'BCA','SBC China','SBC Chna',' '  and not isnull    and country =china data should not shown in dashboard    -- china data should not shown in dashboard

but for those legal entity   if we have other country it show as it is .

Country  Entity
china BUS
china BCA
china BCA
US BCA
china SBC China
china CHN limited
china Unknown
china -

 

 

output :

 

   
US BCA
china CHN limited
Labels (3)
1 Reply
Sayed_Mannan
Creator II
Creator II

here is the modified version of your script:-

SELECT *
FROM Data.CASE
WHERE INCOPE LIKE 'In%'
AND (
("Country" = 'china' AND "ENTITY" NOT IN ('BUS', 'BCA', 'SBC China', 'SBC Chna', ' ') AND "ENTITY" IS NOT NULL)
OR ("Country" <> 'china')
);

I hope this helps 🙂