Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
adarshiyerck
Contributor II
Contributor II

Exclude multiple values in a field using load script where clause in qliksense (Data source: Hive)

Hello Everyone,

I am stuck with a situation where I need to exclude multiple values in load script from a field in Qliksense. I have tried following - 

Query 1:

SQL SELECT *
FROM HIVE.DBName.Table Name where [Field] <> 'value1' or [Field] <> 'value2' or [Field] <> 'value3'; I can still see the values after load

 
Query 2:
SQL SELECT *
FROM HIVE.DBName.Table Name where [Field] != 'value1' or [Field] != 'value2' or [Field] != 'value3';
I can still see the values after load
 
Query 3:
SQL SELECT *
FROM HIVE.DBName.Table Name where [Field] != 'value1';
Works if I use only 1 value
 
Query 4:
SQL SELECT *
FROM HIVE.DBName.TableName  Where not  match([Field],'Value1','Value2','Value3');
error syntax match not found
 
Any suggestions here or workaround how this can be achieved?
2 Solutions

Accepted Solutions
Vegar
MVP
MVP

You need to use SQL query syntax in a SQL SELECT query. 

 

Try this:

SQL SELECT *
FROM

HIVE.DBName.TableName 

WHERE Field NOT IN ('Value1','Value2','Value3');

View solution in original post

Pirolli
Partner - Contributor
Partner - Contributor

Vegar's reply is best; if you want to keep the syntax in Qlik language you will need to use the Query4 syntax (or your syntax from Query 1):

Load *

Where not match(field,'value1','value2');

SQL SELECT *
FROM HIVE.DBName.Table;

This will use a preceding load from the HIVE database; although all rows will be returned to Qlik from the HIVE database. Again, Vegar's response to inject the where clause using native database language is best.

View solution in original post

5 Replies
Vegar
MVP
MVP

You need to use SQL query syntax in a SQL SELECT query. 

 

Try this:

SQL SELECT *
FROM

HIVE.DBName.TableName 

WHERE Field NOT IN ('Value1','Value2','Value3');

adarshiyerck
Contributor II
Contributor II
Author

Hello Vegar,

This solution works, can I extend this condition by adding 'and' date>=20190101; further?

Pirolli
Partner - Contributor
Partner - Contributor

Vegar's reply is best; if you want to keep the syntax in Qlik language you will need to use the Query4 syntax (or your syntax from Query 1):

Load *

Where not match(field,'value1','value2');

SQL SELECT *
FROM HIVE.DBName.Table;

This will use a preceding load from the HIVE database; although all rows will be returned to Qlik from the HIVE database. Again, Vegar's response to inject the where clause using native database language is best.

adarshiyerck
Contributor II
Contributor II
Author

Hello Pirolli,

Yes this helps too. Thank you.

adarshiyerck
Contributor II
Contributor II
Author

Any thoughts on this

nesting another condition in where clause after excluding values filter using date field