Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

= and <> in QV

Hi

I am trying to load the data from the SQL Server using where clause as per the below

LOAD EmployeeID,

    LastName,

    FirstName,

    Title,

SQL SELECT *

FROM Northwind.dbo.Employees

WHERE Country ='UK';

Can anyone please suggest ho to use <>(not equal to) condition with where clause for example if i need to load as per the below statement

LOAD EmployeeID,

    LastName,

    FirstName,

    Title,

SQL SELECT *

FROM Northwind.dbo.Employees

WHERE Country <>'UK';

Thanking You

Vinayagam

1 Solution

Accepted Solutions
its_anandrjs

Try like

LOAD EmployeeID,

    LastName,

    FirstName,

    Title,

SQL SELECT *

FROM Northwind.dbo.Employees

WHERE NOT Country ='UK';

View solution in original post

10 Replies
its_anandrjs

Try like

LOAD EmployeeID,

    LastName,

    FirstName,

    Title,

SQL SELECT *

FROM Northwind.dbo.Employees

WHERE NOT Country ='UK';

Gysbert_Wassenaar

The SQL Select statement is processed by SQL Server, not by Qlikview. But both <> and != should work fine in SQL Server T-SQL for not equal. You do have a comma after Title instead of a semicolon. So the load statement isn't correctly ended. That would cause an error no matter how correct your sql select statement is.


talk is cheap, supply exceeds demand
MK_QSL
MVP
MVP

Where Country NOT IN ('UK');

its_anandrjs

You can use this way also

LOAD EmployeeID,

    LastName,

    FirstName,

    Title,

SQL SELECT *

FROM Northwind.dbo.Employees

WHERE Country <>'UK';

it is working

arjunkrishnan
Partner - Creator II
Partner - Creator II

Hai Frd,

U Just Try This One Replace Of <> (Not Equal to)

........

........

Where Country <> 'UK'

or

.............

.............

Where Not WildMatch(Country,'UK')

or

............

............

Where Not Country='UK'

Not applicable
Author

Yup Thanks Guys i gndeed its grt help ....

MK_QSL
MVP
MVP

Please close the thread by selecting correct/helpful answer.

its_anandrjs

Hi Vinayagam,

If you got correct/helpful answer from thread so mark this correct/helpful for others reference

Thanks & Best Regards

Anonymous
Not applicable
Author

Maybe it's not important in you case, but I have to point out that all these solutions while excluding records where Country='UK' will also exclude records where Country is null.  If you don't have null values in the Country field, you can of course use any of the above.

Regards,

Michael