Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: 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?

18 Replies
petter
Partner - Champion III
Partner - Champion III

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

evansabres
Specialist
Specialist
Author

Thanks, clearly this was not done intentionally

evansabres
Specialist
Specialist
Author

I found this works adequately as well

captain89
Creator
Creator

Sorry i wrote video instead of 'video'....

evansabres
Specialist
Specialist
Author

Thanks for your help

evansabres
Specialist
Specialist
Author

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?

captain89
Creator
Creator

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]

evansabres
Specialist
Specialist
Author

What do the K1 and V1 represent?

captain89
Creator
Creator

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.