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

Query

I would like to know how can I achieve this SQL query in Qlikview?


SELECT *
FROM tab1 a, tab2 b
where a.AY=b.A_Y
and a.Sem=b.SEM
and a.CC=b.C_CDE& "-" &U_C
and b.ROLE='XXX'
and a.FID <> b.O_PNO;

5 Replies
Jason_Michaelides
Luminary Alumni
Luminary Alumni

Data:

LOAD * ;

SQL

SELECT *

FROM tab1 a, tab2 b

where a.AY=b.A_Y

and a.Sem=b.SEM

and a.CC=b.C_CDE& "-" &U_C

and b.ROLE='XXX'

and a.FID <> b.O_PNO;

Simples!

Not applicable
Author

My source tab1 and tab2 are actually exported into excel spreadsheet. Can the above still achieve the same result?

Jason_Michaelides
Luminary Alumni
Luminary Alumni

Yes of course.  Use the wizard to get something like the below, then add the WHERE clause before the last ;

Data:

LOAD *

FROM (Data.xls blah blah blah)

where a.AY=b.A_Y

and a.Sem=b.SEM

and a.CC=b.C_CDE& "-" &U_C

and b.ROLE='XXX'

and a.FID <> b.O_PNO;

Not applicable
Author

I put my data into access database. When I tried the recommended solution 1, it gave me an error:SQL##f - SqlState: 07001, ErrorCode: 4294964286, ErrorMsg: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.

Any advise?

Jason_Michaelides
Luminary Alumni
Luminary Alumni

Can you post your qvw and access DB?

Are you sure you have the ODBC connection set up correctly?