Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem changing field values

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);

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

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!)

View solution in original post

5 Replies
Anonymous
Not applicable
Author

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!)

settu_periasamy
Master III
Master III

I think you should give alias name for that field.

like

IF (CARE_TYPE = '4', 'Acute') as Care_Type_New,

Not applicable
Author

Thank you!

Not applicable
Author

Thanks!

Not applicable
Author

Thanks!