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

How to replace the records of one table with other table?

Hello Everyone,

I have 2 Tables. Table A have a Name field which contains Full Names of the employees. Table B also have Name field, but it has only Last Names. So I am trying to replace the names of table B with Table A.

I tried using if statement

Load

Name,

if(Name = '[Last Name]', [Full Name]) as Name1



its giving me error saying full name not found.

I also heard about mapping and tried to map. But not exactly sure how it will work. so I think I messed up.

Can anyone please let me know where I was going wrong or if there is any other way I can do that.

Thanks.

12 Replies
swuehl
MVP
MVP

You can find some information about MAPPING e.g. here:

Data Cleansing

Basicall, you first need to define your mapping table. You would need to load the table with full names, the create two fields, the key field will show the last names created from full name (I assume for this example that it's the last word in a space searated sequence of words), second field will show the value to map, the full name itself.

NameMap:

MAPPING LOAD

Subfield( [Full Name], ' ', -1) as F1, [Full Name] as F2

FROM YourTableWithFullName;

YourNameTable:

LOAD

     [Last Name],

    ApplyMap('NameMap', [Last Name], 'No fullname mapping found') AS Name1,

   ...

FROM YourTableWithLastNameOnly;

Not applicable
Author

Hi,

I tried that and its throwing me script error saying

Field not found: <[FULL NAME]>

and

Field not found: <[LAST NAME]>

My script was something like this

I am not sure where I am doing it wrong.

swuehl
MVP
MVP

Your field is really called JAMES YOUNG? Sounds linke a field value to me.

Not applicable
Author

But the article you provided worked. Thankyou so much

Not applicable
Author

Yes it is a field value.

I think, there is miscommunication. sorry.

jagan
Luminary Alumni
Luminary Alumni

Hi Soumya,

Attach some sample data and let us know your expected output so that it would be easier to understand and provide better solution.

Please check below link for getting the answers quickly from community.

Qlik Community Tip: Posting Successful Discussion Threads

Regards,

Jagan.

engishfaque
Specialist III
Specialist III

Dear Soumya,

Use Inner Join to replace your Name field.

Kind regards,

Ishfaque Ahmed

avinashelite

Hi Soumya,

Could you please share the sample data ...so that it will be helpful for us to undestand the data and suggest a solution for the same

Anonymous
Not applicable
Author

Sample App??