Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Rename records based on values

Is there a way in the script to rename records based on values.  i.e. in the field 'Type', I want any 1 to equal 'Private', 2 to equal 'General', etc.

Thank you!

17 Replies
Anonymous
Not applicable
Author

The field is called 'Type of PII' and has values 1 through 5.

I want to assign the following:

1 = General PII

2 = Sensitive PII

3 = Financial Information

4 = Medical Information

5 = Multiple Types

eduardo_sommer
Partner - Specialist
Partner - Specialist

Adapting my former post:

Use an ApplyMap function

First, load the table with the from/to columns

FromTo:

Mapping load * inline [

From, To

1,General PII

2,Sensitive PII

3,Financial Information

4,Medical Information

5,Multiple Types

...

...

];

Table:

Load

      Field1,

      Field2,

     ApplyMap('FromTo', [Type of PII], 'Default Value') as [Type of PII],

...

...

From ...; 

Eduardo

Anonymous
Not applicable
Author

Thank you!

To be clear...I load this first in my script...

FromTo:

Mapping load * inline [

From, To

1,General PII

2,Sensitive PII

3,Financial Information

4,Medical Information

5,Multiple Types]

Then I load my table but where the [Type of PII] field would be, I put this instead?

ApplyMap('FromTo', [Type of PII], 'Default Value') as [Type of PII],

eduardo_sommer
Partner - Specialist
Partner - Specialist

Exactly

Anonymous
Not applicable
Author

I get the following error message when applying that logic...

Garbage after statement

FromTo:

Mapping load * inline [

From, To

1,General PII

2,Sensitive PII

3,Financial Information

4,Medical Information

5,Multiple Types]

Directory

sunny_talwar

Did you add semi-colon (;) after  ] at the end?

FromTo:

Mapping

LOAD * Inline [

From, To

1,General PII

2,Sensitive PII

3,Financial Information

4,Medical Information

5,Multiple Types

];

Anonymous
Not applicable
Author

It worked, thank you!

sunny_talwar

Awesome .

If you are satisfied, please close the thread by marking correct and/or helpful answers.

Best,

Sunny