Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
rammuthiah
Creator III
Creator III

Logic Self Join

Hi,

I have a dataset states that ID 32 is the manuf id of z12, and ID 32 is linked with Link-ID 10,48 and 10,48 from ID is linked with 60,66 in Link-ID. So need a workaround to get all those for ManuF z12. Here the problem is ID 48 has ManuF as 100180 and 60,66 has some other ManuF. 

ID LinkID Plant ManuF
48   3140 100180
10   3140 500
32   3140 z12
32 10 3140 z12
32 48 3140 z12
10     100
10     500
10 60 3140 500
10 66 3140 500
66   3140 100

 

If I select, Plant code 3140 and manufacturing id z12,  wants the below output.

PlantCode ManufID ID
3140 z12 32
3140 z12 10
3140 z12 48
3140 z12 60
3140 z12 66

 

Labels (1)
2 Replies
Chanty4u
MVP
MVP

Try this 

 

OriginalTable:

LOAD ID, LinkID, Plant, ManuF

FROM source ;

 

NewTable:

LOAD Distinct

    Plant AS PlantCode,

    ManuF AS ManufID,

    ID

Resident

    OriginalTable

Where

    Plant = '3140' AND ManuF = 'z12';

Left Join (NewTable)

LOAD Distinct

    Plant AS PlantCode,

    ManuF AS ManufID,

    ID

Resident

    OriginalTable;

NoConcatenate

FinalTable:

LOAD

    PlantCode,

    ManufID,

    ID

Resident

    NewTable;

 

Drop Table OriginalTable;

Drop Table NewTable;

rammuthiah
Creator III
Creator III
Author

ID 60 and 66 has the other ManuF, So When I select the said, Its not filtering as such.