Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
sivavasam
Contributor III
Contributor III

Mismatch

I have two tables 4 columns 1 key column each, 3 columns need to be compare in one single table....3 on other , 1st tbl A,B,C,D . A is key ,2nd tbl A E,F,G . A is key. I need to exclude match value from B&E , C&F ,D&G . But I am getting only one of three mismatch values remaining 2 getting matched value.  is it possible to replace the matched values with black? I need script or chart function

Labels (1)
1 Solution

Accepted Solutions
Kushal_Chawda

@sivavasam  try below

t1:
LOAD * Inline [
A	B	C	D
123	300	500	600
124	400	400	5000
125	500	300	600
126	600	600	800
](delimiter is '\t');

Join
LOAD * Inline [
A	E	F	G
123	300	700	600
124	400	800	4000
125	700	300	400
126	800	600	800
](delimiter is '\t');

Final:
LOAD *,
     if(B=E,'',B) as B1,
     if(B=E,'',E) as E1,
     if(C=F,'',C) as C1,
     if(C=F,'',F) as F1,
     if(D=G,'',D) as D1,
     if(D=G,'',G) as G1
Resident t1;

DROP Table t1;

DROP Fields B,C,D,E,F,G;

RENAME Field B1 to B;
RENAME Field C1 to C;
RENAME Field D1 to D;
RENAME Field E1 to E;
RENAME Field F1 to F;
RENAME Field G1 to G;

View solution in original post

6 Replies
Kushal_Chawda

@sivavasam  Could you give an example with data?

sivavasam
Contributor III
Contributor III
Author

 
Kushal_Chawda

@sivavasam  try below

t1:
LOAD * Inline [
A	B	C	D
123	300	500	600
124	400	400	5000
125	500	300	600
126	600	600	800
](delimiter is '\t');

Join
LOAD * Inline [
A	E	F	G
123	300	700	600
124	400	800	4000
125	700	300	400
126	800	600	800
](delimiter is '\t');

Final:
LOAD *,
     if(B=E,'',B) as B1,
     if(B=E,'',E) as E1,
     if(C=F,'',C) as C1,
     if(C=F,'',F) as F1,
     if(D=G,'',D) as D1,
     if(D=G,'',G) as G1
Resident t1;

DROP Table t1;

DROP Fields B,C,D,E,F,G;

RENAME Field B1 to B;
RENAME Field C1 to C;
RENAME Field D1 to D;
RENAME Field E1 to E;
RENAME Field F1 to F;
RENAME Field G1 to G;
sivavasam
Contributor III
Contributor III
Author

What if FG fileds are CD same as table 1 that means both table1 ABCD table2 AECD 

Kushal_Chawda

Rename the fields in table 2 so that on next load you can compare them

sivavasam
Contributor III
Contributor III
Author

Thanks that's working well ....but how to eliminate A ids who doesn't have any value in it ...with in the same script.

A      B          E      C      F      D      G

123 Blank  blnk  blnk blnk blnk blnk

124 balnk  blnk  300 400 blnk blnk

125 400.   300  blnk  blnk  blank blnk

 

How to eliminate 123 from table.