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

Load, Resident, Left Join (ERROR)

Hi all,

I have a table called Bookings in one tab in the run script and Patients in another tab in the run script. I need to join both the tables.

Bookings:

Load

ID,

Name,

Phone

;

From

Sql *......

The code I had written was

Patients:

Load

No as ID,

Location

;

Sql*......

LEFT JOIN (Patients)

Load

ID,

Name,

Phone

Resident Bookings;

I get a syntax error. Not sure if the left join code is the right one.

1 Solution

Accepted Solutions
er_mohit
Master II
Master II

Bookings:

Load

ID,

Name,

Phone

;

From

Sql *......

join(Bookings)

Patients:

Load

No as ID,

Location

;

Sql*......

hope it helps

if it gives error then write in last load of your statement before ;

where not exit(ID);

View solution in original post

9 Replies
Gysbert_Wassenaar

The from keyword should probably be removed from your first load statement

Load

ID,

Name,

Phone

;

From

Sql *......

That last bit doesn't look right. You either use a preceding load without a from in the load statement (but it the sql statement does need it)

Load

a,b,c;

sql select * from mytable;

Or just

sql select a,b,c from mytable;

Or load from a non-sql source

Load

a,b,c

from myqvd (qvd);



talk is cheap, supply exceeds demand
er_mohit
Master II
Master II

Bookings:

Load

ID,

Name,

Phone

;

From

Sql *......

The code I had written was

concatenate(Booking)

Patients:

Load

No as ID,

Location

;

Sql*......

where not exit(ID);            // before ';'in your sql satatement write this where condition.

Not applicable
Author

Changed it. Both the tables load perfectly. Only when I add the Left join, it gives a syntax error.

er_mohit
Master II
Master II

you should have mark it as helpful or correct answer.

so it might be helpful for other developer

Not applicable
Author

Thanks Mohit. I always mark if its a correct answer.

er_mohit
Master II
Master II

tell me what problem which you are facing now

Not applicable
Author

Tables load perfectly. When I add the Left join, and reload it gives me a error.

er_mohit
Master II
Master II

Bookings:

Load

ID,

Name,

Phone

;

From

Sql *......

join(Bookings)

Patients:

Load

No as ID,

Location

;

Sql*......

hope it helps

if it gives error then write in last load of your statement before ;

where not exit(ID);

jagan
Luminary Alumni
Luminary Alumni

Hi,

In Join you have given the invalid table name(Booking instead of Bookings).

Bookings:

Load

ID,

Name,

Phone

;

From

Sql *......

join(Bookings)

Load

No as ID,

Location

;

Sql*......

Hope this helps you.

Regards,

Jagan.