Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Pragya
Creator
Creator

Two columns in differerent tables - error issue

Hi All,

 

I have a student file with fields

Student_name

student_address

student_suburb

 

Other table is geographic file

domicile

code

I want to write here is

if (domicile =  student_suburb, '1','0') as Area_Resident

 

But I am getting the error student_suburb not found

 

Could any one please advise

 

Thanks beforehand

 

 

Labels (1)
1 Solution

Accepted Solutions
Taoufiq_Zarra

@Pragya 

I think you just need to review the model.

Here is an approach :

////

Table1:

load Student_name,student_address,student_suburb
From ....

left join

Table2:
load Student_name,domicile, code
From ....

Final:
noconcatenate

load *,if (domicile=student_suburb, '1','0') as Area_Resident resident Table1;

drop table Table1;

////

for example :

Table1:

load Student_name,student_address,student_suburb 
inline [
Student_name,student_address,student_suburb 
a,b,c
d,e,f
];

left join

Table2:
load Student_name,domicile, code
inline [
Student_name,domicile, code
a,g,h
d,f,j
];

Final:
noconcatenate

load *,if (domicile=student_suburb, '1','0') as Area_Resident resident Table1;

drop table Table1;

 

output:

Capture.PNG

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉

View solution in original post

2 Replies
Taoufiq_Zarra

@Pragya 

I think you just need to review the model.

Here is an approach :

////

Table1:

load Student_name,student_address,student_suburb
From ....

left join

Table2:
load Student_name,domicile, code
From ....

Final:
noconcatenate

load *,if (domicile=student_suburb, '1','0') as Area_Resident resident Table1;

drop table Table1;

////

for example :

Table1:

load Student_name,student_address,student_suburb 
inline [
Student_name,student_address,student_suburb 
a,b,c
d,e,f
];

left join

Table2:
load Student_name,domicile, code
inline [
Student_name,domicile, code
a,g,h
d,f,j
];

Final:
noconcatenate

load *,if (domicile=student_suburb, '1','0') as Area_Resident resident Table1;

drop table Table1;

 

output:

Capture.PNG

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
Pragya
Creator
Creator
Author

Thankyou - it works