Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi community,
I want Load 4 fields from a resident table. In this table i have ID_Employee, Name Employee, Function, UnityBussiness.
I want load this where ID_Employee must be distinct. Any ideas?
Thanks in advance
Best Regards
Bruno Paulo
May be another way ?
Tab:
LOAD *, IF(ID = Previous(ID), 0, 1) AS RowNum INLINE [
ID, Name, Function, Unity
1, Bruno, cooker, kitchen
1, Bruno, cooker, kitchen
2, Andrew, engineer, company
2, andrew, engineer, company
];
NoConcatenate
Final:
LOAD *
Resident Tab
Where RowNum = 1;
Drop Table Tab;
Hi,
Source_Temp:
Load * Inline [
ID, Name, Function,Unity
1, Bruno,cooker,kitchen
1, Bruno,cooker,kitchen
2, Andrew,engineer,company
2, andrew,engineer,company
];
NoConcatenate
LOAD
*,
ID as ID2
Resident Source_Temp
Where not Exists(ID2, ID)
;
DROP Table Source_Temp;
Sorry, is hard for me create examples, but i solved the problem. Thank you
Yes dat was my error Andrew should be equal. But i solved the problem Thank you
I think this should work
Source_Temp:
Load *
where not exists(ID);
Load * Inline [
ID, Name, Function,Unity
1, Bruno,cooker,kitchen
1, Bruno,cooker,kitchen
2, Andrew,engineer,company
2, andrew,engineer,company
];
I know this has been resolved already, but couldn't you just use "Load Distinct"? It would be simpler, in my opinion.
E. g.:
Source_Temp:
Load Distinct * Inline [
ID, Name, Function,Unity
1, Bruno,cooker,kitchen
1, Bruno,cooker,kitchen
2, Andrew,engineer,company
2, Andrew,engineer,company
];
Exit Script;
This also results in the follwing table: