Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have two tables with same field names but with data different. The table A contains data for the status 'I' whereas the table B contains data for the status 'R' but the name might be the same in both the tables.
The issue is the Name field should be only one with status 'I' given priority. How will i avoid loading the same Name for the status 'R' ?
The table structure is this:
Table A:
ID,
Name,
Status = 'I',
Date
Concatenate
Table B:
ID,
Name.
Status = 'R'
Date
Kindly let me know if the requirement is not clear
Thanks,
Anupama Jagan
May be use
Where Status <> 'R';
Maybe using NOT EXISTS():
Table A:
LOAD
ID,
Name,
Status,
Date
FROM TableA;
Concatenate
LOAD
ID,
Name.
Status,
Date
FROM TableB
WHERE NOT EXISTS(Name);
No that will eliminate all records with status R . I want data to be there for status R . I only want to eliminate any records which is already there for status 'I' and again repeating for the status 'R'
For example if
Table A:
ID Name Status Date
1 ABC I 05/17
2 XYZ I 06/17
TableB:
ID Name Status Date
10 ABC R 08/17
20 SFG R 09/17
while concatenating i should get
ID Name Status Date
1 ABC I 05/17
2 XYZ I 06/17
20 SFG R 09/17
can you now get it?
Seems, Working as suggested by Stefan
[Table A]:
Load * Inline [
ID, Name , Status, Date
1 , ABC, I , 05/17
2 , XYZ, I , 06/17
];
Concatenate
TableB:
LOAD * Where Not Exists (Name);
LOAD * Inline [
ID , Name , Status, Date
10 , ABC , R , 08/17
];