Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

2 Databases compare

Hi

I have two Databases. They have both the same tables with the same name. I have to check if there are in both the same data. How should I do that?

16 Replies
tresesco
MVP
MVP

It seems that you might be getting the error for table DB02, because this table is getting concatenated to DB01 (because all fields are common for them). You have to avoid this auto concatenation by using NOCONCATENATE keyword like:

ODBC CONNECT TO [DB01;DBQ=DB01] (XUserId is asdasdasd, XPassword is aPassword);

"DB01":

Load *,

Date(Floor(DATETIME)) as Date Where

Date(DATETIME,'DD.MM.YYYY')>='23.07.2013';

SQL SELECT ID,

                   DATETIME   

FROM Test1.table1;

ODBC CONNECT TO [DB02;DBQ=DB02] (XUserId is asdasdasdasdasssda, XPassword is anotherPassword);

"DB02":

NoConcatenate

Load *,

Date(Floor(DATETIME)) as Date Where

Date(DATETIME,'DD.MM.YYYY')>='23.07.2013';

SQL SELECT ID,

                     DATETIME

FROM Test2."table2";

Not applicable
Author

if I load it then there is:

Connecting to DB01;DBQ=DB01

Connected

DB01 << table1 x lines fetched

Connection to DB02;DBQ=DB02

Conncetec

DB01<< table2

....

Is that normal that DB01 is two times there.

Could also the tablenames be a problem, because they have the same name,  just from another DB

Not applicable
Author

I'm getting the error: DB02 not found

tresesco
MVP
MVP

Have you put NoConcatenate properly?

Not applicable
Author

Wait I'm not sure. I look shortly

Not applicable
Author

My fault. I put it in front of InnerJoinTable....
It's loading now and looks better. I'll write when it's finished with loading

Andrea_Ghirardello

You should use aliases for fields of each table as I showed in the last attached example because without aliases, you add rows to the same table.