Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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_id | membership_list |
---|---|
1 | abc, def, 123 |
2 | 123, abc |
membership:
membership | type |
---|---|
abc | x |
def | z |
123 | x |
Try like this:
person_membership:
LOAD person_id,
SubField(membership_list, ', ') as membership,
membership_list
FROM person_membership;
membership:
LOAD memebership,
type
FROM memebership;
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;
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);