Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 |
Name1 | NewName |
Name2 | NewName2 |
Name3 | NewName3 |
Name4 | NewName4 |
I am making both a list box and a graph where these names need to be updated.
Thanks.
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
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;
I am working on it and getting there but the syntax is what gets me every time.
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