Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
In my script, I'm trying to alias the values within a field, as follows;
if(Equipment = '40DR', '2T', if(Equipment = '20DR', '1T' ......etc........)) as NewField
This is all fine, however one of the values I need to rename is 45'HC. The apostrophe in the middle of the value seems to be creating a problem - when I run the script, it thinks that '45' is the value, and so errors.
Is there any way round this? I've tried surrounding the 45'HC in square brackets but this doesn't work either.
Any help much appreciated!!
Hi Danielle
in you case I usually use Map and ApplyMap function. try to create a map table like this:
MAP_Equipment:
mapping
LOAD * Inline[
OldName, NewName
40DR, 2T
20DR, 1T
"45'HC", YourValue
];
and than use this map like this:
LOAD *,
ApplyMap('MAP_Equipment', Equipment, 'N/A') as NewField
FROM...
Hi Danielle,
Try this way: '45' & chr(39) & 'HC'
Regards,
Cesar
So sorry for the delay in marking the correct answer - many thanks, worked perfectly!