Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a problem trying to change field values in a file from codes to descriptions. I have used the 'if' statement in the script below - I'd appreciate if someone could help show me what to do.
Thanks, Simon
LOAD
IF (CARE_TYPE = '4', 'Acute'),
HEORG_ID,
MRN,
EPISODE_NO as Episode,
CARE_TYPE,
IMPAIRMENT
FROM
(txt, codepage is 1252, embedded labels, delimiter is ',', msq);
if you only want to Substitute ID through Description I would prefer applymap (see last sentence as base for applymap)!
If use If:
LOAD
IF (CARE_TYPE = '4', 'Acute') as CARE_TYPE_DESC,
HEORG_ID,
MRN,
EPISODE_NO as Episode,
CARE_TYPE,
IMPAIRMENT
FROM
If you have more than 1 CARE_TYPE ID I would use an Inline table (if you donot have a source with ID and Description, if you have, take that source!)
if you only want to Substitute ID through Description I would prefer applymap (see last sentence as base for applymap)!
If use If:
LOAD
IF (CARE_TYPE = '4', 'Acute') as CARE_TYPE_DESC,
HEORG_ID,
MRN,
EPISODE_NO as Episode,
CARE_TYPE,
IMPAIRMENT
FROM
If you have more than 1 CARE_TYPE ID I would use an Inline table (if you donot have a source with ID and Description, if you have, take that source!)
I think you should give alias name for that field.
like
IF (CARE_TYPE = '4', 'Acute') as Care_Type_New,
Thank you!
Thanks!
Thanks!