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: 
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

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
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.