Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to join two tables

Hi All,

         I have two flat file like,

                

I want only a mismatch value.How to get it.

16 Replies
Not applicable
Author

Hi All,

           i want to load match and mismatch values to store separate column.How to do this,Please help me,

sundarakumar
Specialist II
Specialist II

There si a work around,

PFA.

first qvd:

in script

 

one:

LOAD id
FROM
C:\Users\379790\Desktop\unmatch\src1.xlsx
(
ooxml, embedded labels, table is Sheet1);

outer join
two:
LOAD id
FROM
C:\Users\379790\Desktop\unmatch\src2.xlsx
(
ooxml, embedded labels, table is Sheet1);

NoConcatenate
//drop table one;
three:
LOAD id as ida,id
FROM
C:\Users\379790\Desktop\unmatch\src1.xlsx
(
ooxml, embedded labels, table is Sheet1);

inner join
four:
LOAD id as id
FROM
C:\Users\379790\Desktop\unmatch\src2.xlsx
(
ooxml, embedded labels, table is Sheet1);

store one into one.qvd;
store three into three.qvd;

this will create two qvd's one and two.

second qvd:

 

one:

LOAD id,
ida
FROM
C:\Users\379790\Desktop\unmatch\three.qvd
(
qvd);

LOAD id
FROM
C:\Users\379790\Desktop\unmatch\one.qvd
(
qvd)
where not exists(id);

This will result in the expected.

topost.PNG

-Sundar

sundarakumar
Specialist II
Specialist II

Match values can be easily obtained for an inner join .

-Sundar

Not applicable
Author

Dear,

Create two map file one for table 1 and second for table 2, and after that apply first map first to second table and second map to first table, map flag value is match and unmatch.

then concate both tables and you can found match and unmatch values in seperate column.

I have did this in my fix assest application to find addition and deletion assest current and preivous month.

I will also try to send code.

Regards,

Zain.

Not applicable
Author

Hi,

Tab1:     

Empid

Name

101

irf

102

gho

zee

Tab2 :

Empid

Name

101

irf

102

gho

103

zee

 

Script :

Tab1:

LOAD Empid,

     Empid as Empid1,

     Name

FROM

(ooxml, embedded labels, table is Tab1);

Right join

Tab2:

LOAD Empid,

     Empid as Empid2,

      Name

     

FROM

(ooxml, embedded labels, table is Tab2)

where not  Exists(Empid1,Empid);

Result :

Empid1

Empid2

Name

103

zee

ThornOfCrowns
Specialist II
Specialist II

Is this a question or answer?

Not applicable
Author

aswer