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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
stark___
Contributor III
Contributor III

Trouble with WHERE in script

Hello,

I have a trouble with function "Where" in script.

I have a  script:

ODBC CONNECT TO [Database MS Access;DBQ=D:\QlikViewAdm\sales.mdb];

SQL SELECT 'Date',

       `Distributor`,

       `Salesman`,

       `Client`,

       `Region`,

       `City`,

       `Product`,

       `quantity`,

       `amount`

FROM `for pivot`;

and I want to download sales only one definite distributor. I try to use such expressions in the script:

WHERE Distributor='GLP JSC'

or

WHERE match(Distributor, 'GLP JSC')

but I always get error: "Syntax error (missing operator) in query expression"

Can you help me?

Best regards, Stark

1 Solution

Accepted Solutions
Not applicable

Hi Stark,

PFA the qvw file.

Hope this helps.

Regards,

Neha Rangari

View solution in original post

7 Replies
happydays1967
Creator
Creator

In my experience, when you do a select on an ODBC source, the SQL dialect used is that of source engine. You might try to create a query in MS Access and then copy the SQL and paste it into your script....

Not applicable

SQL SELECT 'Date',

       `Distributor`,

       `Salesman`,

       `Client`,

       `Region`,

       `City`,

       `Product`,

       `quantity`,

       `amount`

FROM `for pivot`;

and I want to download sales only one definite distributor. I try to use such expressions in the script:

WHERE Distributor='GLP JSC'

or

WHERE match(Distributor, 'GLP JSC');

try this script i think ; this was missed in u r script

jagan
Partner - Champion III
Partner - Champion III

Hi,

Try this script

SQL SELECT 'Date',

       `Distributor`,

       `Salesman`,

       `Client`,

       `Region`,

       `City`,

       `Product`,

       `quantity`,

       `amount`

FROM `for pivot`

WHERE Distributor='GLP JSC';

This should work, if not can you attach full script.

Regards,

Jagan.

stark___
Contributor III
Contributor III
Author

Hello,

I tried your advice, but, unfortunately, it doesn't work. I attached my script and database, can you test it?

Best regards, Stark

Not applicable

Hi Stark,

PFA the qvw file.

Hope this helps.

Regards,

Neha Rangari

stark___
Contributor III
Contributor III
Author

Thank you, it work perfect.

Regards, Stark

stark___
Contributor III
Contributor III
Author

Thank you Jagan, you were right, and your advice is correct. I had to just replace " ; "  from "FROM `for pivot`;" to "WHERE Distributor='GLP JSC';"

Regards, Stark