Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
I get data in form of numbers.I have to assign a string to it.
Thanks,
Asmita
Your requirement is still somwhat unclear, an example always helps to understand.
You can look into conditional functions to assign strings to your numbers when loading in, or look into a Mapping approach:
1)
LOAD Number,
if(Number = 1, 'One',
if(Number = 10, 'Ten',
if(Number = 100, 'Hundred')
)
) as NumberText
FROM ....;
2)
NumberMap:
MAPPING LOAD * INLINE [
F1, F2
1, One
10, Ten
100, Hundred
];
LOAD Number,
applymap('NumberMap', Number) as NumberText
FROM ...;
hi
try text(fieldname) function
Your requirement is still somwhat unclear, an example always helps to understand.
You can look into conditional functions to assign strings to your numbers when loading in, or look into a Mapping approach:
1)
LOAD Number,
if(Number = 1, 'One',
if(Number = 10, 'Ten',
if(Number = 100, 'Hundred')
)
) as NumberText
FROM ....;
2)
NumberMap:
MAPPING LOAD * INLINE [
F1, F2
1, One
10, Ten
100, Hundred
];
LOAD Number,
applymap('NumberMap', Number) as NumberText
FROM ...;
Thanks,
The if loop worked