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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How do I make sql query in qlikview

Hello,

I have made a where sql query in qlikview, but it does not work. I want only see the city bangkok.

Can someone help me?

The code is:

Land1:

LOAD Land,

     City,

  

  

FROM

Gegevensbronnen\Land1.csv

(txt, codepage is 1252, embedded labels, delimiter is ',', msq, no eof)

WHERE City = ("Bangkok");

12 Replies
Anonymous
Not applicable
Author

This:

...

WHERE City = 'Bangkok';

anbu1984
Master III
Master III

WHERE WildMatch(City,"Bangkok");

Anonymous
Not applicable
Author

load city

from

yourfile

where city ='bangkok'

Not applicable
Author

Use:

Land1:

LOAD Land,

     City

FROM

Gegevensbronnen\Land1.csv

(txt, codepage is 1252, embedded labels, delimiter is ',', msq, no eof)

WHERE City = 'Bangkok';

Not applicable
Author

And you need a log in Sub or somthing else:

sub connectToDB

if (vERP = 'cee') then
   if (vDBType = 'mssql2005') then
   ODBC CONNECT32 TO [STS_SC] (XUserId is Matthias, XPassword is abcd);  
  else
   ODBC CONNECT TO CEE_5_BDV (XUserId is Matthias, XPassword is abcd);
  end if
  elseif (vERP = 'css') then
   ODBC CONNECT TO CSS_export (XUserId is Matthias, XPassword is abcd);

else
   //  f. Postgres or  SQL Server)
  if (vDBType = 'mssql2005') then
   ODBC CONNECT32 TO $(vODBC_DSN);
  else
   ODBC CONNECT64 TO $(vODBC_DSN);
  end if
  end if
end Sub

Not applicable
Author

After Then:

$(Include=$..\..\connect.qvs);

call connectToDB;

LOAD field_a AS account, field_b AS sales
...;
SQL SELECT * FROM account;

Not applicable
Author

the qvs is a C# script and the other "Include...LOAD... SQL; is in the Script of the Generator. I hope it help you!

awhitfield
Partner - Champion
Partner - Champion

HI Maichel

Single quotes around Bankok, and it's case sensitive too!

Land1:

LOAD Land,

     City,

  

  

FROM

Gegevensbronnen\Land1.csv

(txt, codepage is 1252, embedded labels, delimiter is ',', msq, no eof)

WHERE City = 'Bangkok';

Not applicable
Author

thanks for info,

But I have the cities in a table, when I use the where City = 'Bangkok' then qlikview shows all cities.

Do you know what I can do that I only get bangkok and not all cities?

thanks in advance.