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

Replace values from one column to another

Hello Everyone,

I am new to Qlik Sense and need your help.

I have 2 tables CSP and Segment and both tables have 5 common columns:

FUP_ID
FUP_NAME
GCN_ID
GCN_Name
GCN_ID_TYPE

CSP table has the latest and most updated FUP_ID and FUP_Name, where as Segment table has updated GCN_ID and GCN_Name

Now I want to join them in such a way that the GCN_ID and GCN_Name should be replaced with FUP_ID and FUP_Name where they are not matched and wherever FUP_ID column is not blank.

I have tried it getting the below output (which is wrong):

 

IVCOMPANYIDIVNAMEFUP_IDFUP_NAMEGCN_IDGCN_NameGCN_ID_TYPE
1031752Orchard Information Systems Limited962419MRI Software LLC1031752Orchard Information Systems LimitedIV ID
1038300ZKW Zizala Lichtsysteme GmbH816526LG Corp1038300Zizala Lichtsysteme GmbHIV ID
1039052King's College London15029University Of London61658933Inspired Education Holdings LimitedIV ID
50509353Candy Hoover Gmbh4077389Haier Group Corporation1053829Candy Hoover Group SrlIV ID
62365458Rip Curl1226175Rip Curl Group Pty Ltd2521048Kathmandu Holdings LtdIV ID
50220034SLB 2020 Limited50220034SLB 2020 Limited10897469Greybull Capital LLPIV ID
1100724Lightstone Value Plus Real Estate Investment Trust Inc.1100724Lightstone Value Plus Real Estate Investment Trust Inc.21235The Lightstone Group LLCIV ID
1152617FFastFill Inc.10870183ION Investment Group Limited1152617FFastFill Inc.IV ID
1379535Hafslund USA, Inc.61622666Hafslund E-Co AS861489Hafslund ASAIV ID

 

My desired output should look like the one given below (where FUP_ID and GCN_ID are same):

 

IVCOMPANYIDIVNAMEFUP_IDFUP_NAMEGCN_IDGCN_NameGCN_ID_TYPE
1031752Orchard Information Systems Limited962419MRI Software LLC962419MRI Software LLCIV ID
1038300ZKW Zizala Lichtsysteme GmbH816526LG Corp816526LG CorpIV ID
1039052King's College London15029University Of London15029University Of LondonIV ID

 

Below is my script:

CSP:
LOAD
S.no.,
"Account Name",
"DiscoverOrg ID",
IVCOMPANYID,
GCN_ID,
GCN_NAME,
GCN_ID_TYPE
FROM [lib://Excel File Location (internal_tsingh1)/Qlik Test Data.xlsx]
(ooxml, embedded labels, table is Sheet2);

 

Segment:
Left Join(CSP)
LOAD
"FUP_ID",
"FUP_NAME",
if(GCN_ID<>FUP_ID or not isnull(FUP_ID),FUP_ID,GCN_ID) as GCN_ID,

"GCN_NAME",
"GCN_ID_TYPE",
"IVEMPLOYEES",
"IVINDUSTRY";
SQL SELECT "GCN_ID",
"GCN_NAME",
"GCN_ID_TYPE",
"FUP_ID",
"FUP_NAME",

"IVEMPLOYEES",
"IVINDUSTRY"
FROM "EDWC_CAMPAIGNS"."CVF_T_MKT_IV_COMPANYDETAILS";

 

Could anyone of you please guide me how can it be done and what I am doing wrong here.

Labels (3)
0 Replies