Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
evansabres
Specialist
Specialist

Join Tables

I have a table called 'POSTS' with several different fields, including 'link'. I have another table called 'VIDEO' with several fields, including one called 'videolink'. The two fields I mentioned are the same, just named differently. What i want to do is join the VIDEO table to the POSTS table, keeping all fields from the POSTS table, but only retain a few fields from the VIDEO table. How would this be done in the script.

5 Replies
Anonymous
Not applicable

Hye,

perhaps something like this

tmp:

Load link as videolink, Var1, var2 ...;

select link, var1,var2 .... from POSTS;

Left join (tmp)

load videolink, listofvar

resident VIDEO;

evansabres
Specialist
Specialist
Author

Sorry, I do not follow, I may not be providing enough information either. My desired end result is one table where all posts show data from both of these tables, where applicable (Not all posts in the Twitter Table will be in the TwitterVideo table, so those that do no appear would be null

Here is my script currently:

Twitter:

LOAD

     [Tweet id] AS TWid,

     [Tweet permalink] AS TWlink,                --This is the common field that I want to join on

     [Tweet text] AS TWpost,

     time As TWdate,

     impressions AS TWimp,

     engagements AS TWeng,

     [engagement rate] AS lTWengrt,

     retweets AS TWrt,

     replies AS TWreplies,

     likes AS TWlikes,

     [url clicks] AS TWlinkclicks,

     [detail expands] AS TWdetailexpands,

     [media views] AS TWmediaviews,

     [media engagements] AS lTWmediaeng

FROM Local Data Source;

TwitterVideo:

LOAD 

      duration AS TWvideolength,

     [playback 25] AS TWvideo25perc,

     [playback 50] AS TWvideo50perc,

     [playback 75] AS TWvideo75perc,

     [playback completes] AS TWvideocomplete,

     [video views] AS TWvideoviews,

     [completion rate] AS TWvideo,

     [topTweet_1 text] AS lTWvideopost,

     [topTweet_1 permalink] AS TWlink  -- This is the common field that I want to link on.

FROM [local data source]

Anonymous
Not applicable

something like this :

MYData1:

Load * INLINE [

MyKey, Var1, Var2, Var3

A,1,1,1

B,1,2,3

C,4,5,6

E,1,2,3

];

MyData2:

Load * INLINE [

MyKey, Var4, Var5, Var6

A,1,1,1

C,1,2,3

E,4,5,6

F,1,2,3

];

join (MYData1)

Load MyKey , Var4, Var5, Var6

resident MyData2;

like a full join

evansabres
Specialist
Specialist
Author

Does it make a difference that these are not inline tables? Both of these tables are coming from different .csv files

Anonymous
Not applicable

no, it's the same.