Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Not applicable

Left join 3 Tables

Hello,

Try to load part of table into QlikSense, but there is no examples about join in SQL queries.

I try to use standart sql syntax, but engine return error. What is wrong?

SQL SELECT "Sales_Date",

    "Doc_Type",

    "Doc_ID",

    "REP_id",

    "SKU_ART"

FROM Sales.dbo.Sales as t1 left join Sales.dbo.SKU t2 on t1.SKU_ART = t2.SKU_Art

left join Sales.dbo.REP t3 on t1.REP_id=t3.REP_id

where t3.REP_Department like 'abc' OR t2.P_Format like '123';

5 Replies
MVP
MVP

Re: Left join 3 Tables

Everything after the "SQL" to the terminating semi-colon is passed as a SQL statement to your DBMS. Any error that you get is an error on the DBMS, not in Sense. The join is also happening in the DBMS, not in Sense.

You will need to understand what error you are getting to fix the problem.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable

Re: Left join 3 Tables

error 209, something about column name

Is my syntax for query correct?

Not applicable

Re: Left join 3 Tables

When i try to use this query on SQL without Qlik -- all is OK.

MVP
MVP

Re: Left join 3 Tables

The syntax is correct, but it seems you are referring to a column name that is misspelled or doesn't exist or is an type error (whatever "something" means). As I said, this is not a Sense error, this is a SQL error. Fix the SQL query and the load statement will work.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
MVP
MVP

Re: Left join 3 Tables

>>When i try to use this query on SQL without Qlik -- all is OK.

Then the problem is most likely that you are connecting with different credentials.Are you using Sense server? Make sure that the Sense service account has access to all the tables referenced in the SQL statement,

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Community Browser