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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to join list of Ids to lookup table?

I have a field that is a list of IDs, and I am trying to count things up by a field on a lookup table.  I haven't been able to get a match to work, so I'm wondering if there is a way to do this, or if I need to split up the list in order to join these 2 tables?  I've been trying something along the lines of match(membership,membership_list).

I would like a straight table with the person_id and the membership type or a count of distinct person_ids in each type (x or z).

person_membership:

person_idmembership_list
1abc, def, 123
2123, abc

membership:

membershiptype
abcx
def

z

123x
3 Replies
sunny_talwar

Try like this:


person_membership:

LOAD person_id,

           SubField(membership_list, ', ') as membership,

           membership_list

FROM person_membership;


membership:

LOAD memebership,

           type

FROM memebership;

sunny_talwar

You can explicitly join like this:

person_membership:

LOAD person_id,

          SubField(membership_list, ', ') as membership,

          membership_list

FROM person_membership;


Join (person_membership)

LOAD memebership,

          type

FROM memebership;

maxgro
MVP
MVP

person_membership:

LOAD person_id,

     trim(subfield(membership_list, ',')) as membership

FROM

[https://community.qlik.com/thread/236681]

(html, codepage is 1252, embedded labels, table is @1);

membership:

LOAD trim(membership) as membership,

     type

FROM

[https://community.qlik.com/thread/236681]

(html, codepage is 1252, embedded labels, table is @2);

1.png