Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Rename values in a field

I want to take some values in some fields and rename them to a more user friendly name.

For instance I made a quick table below for an example but my data is coming from SQL. I want to take the values only in the fields and rename them to what is in field2 column.

Field1 Field2
Name1NewName
Name2NewName2
Name3NewName3
Name4NewName4

I am making both a list box and a graph where these names need to be updated.

Thanks.

13 Replies
pgrenier
Partner - Creator III
Partner - Creator III

Hello Mikel,

The ApplyMap() fonction should be called on a QlikView dataset and not on the source SQL.

ServerMap:

Mapping LOAD * Inline [

Old Field Name, New Field Name

Server1, USA 1

Server2, USA 2

Server3, Mexico

Server4, EMEA

];

ALLDEVICEINFO:

LOAD [Device Name], [OS Name], [Inventory Server]

  , ApplyMap('ServerMap',OldFieldName,'NA') as Fieldname;

SQL SELECT DISTINCT A0.DISPLAYNAME AS "Device Name"

  , A0.TYPE AS "Type", A1.OSTYPE AS "OS Name"

  , A0.INVENTORYSERVER AS "Inventory Server"

  , A0.SERVERNUMBER AS OldFieldName; // insert the proper source field name here

FROM Computer A0 (nolock) LEFT OUTER JOIN Operating_System A1 (nolock) ON A0.Computer_Idn = A1.Computer_Idn

WHERE (A0.DEVICENAME IS NOT NULL)  ORDER BY  A0.DISPLAYNAME;

Regards,

Philippe

Not applicable
Author

load [Device Name], Type,[OS Name],[Inventory Server], ApplyMap('ServerMap',OldFieldName,'NA') as Fieldname;

SQL SELECT

DISTINCT A0.DISPLAYNAME AS "Device Name", A0.TYPE AS "Type", A1.OSTYPE AS "OS Name", A0.INVENTORYSERVER AS "Inventory Server"

FROM Computer A0 (nolock) LEFT OUTER JOIN Operating_System A1 (nolock) ON A0.Computer_Idn = A1.Computer_Idn

WHERE (A0.DEVICENAME IS NOT NULL)   ORDER BY  A0.DISPLAYNAME;

Not applicable
Author

I am working on it and getting there but the syntax is what gets me every time.

krishna_2644
Specialist III
Specialist III

Hi Mike,

Please see my post at

'Rename Field Values' and 'Select a Field Name from one list box to populate the field Values in ano... , which may give you an idea on how to rename a field value.

Thanks

krishna