Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
 jblomqvist
		
			jblomqvist
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi all,
I have the following piece of script:
Emp:
LOAD Floor(SalesID) as SalesID, Name INLINE [
SalesID, Name
1, Julie
2, John
3, David
4, David R
5, Teresa,
0, Michael
];
Data:
LOAD
ApplyMap('Emp', RandNum,'Missing') as SalesPerson,
*;
LOAD
Floor(Rand() * 5) as RandNum,
<other data>
FROM datafile.xls;
The output is blank for SalesPerson column:

Any idea how to fix this?
The point is to assign a random sales person based on the RandNum field. 
 Kushal_Chawda
		
			Kushal_Chawda
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Mapping key word missing
Emp:
mapping LOAD Floor(SalesID) as SalesID, Name INLINE [
SalesID, Name
1, Julie
2, John
3, David
4, David R
5, Teresa,
0, Michael
];
 Kushal_Chawda
		
			Kushal_Chawda
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Mapping key word missing
Emp:
mapping LOAD Floor(SalesID) as SalesID, Name INLINE [
SalesID, Name
1, Julie
2, John
3, David
4, David R
5, Teresa,
0, Michael
];
 sunny_talwar
		
			sunny_talwar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Did you miss the Mapping keyword?
Emp:
MAPPING
LOAD Floor(SalesID) as SalesID, Name INLINE [
SalesID, Name
1, Julie
2, John
3, David
4, David R
5, Teresa,
0, Michael
];
 
					
				
		
 jblomqvist
		
			jblomqvist
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Of course, such a silly mistake  thank you
 thank you 
 
					
				
		
 swuehl
		
			swuehl
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		And maybe use
Floor(Rand() * 6) as RandNum,
so that Teresa gets a chance to get picked, too.
