Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

Left Join Query Issue

Hi , I'm new to Qlik Sense. I have a query connected to access.  Trying to do a left join, but when I type after my table Qlik is telling me I have an extra ")".  Can anyone help?

Note: Title edited by Community Moderator for clarification and brevity

10 Replies

Re: Left Join Query Issue

Can you share the script you are using right now?

MVP
MVP

Re: Left Join Query Issue

Hi,

Syntax for Left Join in Qlik is like below

Data:

SELECT

*

FROM Table1;

LEFT JOIN(Data)

SELECT

*

FROM Table2;

Hope this helps you.

Regards,

Jagan.

balrajahlawat
Esteemed Contributor

Re: Left Join Query Issue

It seems you have added one extra ')' in your code.

Sharing your code might help us to tell you the solution for same...

Not applicable

Re: Left Join Query Issue

SELECT columns

FROM table1

LEFT [OUTER] JOIN table2

ON table1.column = table2.column;

hope this help you.

Not applicable

Re: Left Join Query Issue

Thanks for your responses.

So here is my code.

The following error occurred:

SQL##f - SqlState: 37000, ErrorCode: 4294964196, ErrorMsg: [Microsoft][ODBC Microsoft Access Driver] Extra ) in query expression 'REG.regionID = TER.regionID AND SD.PART = ICAT.part_number(+) AND DLR.dealerID = SD.dealerID AND DV.divisionID = SD.divisionID AND REPS.repID = SD.repID AND SRC.source = SD.source AND TER.territory'.

The error occurred here:

SALESDETAIL:

SQL SELECT SD.ID, REPS.repOracleName, REPS.repLastName & ', ' & REPS.repFirstName AS name, SD.repID, REPS.repType, SD.dealerID, DLR.dealerName, SD.territoryID, SD.INVNO, SD.INVDATE, SD.EXTCOST, SD.ZIP, SD.zipThree, TER.territoryNumber, SD.divisionID, TER.territoryType, DV.divisionName, REG.regionID, REG.regionName, REG.regionSort, SD.saleMonth, SD.saleYear, SD.payMonth, SD.payYear, SD.realigned, SD.source, SRC.sourceText, SRC.sourceOrder, DLR.dealerFreightForward, SD.div_long, SD.PART, SD.QUANTITY, ICAT.categoryID

FROM region AS REG, territory AS TER, source AS SRC, REPS, divisions AS DV, dealer AS DLR, salesdetail AS SD, item_categories AS ICAT

WHERE REG.regionID = TER.regionID

AND SD.PART = ICAT.part_number(+)

AND DLR.dealerID = SD.dealerID

AND DV.divisionID = SD.divisionID

AND REPS.repID = SD.repID

AND SRC.source = SD.source

AND TER.territoryID = SD.territoryID

and SD.saleYear > 2010

ORDER BY TER.territoryNumber, SD.divisionID

reddys310
Honored Contributor II

Re: Left Join Query Issue

Hi Norma,

Please share your code as it would be easy to solve your issue.

Thanks,

Sangram Reddy.

reddys310
Honored Contributor II

Re: Left Join Query Issue

Hi Norma,

The "FROM" statement should be fetching data from a physical table. Where are you query points to some field names. What is the name of the table you are fetching the data from?

SALESDETAIL:

SQL SELECT SD.ID, REPS.repOracleName, REPS.repLastName & ', ' & REPS.repFirstName AS name, SD.repID, REPS.repType, SD.dealerID, DLR.dealerName, SD.territoryID, SD.INVNO, SD.INVDATE, SD.EXTCOST, SD.ZIP, SD.zipThree, TER.territoryNumber, SD.divisionID, TER.territoryType, DV.divisionName, REG.regionID, REG.regionName, REG.regionSort, SD.saleMonth, SD.saleYear, SD.payMonth, SD.payYear, SD.realigned, SD.source, SRC.sourceText, SRC.sourceOrder, DLR.dealerFreightForward, SD.div_long, SD.PART, SD.QUANTITY, ICAT.categoryID

FROM region AS REG, territory AS TER, source AS SRC, REPS, divisions AS DV, dealer AS DLR, salesdetail AS SD, item_categories AS ICAT

WHERE REG.regionID = TER.regionID

AND SD.PART = ICAT.part_number(+)

AND DLR.dealerID = SD.dealerID

AND DV.divisionID = SD.divisionID

AND REPS.repID = SD.repID

AND SRC.source = SD.source

AND TER.territoryID = SD.territoryID

and SD.saleYear > 2010

ORDER BY TER.territoryNumber, SD.divisionID

MVP
MVP

Re: Left Join Query Issue

HI,

Is this statement working in database?  If it works there then it will definitely work in Qlikview.

Regards,

Jagan.

p_verkooijen
Valued Contributor

Re: Left Join Query Issue

Might be the field :

ICAT.part_number(+)

try to use [ICAT.part_number(+)] instead

Community Browser