Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
evansabres
Specialist
Specialist

Joined Table

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?

1 Solution

Accepted Solutions
YoussefBelloum
Champion
Champion

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 ?


View solution in original post

18 Replies
evansabres
Specialist
Specialist
Author

The video views field does not exist in the table TW, which is why I am having an issue

fannybenand
Partner - Contributor III
Partner - Contributor III

Hi Evan,

In the video table, is there is multiple lines for a twID or only one line by twID ?

YoussefBelloum
Champion
Champion

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]

evansabres
Specialist
Specialist
Author

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

evansabres
Specialist
Specialist
Author

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

fannybenand
Partner - Contributor III
Partner - Contributor III

In this case, Youssef answer should works well !

evansabres
Specialist
Specialist
Author

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'.

YoussefBelloum
Champion
Champion

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 ?


captain89
Creator
Creator

it should be:

if(isnull(videoviews), 'non-video', 'video')