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: 
YD
Partner - Contributor II
Partner - Contributor II

Replace a field's value in a table by another field's value in another table

Hi everyboy,

I am a Qlikview beginner and I have this issue to submit to the community.

I have the table below File_1 with these fields ID_OPERATION, ASSOCIATION and ASSOCIATION_2 :

File_1:
ID_OPERATIONASSOCIATIONASSOCIATION_2
796 
853
953
1196 
12110110
1353

 

And this second one with these fields ID and NAME:

File_2:
IDNAME
3ASSOCIATION
5RSS
96EMERGENCY
110FRANCE

 

I would like to have as final result the values in "ASSOCIATION" and "ASSOCIATION_2" replaced by the names value in the field "NAME"

As you can see, the value in "ASSOCIATION" and "ASSOCIATION_2" (File_1) are the same than values in field "ID" (File_2)

 

Here is the final result I would like to have

Result:
ID_OPERATIONASSOCIATIONASSOCIATION_2
7EMERGENCY 
8RSSASSOCIATION
9RSSASSOCIATION
11EMERGENCY 
12FRANCEFRANCE
13RSSASSOCIATION

 

Could you please help me with any suggestion?

Thank you so much

Bests regards

2 Solutions

Accepted Solutions
settu_periasamy
Master III
Master III

You can do it in different methods.

one method.

File_2:
Mapping LOAD * INLINE [
ID, NAME
3, ASSOCIATION
5, RSS
96, EMERGENCY
110, FRANCE
];


Result:
LOAD ID_OPERATION,
ApplyMap('File_2',ASSOCIATION,'') as ASSOCIATION,
ApplyMap('File_2',ASSOCIATION_2,'') as ASSOCIATION_2;
LOAD * INLINE [
ID_OPERATION, ASSOCIATION, ASSOCIATION_2
7, 96,
8, 5, 3
9, 5, 3
11, 96,
12, 110, 110
13, 5, 3
];

 

View solution in original post

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Here's another variation which I think has simpler syntax:

AssociationMap:
Mapping LOAD * INLINE [
ID, NAME
3, ASSOCIATION
5, RSS
96, EMERGENCY
110, FRANCE
];
MAP ASSOCIATION, ASSOCIATION_2 USING AssociationMap;


Result:
LOAD * INLINE [
ID_OPERATION, ASSOCIATION, ASSOCIATION_2
7, 96,
8, 5, 3
9, 5, 3
11, 96,
12, 110, 110
13, 5, 3
];

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com

View solution in original post

3 Replies
settu_periasamy
Master III
Master III

You can do it in different methods.

one method.

File_2:
Mapping LOAD * INLINE [
ID, NAME
3, ASSOCIATION
5, RSS
96, EMERGENCY
110, FRANCE
];


Result:
LOAD ID_OPERATION,
ApplyMap('File_2',ASSOCIATION,'') as ASSOCIATION,
ApplyMap('File_2',ASSOCIATION_2,'') as ASSOCIATION_2;
LOAD * INLINE [
ID_OPERATION, ASSOCIATION, ASSOCIATION_2
7, 96,
8, 5, 3
9, 5, 3
11, 96,
12, 110, 110
13, 5, 3
];

 

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Here's another variation which I think has simpler syntax:

AssociationMap:
Mapping LOAD * INLINE [
ID, NAME
3, ASSOCIATION
5, RSS
96, EMERGENCY
110, FRANCE
];
MAP ASSOCIATION, ASSOCIATION_2 USING AssociationMap;


Result:
LOAD * INLINE [
ID_OPERATION, ASSOCIATION, ASSOCIATION_2
7, 96,
8, 5, 3
9, 5, 3
11, 96,
12, 110, 110
13, 5, 3
];

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com

YD
Partner - Contributor II
Partner - Contributor II
Author

Thanks you so much!

 

It works for the both solutions!!!

 

Best regards