Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
mario-sarkis
Creator II
Creator II

Join Fucntion Question

Hey All

how can solve this in the script ? here is a sample of data that i have

Table A
IDUser
1MA
2MA
3SA
4SA
5SE
6SE

Table B
ID2USER
2MA
3SA
5SE

RESULT That i need:

RESULT
IDID2User
1 MA
22MA
33SA
4 SA
55SE
6 SE

i need to compare the IDs if equals need to create a field that said allocated and null if not , and another field called 'AllIds'

FInal output:

IDIDUser Flag1Flag2
1 MA allIds
22MAallocatedallIds
33SAallocatedallIds
4 SA allIds
55SEallocatedallIds
6 SE allIds

thank you hope you can help

1 Solution

Accepted Solutions
prma7799
Master III
Master III

4 Replies
Gysbert_Wassenaar

LOAD

     ID,

     User,

     'allds' as Flag2

FROM .... ;

left join

LOAD

     ID2 as ID,

     ID2,

     USER as User,

     'allocated' as Flag1

FROM .... ;


talk is cheap, supply exceeds demand
krishna20
Specialist II
Specialist II

Hi,

Are you looking for this??

Comm_183551.png

prma7799
Master III
Master III

PFA

Not applicable

Try this -

TABLEA:

LOAD *, 'allids' AS FLAG2;

LOAD * INLINE [

    ID, User

    1, MA

    2, MA

    3, SA

    4, SA

    5, SE

    6, SE

];


TABLEB:

LOAD * INLINE [

    ID2, USER

    2, MA

    3, SA

    5, SE

];

LEFT JOIN(TABLEA)

LOAD ID2 AS ID,ID2, 'allocated' AS FLAG1 RESIDENT TABLEB;

DROP TABLE TABLEB;