Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have two tables.
First table is
TW:
twID,
post,
postimp,
posteng
FROM [Internal Data Source]
Video:
twID,
videopost,
videoviews
FROM [Internal Data Source]
They are linked by the field twID. I want to create a field called 'Post Type' where if the number of video views = null, then the post-type is called non-video.
Would this be done in the script or within the application?
You seem to have posted the same question multiple times. This is not a good practice due to the fact that different people will try to answer the question in separate threads while not having the benefit of seeing if the question already has been dealt with. It's a waste of other peoples time.
The Community Guidelines discourage such a practice. Please read them and follow them.
Thanks
Thanks, clearly this was not done intentionally
I found this works adequately as well
Sorry i wrote video instead of 'video'....
Thanks for your help
Using this, I can only get 'video' to return as a value, not 'Non-Video'
Does this have anything to do with the fact that these are only linked tables as opposed to joined tables?
Try using mapping and applymap:
Video:
twID,
videopost,
videoviews
FROM [Internal Data Source];
map_views;
mapping load text(twID) as K1, videoviews as V1 resident Video;
drop table Video;
TW:
load
applymap('map_views', text(twID), 'non-video') as post_type,
twID,
post,
postimp,
posteng
FROM [Internal Data Source]
What do the K1 and V1 represent?
Nothing. They are only a label. But I rename the fields to distinct them from the main table.
Applymap is similar to the concept of VLOOKUP function in excel.