Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
kristeljoymalapitan

How to Link two table with mutliple fields

Good Day,

Please help the best approach in linking two tables (using left join) with multiple fields, please see below sample query

table1:

LOAD

cust_id,

app_id,

account_number

FROMsource....;

LEFT JOIN(table1)

LOAD

cust_id,

app_id,

reasons

RESIDENT (table2);

 

I need to link table1 and table2 using cust_id and app_id fields with OR operator

 

Thank you

 

 

Labels (2)
23 Replies
kristeljoymalapitan
Author

Hi the file is not supported, I'm using Qlik Sense 12.44.1.

Please share the content of attached qvw, screenshots will do

 

Thanks

venkat1
Creator II
Creator II

og:

QUALIFY *;
UNQUALIFY BR_NAME,DT_YEAR,VC_CATEGORY,key;
LOAD
AutoNumberHash256(BR_NAME,DT_YEAR,VC_CATEGORY) as key,
BR_NAME,
CUSTOMER_NAME as custname,
VC_GOLD_TYPE,
EX_TYPE,
VC_BILL_NO,
DT_BILL_DATE,
DT_YEAR,
DT_MON,
VC_CATEGORY,
VC_ITEM_DET,
VC_ITEM_DESC,
VC_PURITY,
VC_TYPE,
VC_PRIMARY_UOM,
VC_ITEM_CODE,
NU_NANG,
NU_NANG_PCS,
NU_GROSS_WTT,
NU_NETT_WTT,
NU_CARRAT_WTT,
NU_RATE,
NU_OTHER_CHARGES,
NU_AMOUNT
FROM
[D:\DATA\QVD\XXTBZ_POSURD_CHECKLIST_V.qvd]
(qvd);

////

pm:
QUALIFY *;
UNQUALIFY BR_NAME,DT_YEAR,VC_CATEGORY,key;
LOAD
AutoNumberHash256(BR_NAME,DT_YEAR,VC_CATEGORY) as key,
BR_NAME,
VC_VOUCHER_NO,
DT_VOUCHER_DATE,
DT_MONTH,
DT_YEAR,
VC_REF_SALE_VOUCHER_NO,
DT_REF_SALE_VOUCHER_DATE,
VC_CATEGORY,
CATEGORY_DESCRIPTION,
CUSTOMER_NAME as pmcustname,
BR_CODE,
CH_PAY_MODE,
PAY_MODE_DESC,
TCS_AMOUNT,
TOTAL_BILL_AMOUNT
FROM
[D:\DATA\QVD\XXPOS_SALES_PAYMENT_V.qvd]
(qvd);

Linktable:

load BR_NAME,DT_YEAR,VC_CATEGORY,key Resident og;
load BR_NAME,DT_YEAR,VC_CATEGORY,key Resident pm;

Drop Fields BR_NAME,DT_YEAR,VC_CATEGORY from og;
Drop Fields BR_NAME,DT_YEAR,VC_CATEGORY from pm;

 






kristeljoymalapitan
Author

Hi,

 

I used the same syntax but autonumber is not working since columns in table1 is in varchar datattype, thus it resulted as null values on my data.

 

How can I connect /join the both tables  with different datattype

 

venkat1
Creator II
Creator II

please share your work file.