Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a table with Columns:
A B C
1 1 1
2 2 2
3 3 3
4 4 4
5 5 5
How can I replace the values 1,2,3,4,5 with 'NA','Bad','Avg','Good','Expert'. So that the table looks like below
A B C
NA NA NA
Bad Bad Bad
Avg Avg Avg
Good Good Good
Expert Expert Expert
Thanks,
Padmanabhan
u can use apply map
Adding to the above, The Values are fixed, will never change.
u can use apply map
I Have 18 such columns like A, B, C. Will aplly map work.
TableB:
Mapping LOAD * Inline [
No,Name
1,NA
2,Bad
3,Avg
4,Good
5,Expert
];
TableA:
LOAD * Inline [
A , B , C
1 , 1 , 1
2 , 2 , 2
3 , 3, 3
4 , 4 , 4
5 , 5 , 5
];
TableC:
LOAD ApplyMap('TableB',A) as A1,
ApplyMap('TableB',B) as B1,
ApplyMap('TableB',C) as C1
Resident TableA;
DROP Table TableA;
S it will work lets see is any other giving the best solution .
Hi,
Try like this
LOAD
Pick(Match(A, 1,2,3,4,5), 'NA','Bad','Avg','Good','Expert') AS A,
Pick(Match(B, 1,2,3,4,5), 'NA','Bad','Avg','Good','Expert') AS B,
Pick(Match(C, 1,2,3,4,5), 'NA','Bad','Avg','Good','Expert') AS C
Inline [
A , B , C
1 , 1 , 1
2 , 2 , 2
3 , 3, 3
4 , 4 , 4
5 , 5 , 5
];
Regards,
Jagan.