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: 
upaliwije
Creator II
Creator II

AMALGAMATE 2 TABLES

Hi Friends

I have in QV document folloing two tables

Table 1

EMPLOYEEDESCRIPTIONYEARBCODSEQ
ABank Slip Entry to  the System20108M007
BBank Slip Entry to  the System20108M007
CBank Slip Entry to  the System20118M007
ABank Slip Entry to  the System20118M007
BBank Slip Entry to  the System20128M007
CBank Slip Entry to  the System20128M007
AIntegration of Debit_Notes20108M009
BIntegration of Debit_Notes20108M009
CIntegration of Debit_Notes20118M009
AIntegration of Debit_Notes20118M009
BIntegration of Debit_Notes20128M009
CIntegration of Debit_Notes20128M009
AIntegration of Receipts20108M008
BIntegration of Receipts20108M008
CIntegration of Receipts20118M008
AIntegration of Receipts20118M008
BIntegration of Receipts20128M008
CIntegration of Receipts20128M008

Table 2

YEARBCODTYPENOS
20108M00DEBIT_NOTES679
20108M00DIR_RECEIPTS4508
20118M00DEBIT_NOTES711
20118M00DIR_RECEIPTS5263
20128M00DEBIT_NOTES947
20128M00DIR_RECEIPTS5587

I want to combine the two table and obtain following output table

EMPLOYEEDESCRIPTIONYEARBCODSEQTYPENOS
ABank Slip Entry to  the System20108M007DIR_RECEIPTS4508
BBank Slip Entry to  the System20108M007DIR_RECEIPTS4508
CBank Slip Entry to  the System20118M007DIR_RECEIPTS5263
ABank Slip Entry to  the System20118M007DIR_RECEIPTS5263
BBank Slip Entry to  the System20128M007DIR_RECEIPTS5587
CBank Slip Entry to  the System20128M007DIR_RECEIPTS5587
AIntegration of Debit_Notes20108M009DEBIT_NOTES679
BIntegration of Debit_Notes20108M009DEBIT_NOTES679
CIntegration of Debit_Notes20118M009DEBIT_NOTES711
AIntegration of Debit_Notes20118M009DEBIT_NOTES711
BIntegration of Debit_Notes20128M009DEBIT_NOTES947
CIntegration of Debit_Notes20128M009DEBIT_NOTES947
AIntegration of Receipts20108M008DIR_RECEIPTS4508
BIntegration of Receipts20108M008DIR_RECEIPTS4508
CIntegration of Receipts20118M008DIR_RECEIPTS5263
AIntegration of Receipts20118M008DIR_RECEIPTS5263
BIntegration of Receipts20128M008DIR_RECEIPTS5587
CIntegration of Receipts20128M008DIR_RECEIPTS5587

Amagamation should be done based on following condition

If seq No= 7 or 9 type should be DIR_RECEIPTS Nos should be value given against DIR_RECEIPTS in table 2

If seq No= 8 type should be DEBIT_NOTES Nos should be value given against DEBIT_NOTES in table 2


To do the above I have tried my best but I am unable to do it. Pls help me to achieve my objective.

1 Solution

Accepted Solutions
johnw
Champion III
Champion III

Something like this.

[Table 1]:

LOAD

EMPLOYEE

,DESCRIPTION

,YEAR

,BCOD

,SEQ

,if(match(SEQ,7,9),'DIR_RECEIPTS',if(SEQ=8,'DEBIT_NOTES')) as TYPE

FROM your source for Table 1

;

LEFT JOIN ([Table 1])

LOAD

,YEAR

,BCOD

,TYPE

,NOS

FROM your source for Table 2

;

View solution in original post

4 Replies
upaliwije
Creator II
Creator II
Author

If I use Apply map technique could this be done ?

johnw
Champion III
Champion III

Maybe when loading Table 1, also load the TYPE field.

if(match(SEQ,7,9),'DIR_RECEIPTS',if(SEQ=8,'DEBIT_NOTES')) as TYPE,

Then left join Table 2 onto table 1.

upaliwije
Creator II
Creator II
Author

Tks Jhon

Could You pls write the script  for  left join

johnw
Champion III
Champion III

Something like this.

[Table 1]:

LOAD

EMPLOYEE

,DESCRIPTION

,YEAR

,BCOD

,SEQ

,if(match(SEQ,7,9),'DIR_RECEIPTS',if(SEQ=8,'DEBIT_NOTES')) as TYPE

FROM your source for Table 1

;

LEFT JOIN ([Table 1])

LOAD

,YEAR

,BCOD

,TYPE

,NOS

FROM your source for Table 2

;