8 Replies Latest reply: Jun 13, 2012 11:56 AM by Darrel Donatto RSS

    Help understanding key filed joins between tables in SQL database

      I am looking for some help in understanding the key field joins between tables in an SQL database that is connected to Qlikview.  We have an SQL database with tables that are all joined by a common key field named PDOCSNUMBER.  This field contains a unique key that links the fields together. 

       

      My script looks like this:

      ODBC

      CONNECT TO EmergencyPro;

      //-------- Start Multiple Select Statements ------

      SQL SELECT PCOCSNUMBER

      FROM EmergencyPro.dbo."tbl_INCIDENT_DATA_2";



      SQL SELECT "NOC_AT_SCENE"

      FROM EmergencyPro.dbo."tbl_INCIDENT_DATA_2";



      SQL SELECT PCOCSNUMBER

      FROM EmergencyPro.dbo."tbl_MEDICATIONS";



      SQL SELECT MEDICATION

      FROM EmergencyPro.dbo."tbl_MEDICATIONS";



      SQL SELECT PCOCSNUMBER

      FROM EmergencyPro.dbo."tbl_INTERVENTIONS";



      SQL SELECT "TYPE_INTERVENTION"

      FROM EmergencyPro.dbo."tbl_INTERVENTIONS";

      //-------- End Multiple Select Statements ------

       

       

      TableView.PNG

       

       

      However, the three different tables are not being associated (joined) by Qlikview when I look at the table view.  I am under the assumption that because the tables contain a commonly named field, they will automatically be associated.

       

      Any advice of help you can offer would be appreciated.