Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Folks,
I have a question: there are 2 Tables
Tab_A
ID, Sales
A, 1
B, 2
D, 3
and
Tab_B
ID, Sales
A, 10
B, 12
C, 13
The expected output is:
Tab
ID, Sales
D,3
what is best way to exclude the values and still only D = 3
Thanks a lot
Beck
If using sunny example i added Noconcatenate because table need to not concatenate
Tab_B:
LOAD ID
FROM Tab_B;
Noconcatenate
Tab_A:
LOAD ID,
Sales
FROM Tab_A
Where not Exists(ID);
DROP Table Tab_B;
Is this needed during loading of the data? May be this
Tab_B:
LOAD ID
FROM Tab_B;
Tab_A:
LOAD ID,
Sales
FROM Tab_A
Where not Exists(ID);
DROP Table Tab_B;
Do you need only data for D Column.
Hi Beck,
Tab_B:
Load ID, Sales
FROM xxx;
noconcatenate
Tab_A:
Load ID, Sales
FROM xxx
where not exists(ID);
drop table Tab_B;
BR
Martin
If using sunny example i added Noconcatenate because table need to not concatenate
Tab_B:
LOAD ID
FROM Tab_B;
Noconcatenate
Tab_A:
LOAD ID,
Sales
FROM Tab_A
Where not Exists(ID);
DROP Table Tab_B;
But why is that needed its.anandrjs? My Tab_B only have ID and Tab_A have ID and Sales. They are not going to auto concatenate. I don't think there is a need for NoConcatenate here. Would you agree?
Sunny Thanks a lot for your feedback and help
Martin Thanks a lot for your feedback and help
Anand Thanks a lot for your feedback and help
Because field names are same and they concatenated first, try below example and comment the Noconcatenate and rename the filed ID to some other name and see the result.
Tab_B:
LOAD * Inline
[
IDD, Sales
A, 10
B, 12
C, 13
];
//NoConcatenate
Tab_A:
LOAD * Inline
[
ID, Sales
A, 1
B, 2
D, 3
]Where not Exists(IDD,ID);
DROP Table Tab_B;