Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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
];
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
];
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
];
Of course, such a silly mistake thank you
And maybe use
Floor(Rand() * 6) as RandNum,
so that Teresa gets a chance to get picked, too.