Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am looking for guidance on how to join two tables. I have read some of the guides on here, which are helpful, but I cannot get my table to produce as desired.
TwitterNew:
LOAD
TWID,
TWlink,
TWpost,
TWdate,
TWimp,
TWeng,
TWengrt,
TWrt,
TWreplies,
TWlikes,
TWlinkclicks,
TWdetailexpands,
'Acme INC' AS brandNME,
'Twitter' AS TWplat
:FROM [internal data source]
I want to join this table to this table:
TwitterVideo:
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 TWvideocompletionrate
topTweet_1 text] AS TWvideopost,
[topTweet_1 permalink] AS TWlink,
'Buffalo Bills' AS TWvideobrand,
'Twitter' AS TWvideoTW
FROM [Internal Data Source]
I want to join the tables on TWlink, which are shared fields. The desired result is a table that displays data from each table in one summary table. The sticking point (maybe) is that not every TWpost from the Table TwitterNew, has data from the TwitterVideo table, but some do.
How can this be done in the script?
Why joining these tables? I think keeping both and using the association between them will be the better approach.
- Marcus
That is how I currently have this set-up in my script, which works well. However, my ultimate end goal is to have a summary table that displays all of the data from these two tables as well as about a dozen others. I suppose I would do this using CONCATENATE
I wouldn't use a concatenation because both tables have only one field in common else I would add a 'missing' value for those key-values which are missing. This could be done with an additionally load which concatenated the missing values to the other table with a where not exists() approach: Re: issue with EXISTS, appending data to a table.
- Marcus