Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
ccb-it2013
Contributor
Contributor

How do a join with 2 dbf files?

Hi there,

For the life of me I can't join 2 dbf files so that I can get the necessary data I need from the second database.

In my script I have this:

SELECT * FROM ADO CONMANPO_H

The name of the second dbf I need to get data from is called say CONMANPO_D . They field they have in common is called PONO.

I tried this:

LEFT JOIN CONMANPO_H on  PONO as CONMANPO_D

However I get a script error when I try running the script.

What am I doing wrong?? I am sure it is something really simple.

Thanks for your help!

49 Replies
vishsaggi
Champion III
Champion III

Can you try your SQL script in your database environment and see what error you are getting? If you getting error in your SQL environment change the script to run and if that works just copy the same script in Qlikview script editor and check.

ccb-it2013
Contributor
Contributor
Author

HI Sasidhar,

This table contains the field "PONO":

jas_2018-04-20_13-19-37.jpg

This table contains the field "TICKET":

jas_2018-04-20_13-21-38.jpg

for some reason I still get an error. The names are good...

ccb-it2013
Contributor
Contributor
Author

They are not SQL databases, they are VIsual FoxPro 9 databases...you see that the following line in my script:

OLEDB CONNECT32 TO [Provider=VFPOLEDB.1;Data Source=G:\AIMS\QVDATA\CMP4\;Collating Sequence=general;];

ccb-it2013
Contributor
Contributor
Author

I theory the script should still work if I remove the SQL line, but even if I do that the script errors out.

I thought it just a syntax error somewhere in my script or I am not using the correct command to get the data I need...

sasiparupudi1
Master III
Master III

Just do this

Connect your db

Table1:

Sql select * from table1;

Table2:

Sql select * from table2;

Do you see 2 tables in qv? Do they contain the columns you see in your db?

ccb-it2013
Contributor
Contributor
Author

Hi Sasidhar,

When I try:

Sql select * from adoconmanpo_h

All I get the hourglass from QV....

If I do the command:

Select * from adoconmanpo_h

QV likes that:

Qv_2018-04-20_13-54-41.jpg

ccb-it2013
Contributor
Contributor
Author

If I tried with the other dbf, and that select command works as well.

If I try having both select commands in the script, i get an error.

Qv_2018-04-20_14-02-22.jpg

I had expected QV to not like that....

vishsaggi
Champion III
Champion III

Try this once :

ADOCONMANPO_H:
LOAD *;
SELECT
adoh.Ticket,
adoh.Style,
adoh.Vendor,
adoh.Mfcode,
adoh.duedate
FROM ADOCONMANPO_h adoh;


LEFT JOIN(ADOCONMANPO_H)
ADOPLINS:
LOAD *;
SELECT
adoplins.Account,
adoplins.Color,
adoplins.desc,
adoplins.linetot
adoplins.shipno,
adoplins.PONO AS Ticket
FROM ADOPOLINS adoplins;

vishsaggi
Champion III
Champion III

Did you terminate your first Select statement with ; semicolon?

ccb-it2013
Contributor
Contributor
Author

Yes sir, I did.

Ran your script above and the hourglass is still turning..