Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
Can anybody confirm whether or not I can use a WHERE clause in an ODBC connection?
For example:
I am able to connect to a MS Access Database and return all values as per below:
Script:
ODBC CONNECT32 TO [MS Access Database;DBQ=C:\Users\hayetom\Qlikview\Examples\Product.accdb];
LOAD `Product_ID`,
`Product_Line`;
SQL SELECT *
FROM `DIM_Prod`;
Which returns:
Product_ID | Product_Line |
1 | VL |
2 | VL |
3 | AB |
4 | AB |
5 | AB |
6 | CD |
7 | CD |
8 | EF |
However, I only want to return rows Where the Product_Line is either 'VL' or 'AB'. I have tried
ODBC CONNECT32 TO [MS Access Database;DBQ=C:\Users\hayetom\Qlikview\Examples\Product.accdb];
LOAD `Product_ID`,
`Product_Line`;
SQL SELECT *
FROM `DIM_Prod` WHERE (Product_ID = 'VL' or Product_ID = 'AB');
NOTE: I appreciate that I can bring all the rows in and then limit my selection on the resident Load BUT I want to limit the data that is brought in the qvw to begin with.
Any ideas?
Try using Product_Line in your Where clause, rather than Product_ID
Try this for your where clause.
where Product_ID in('VL','AB')
Try referring to the field as it appears in the SELECT.
where `Product_ID` in('VL','AB')
Try using Product_Line in your Where clause, rather than Product_ID