Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
AyCe1082
Creator
Creator

Converting an ID number to another via a common string

Hi all,

I have a long list of images that are named after an ID number. I am looking to convert those names to a different numbering system used in a different database. Is it possible to convert these IDs to their counterparts by way of a common name?

For example:

ID Source 1    ID Name    ID Source 2

12345               Ferrari        56789

images/12345.png would be renamed to images/56789.png and render the same image in the UI.

1 Solution

Accepted Solutions
jochem_zw
Partner Ambassador
Partner Ambassador

you can use applymap function

so load the table from the other database (Database2) as a mapping table

MapNewNumber:

Mapping Load 
ID Name,
ID Source 2
From Database2;

In the table from DB1 use

Images:
Load
ID Source 1,
ID Name,
'images/' & applymap('MapNewNumber',ID Source 1,'Unknown') &' .png' as NewImageName
from Database1;

 

 

 

View solution in original post

2 Replies
jochem_zw
Partner Ambassador
Partner Ambassador

you can use applymap function

so load the table from the other database (Database2) as a mapping table

MapNewNumber:

Mapping Load 
ID Name,
ID Source 2
From Database2;

In the table from DB1 use

Images:
Load
ID Source 1,
ID Name,
'images/' & applymap('MapNewNumber',ID Source 1,'Unknown') &' .png' as NewImageName
from Database1;

 

 

 

AyCe1082
Creator
Creator
Author

Thanks, I will try that out!