Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Association problem due to same attribute names

Hello everyone,

I'm currently struggling with the following situation: I have a table with three columns:

Thread_id (ID of the thread, referring to a thread in a forum)

Creator_id (ID of the thread creator, this references another table with more information about the user)

Participant_Id (ID of the thread participant, this references the previous table with user information as well).

Now the referenced attribute in the user table is called u_id. When I load both creator_id as well as participant_id as u_id, I receive an error. Is it possible to add references to the user table manually? Or does another solution exist?

Regards,

Stephan

4 Replies
Or
MVP
MVP

There's two options here - the easy compromise, and the harder full solution.

Easy: Load the user table twice. Rename u_id in the first instance as Creator_id, and once as Participant_Id. This will give you the details for both, but it will not allow you to select a single user from a single listbox and and see all of their details both as creator as participant. However, if the original post in the thread contains Creator_id = Participant_id, this would probably be an adequate solution.

Hard: Link to a single instance of the description table. This has been covered on this forum, e.g. here and here - I would only go with this option if it is necessary to select the user from a single location and view their data both as participant and creator.

Good luck.

Not applicable
Author

Ok, thanks for your help! I will try to realize the full solution

Not applicable
Author

Unfortunately, I can't really make it work. I currently try the following:

user_map:

Mapping SELECT * FROM users;

SELECT

    thread_id,

    ns_creator_id,

    ns_participant_id,

    Applymap('user_map',ns_creator_id),

    Applymap('user_map',ns_participant_id)

FROM module_network_structure;

Do you see a mistake? I attached the two tables from the viewer as a screenshot.

Or
MVP
MVP

Mapping tables should include two columns - the ID value first, and the name value second. It looks like yours contains significantly more columns than that.

One other small note - you should probably add an alias ( as Creator / as Participant) to your Applymap()s, just to make things easier to look at later.