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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Compare two tables excel

Hello,

I need to compare two tables from different excel. When I get two equal reference I need to write "True" and otherwise "false"

excel 1:

Reference1CountryInformation
123456USAAAAAA
234567UKBBBBB
345678CACCCCC

excel 2:

Reference2CountryCode
456789FRAEEEEE
123456USADDDDD

I think I need to creat a new table:

TABLE:

COUNTRYReferenceInformationCodeFlag
USA123456AAAAADDDDDTRUE
UK234567BBBBBFALSE
CA345678CCCCCFALSE
FRA456789EEEEEFALSE

Until now, I tried to make an "If" : if(Refence1 <> Reference2, 'true', 'false') as Flag

But I have an issue with this condition, when the charging never stop.

Regards

1 Solution

Accepted Solutions
sunny_talwar

May be like this then:

Table1:

LOAD Reference1 as Reference,

  Reference1,

    Country,

    Information

FROM

[https://community.qlik.com/thread/189107]

(html, codepage is 1252, embedded labels, table is @1);

Join (Table1)

LOAD Reference2 as Reference,

  Reference2,

    Country,

    Code

FROM

[https://community.qlik.com/thread/189107]

(html, codepage is 1252, embedded labels, table is @2);

FinalTable:

LOAD *,

  If(Reference1 = Reference2, 'True', 'False') as Flag

Resident Table1;

DROP Table Table1;

View solution in original post

8 Replies
sunny_talwar

Are you looking to do this in the front end of the application? Will a backend solution also work for you?

marcus_malinow
Partner - Specialist III
Partner - Specialist III

Try this...

Table:
LOAD Reference1 as Reference,
Country,
Information,
-1
as Source1
FROM
[https://community.qlik.com/thread/189107]
(
html, codepage is 1252, embedded labels, table is @1);

Outer Join (Table)
LOAD Reference2 as Reference,
Country,
Code,
-1
as Source2
FROM
[https://community.qlik.com/thread/189107]
(
html, codepage is 1252, embedded labels, table is @2);

LEFT JOIN (Table)
LOAD
Reference,
Country,
if(Source1 And Source2, -1, 0) as Flag
RESIDENT Table;

Not applicable
Author

I need a backend solution

sunny_talwar

May be this:

Table1:

LOAD Reference1 as Reference,

    Country,

    Information

FROM

[https://community.qlik.com/thread/189107]

(html, codepage is 1252, embedded labels, table is @1);

Join (Table1)

LOAD Reference2 as Reference,

    Country,

    Code

FROM

[https://community.qlik.com/thread/189107]

(html, codepage is 1252, embedded labels, table is @2);

FinalTable:

LOAD *,

  If(not IsNull(Information) and  not IsNull(Code), 'True', 'False') as Flag

Resident Table1;

DROP Table Table1;

Output:


Capture.PNG

Not applicable
Author

There is a way to make your condition only with "reference1" and "reference2"? Because I didn't only have 1 column of "information" and "code".

Thanks for your help

Regards

sunny_talwar

May be like this then:

Table1:

LOAD Reference1 as Reference,

  Reference1,

    Country,

    Information

FROM

[https://community.qlik.com/thread/189107]

(html, codepage is 1252, embedded labels, table is @1);

Join (Table1)

LOAD Reference2 as Reference,

  Reference2,

    Country,

    Code

FROM

[https://community.qlik.com/thread/189107]

(html, codepage is 1252, embedded labels, table is @2);

FinalTable:

LOAD *,

  If(Reference1 = Reference2, 'True', 'False') as Flag

Resident Table1;

DROP Table Table1;

Not applicable
Author

Thanks it work!

sunny_talwar

Awesome