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

Join two tables

Hi there qlikview community,

I am new to Qlikview and i am trynig to join to tables. So there it is

NV200_Boundaries:

LOAD          Validator,

                    Sensor,

                    High,

                    Low;

SQL SELECT *

FROM `list_a`.`initlimits`;

NV200_Data:

LOAD          TestID,

                    TestDate,

                    SensorName,

                    SensorParam,

                    SensorValue;

 

SQL SELECT

                    SensorStats.TestID,

                    SensorStats.TestDate,

                    SensorValues.SensorName,

                    SensorValues.SensorParam,

                    SensorValues.SensorValue

FROM `office_a_log`.`nv200_init_sensor_header` AS SensorStats

JOIN `office_a_log`.`nv200_init_sensor_log` AS SensorValues

ON SensorStats.TestID = SensorValues.TestID;

I would like to join the tables nv200_boundaries and nv200_data in the key Sensor of the first table which is the same as  Sensor name on the second table. Any help appreciated.

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

If you want to join (not associate) then you can write this LOAD statement :

INNER JOIN (NV200_Boundaries)

LOAD

TestID,

TestDate,

SensorName AS Sensor,

SensorParam,

SensorValue

RESIDENT NV200_Data;

OR

Modfiy the second load statement as follows :

INNER JOIN (NV200_Boundaries)

LOAD          TestID,

                    TestDate,

                    SensorName AS Sensor,

                                      SensorParam,

                    SensorValue;

 

SQL SELECT

                    SensorStats.TestID,

                    SensorStats.TestDate,

                    SensorValues.SensorName,

                    SensorValues.SensorParam,

                    SensorValues.SensorValue

FROM `office_a_log`.`nv200_init_sensor_header` AS SensorStats

JOIN `office_a_log`.`nv200_init_sensor_log` AS SensorValues

ON SensorStats.TestID = SensorValues.TestID;

I hope this helps!

MultiView

View solution in original post

3 Replies
Gysbert_Wassenaar

Rename Sensor to SensorName so qlikview can associate the two tables on that field:

NV200_Boundaries:

LOAD          Validator,

                    Sensor as SensorName,

                    High,

                    Low;

SQL SELECT *

FROM `list_a`.`initlimits`;


talk is cheap, supply exceeds demand
Not applicable
Author

Thanks for the answer for first. The problem is that i dont want only to associate them i want to create a new table that cosist the join of these two tables.

Anonymous
Not applicable
Author

If you want to join (not associate) then you can write this LOAD statement :

INNER JOIN (NV200_Boundaries)

LOAD

TestID,

TestDate,

SensorName AS Sensor,

SensorParam,

SensorValue

RESIDENT NV200_Data;

OR

Modfiy the second load statement as follows :

INNER JOIN (NV200_Boundaries)

LOAD          TestID,

                    TestDate,

                    SensorName AS Sensor,

                                      SensorParam,

                    SensorValue;

 

SQL SELECT

                    SensorStats.TestID,

                    SensorStats.TestDate,

                    SensorValues.SensorName,

                    SensorValues.SensorParam,

                    SensorValues.SensorValue

FROM `office_a_log`.`nv200_init_sensor_header` AS SensorStats

JOIN `office_a_log`.`nv200_init_sensor_log` AS SensorValues

ON SensorStats.TestID = SensorValues.TestID;

I hope this helps!

MultiView