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're welcome !
Actually, I don't see a problem here, because you're able to join the tables using twID field,
after creating your field on your second, table, you will be able to filter using that field and you will see post, postimp, posteng informations related to that filter value 'null'
did you give it a try ?
The video views field does not exist in the table TW, which is why I am having an issue
Hi Evan,
In the video table, is there is multiple lines for a twID or only one line by twID ?
Hi,
you can try this:
TW:
twID,
post,
postimp,
posteng
FROM [Internal Data Source]
Video:
twID,
videopost,
videoviews,
if(len(trim(videoviews))=0,'non-video') as post_type
FROM [Internal Data Source]
each line has only one twID. For context these are Twitter posts. For each post there is a twID and then various data points. One table has the video views (Video) while the other table does not. Basically, I want to be able to create a filter on post-type where I can choose all fields that are null for video views
Hi Youssef, thank you that does make sense. However I think that I did not provide enough information in my first post. The first table TW, does not have the field videoviews, which is where I am running into the problem
In this case, Youssef answer should works well !
I think I can see how I can make this work for my purposes. How can I expand on this to have something along the lines of, if [video views] <0, 'Non-Video'.
you're welcome !
Actually, I don't see a problem here, because you're able to join the tables using twID field,
after creating your field on your second, table, you will be able to filter using that field and you will see post, postimp, posteng informations related to that filter value 'null'
did you give it a try ?
it should be:
if(isnull(videoviews), 'non-video', 'video')