Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi friends,
I'm loading employee no and their status in load script. But some employee number having two status(Active and Removed). In that case i want to load only 'Removed ' status for that Employee in load script.
Kindly find the Below screenshot for reference. Any help will be much appreciated.
Alternatively, you can try this
Table:
LOAD * INLINE [
Empl No, Status
1, Active
2, Removed
3, Active
3, Removed
4, Removed
5, Active
];
Right Join (Table)
LOAD [Empl No],
MaxString(Status) as Status
Resident Table
Group By [Empl No];
Try like this
Table:
LOAD *,
Match(Status, 'Active', 'Removed') as StatusNum;
LOAD * INLINE [
Empl No, Status
1, Active
2, Removed
3, Active
3, Removed
4, Removed
5, Active
];
Right Join (Table)
LOAD [Empl No],
Max(StatusNum) as StatusNum
Resident Table
Group By [Empl No];
Sunny,
Im getting number 2 instead of Removed. Kindly tell me what am i done wrong?
For StatusNum... you might be getting 2, but status should be Removed
Alternatively, you can try this
Table:
LOAD * INLINE [
Empl No, Status
1, Active
2, Removed
3, Active
3, Removed
4, Removed
5, Active
];
Right Join (Table)
LOAD [Empl No],
MaxString(Status) as Status
Resident Table
Group By [Empl No];
Hi praveen
Try this. You will get one Record if it is Removed.
load
[Empl no],
maxstring(Status) as Status
From
Group By [Empl no];
Exactly what i want. Thank you so much for your Knowledge.