Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I loading a shipping table. There are few fields in shipping table that stores information as '0' and '1'. I would like to rename '0' as 'No' and '1' as 'Yes'.
i.e. Field Name - Shipped: Rename '0' as 'Not Shipped' and '1' as 'Shipped'
Regards,
H
Try
LOAD
if(Shipped,'Shipped','Not Shipped') as Shipped,
...
FROM YourTable;
or using a mapping table:
MAP:
MAPPING LOAD * INLINE [
F1, F2
0,Not Shipped
1,Shipped
];
LOAD
applymap('MAP',Shipped,'unknown status') as Shipped,
...
FROM YourTable;
Try
LOAD
if(Shipped,'Shipped','Not Shipped') as Shipped,
...
FROM YourTable;
or using a mapping table:
MAP:
MAPPING LOAD * INLINE [
F1, F2
0,Not Shipped
1,Shipped
];
LOAD
applymap('MAP',Shipped,'unknown status') as Shipped,
...
FROM YourTable;
Perhaps more than the OP asked for, but I like to load or map as a dual. That way you get "Yes" / "No" in display fields (like listboxes and table columns) but still retain the the ability to use expressions like
=sum(Shipped)
-if(Shipped,...
Create the mapping table like this:
YesNoMap:
MAPPING
LOAD from, dual(to,from) INLINE [
from, to
0, No
1, Yes
];
Map Shipped USING YesNoMap;
-Rob