Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 khasimvali85
		
			khasimvali85
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
About ApplyMap() Can Anybody Explain brief with Example?
Thanks
Khasim
 
					
				
		
 vijetas42
		
			vijetas42
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
Check this example,Hope you will understand
TEMP:
Mapping Load * Inline
[
id2, pg1
1, abc
2, mno
3, tuv
4, xyz
];
T1:
Load * Inline
[
id1, id2, value
A, 1, 100
B, 2, 120
C, 3, 140
]Where Match(id1,'A','B');
Left Join
Load * Inline
[
id1, pg1
A, pqr
B,
D, xyz
E, 123
];
NoConcatenate
FINAL:
Load id1, id2, value, IF(pg1='',ApplyMap('TEMP',id2),pg1) as pg1 Resident T1;
Drop Table T1;
Regards,
Vijeta
 
					
				
		
Check this link
 
					
				
		
.png) hic
		
			hic
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		 
					
				
		
 vijetas42
		
			vijetas42
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
ApplyMap is a Mapping or lookup function
Ex. one of my scenario where I have applied ApplyMap is,
For missing Employee name we have to use lookup function (ApplyMap) to get data from excel .At the time of showing Employee code and Employee name, from sap source table we have, Employee code Employee name that is but for some of the Employee code, Employee name is missing and there is excel file in which they are having Employee code and name so, we have used ApplyMap and checked that if any Employee name is missing then apply lookup on excel for respective Employee code and get that Employee name.
Hope this will help you to understand ApplyMap concept and where it should be applied!!!
Regards,
Vijeta
 
					
				
		
 ngulliver
		
			ngulliver
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
As well as Henric's excellent blog there is also one by Steve Dark that is worth looking at:
http://www.quickintelligence.co.uk/applymap-is-it-so-wrong/
Regards,
Neil
 
					
				
		
Hi,
It works similar to Vlookup in Excel. Only Difference is we need to create Mapping table to fetch the relevant data. Mapping table always contains 2 columns, first column is the reference and second column is the data which you want to extract, only drawback is from one mapping table you can extract only one column, cannot fetch multiple columns from single mapping table....
Regards,
Savitha
 khasimvali85
		
			khasimvali85
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi Savitha,
Thanks for Information
i under stood the concept but how to apply in Script? give me two or more examples.
Thanks
Khasim.
 khasimvali85
		
			khasimvali85
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi Sharma,
Thanks for Information
i under stood the concept but how to apply in Script? give me two or more examples.
Thanks
Khasim.
 
					
				
		
 vijetas42
		
			vijetas42
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
Check this example,Hope you will understand
TEMP:
Mapping Load * Inline
[
id2, pg1
1, abc
2, mno
3, tuv
4, xyz
];
T1:
Load * Inline
[
id1, id2, value
A, 1, 100
B, 2, 120
C, 3, 140
]Where Match(id1,'A','B');
Left Join
Load * Inline
[
id1, pg1
A, pqr
B,
D, xyz
E, 123
];
NoConcatenate
FINAL:
Load id1, id2, value, IF(pg1='',ApplyMap('TEMP',id2),pg1) as pg1 Resident T1;
Drop Table T1;
Regards,
Vijeta
