10 Replies Latest reply: Jan 21, 2016 2:33 AM by Sagar Panda RSS

    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

        • Re: Left Join Query Issue
          Sunny Talwar

          Can you share the script you are using right now?

          • Re: Left Join Query Issue
            jagan mohan rao appala

            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.

            • Re: Left Join Query Issue
              balraj ahlawat

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

               

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

              • Re: Left Join Query Issue
                lakshmi arayaa

                SELECT columns

                FROM table1

                LEFT [OUTER] JOIN table2

                ON table1.column = table2.column;

                 

                hope this help you.

                • 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

                    • Re: Left Join Query Issue
                      Sangram Reddy

                      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

                      • Re: Left Join Query Issue
                        jagan mohan rao appala

                        HI,

                         

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

                         

                        Regards,

                        Jagan.

                      • Re: Left Join Query Issue
                        Sangram Reddy

                        Hi Norma,

                         

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

                         

                        Thanks,

                        Sangram Reddy.

                        • Re: Left Join Query Issue
                          Paul Verkooijen

                          Might be the field :

                          ICAT.part_number(+)

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

                          • Re: Left Join Query Issue

                            Can you post the original script in editor?