Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
xarapre7
Creator II
Creator II

Replace username to Last Name and First Name from different table

Hi!

I have a table which has just a Username (ex. NTran) from Service table and would like to convert that to employee's full name.  The first name and last name are in the Employee table.  I want to know how can i replace the username to the employees' full name.

Thanks in advance.

6 Replies
swuehl
MVP
MVP

If your employee's table shows username next to the first name / last name, or if the username is built from first name / last name, you can use a mapping table approach:

Data Cleansing

xarapre7
Creator II
Creator II
Author

Thank you for that info.

I actually used Mapping as follows :

******************************************************

STName:
Mapping
LOAD Distinct


UserID as CreatedBy,
DisplayName


FROM
qvEmployee.qvd (
qvd);


ServiceInfo:
LOAD

AutoNumber([Created By],'%CreatedBy') as %CreatedBy,

 

   [STechnician]
,
ApplyMap(‘STName’,[STechnician],'<Blank>') AS STechName

FROM
ServiceInfo.qvd (
qvd)

 

tblEmployee:
LOAD
AutoNumber(UserID,'%CreatedBy') as %CreatedBy,

EmployeeID,
UserID,
DisplayName


FROM
Employee.qvd (
qvd);


*********************************

but it's giving me multiple DisplayName values per STechnician


STechnician    DisplayName

MNadale      Robinson, Elie

MNadale      Winda, Riza

MNadale      Jayson, Lou

MNadale      -

MNadale      Pattison, Gary



Can you please help to correct the script?

Anil_Babu_Samineni

Just give mapping and use the sql where condition with append using the replace function

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Not applicable

Use MappingLoad of the employee table and then use ApplyMap when loading your transaction table

Not applicable

See the sample here.

swuehl
MVP
MVP

Does field UserID in qvEmployee.qvd and field STechnician in ServiceInfo.qvd hold the same information (you are using these fields as key fields for your mapping)?

You should then look into the new field STechName to see the mapped values, not at DisplayName.