Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
We have EmployeeID, Date and Salary in a table(It contains yearly data). What we need is, we want to know what is the current salary(Based on Max(Date)) against each EmployeeID. Since we need to use this as an mapping load so that we can get the current salary of an employee against the EmployeeID(Using the applymap).
Please help
look at reference manual for applymap() syntax.
Thanks for your response. I want to create a mapping load which contains current salary against employeeid so that we can use applymap and get required information.
Try this:
source:
LOAD
EmployeeID,
Date,
Salary
From someplace;
//
INNER JOIN (source) LOAD
EmployeeID,
max(Date) as Date
RESIDENT source
GROUP BY EmployeeID;
//
EmployeeSalaryMap:
MAPPING LOAD DISTINCT
EmployeeID,
Salary
FROM source;
Hi,
What I would try is have 1 table with the Max Date ORDER BY Date DESC, then Peek() the Date from that table and have MAPPING LOAD table for EMPID & Salary using WHERE clause for Date = WHateveer the name of your Peek above is. Finally use you Applymap() function.
i.e.
MaxDate:
LOAD
Date
FROM .......EmployeeTable
ORDER BY Date DESC;
LET vMaxDate = PEEK('Date');
Drop Table MaxDate;
//Mapping table
MAPPING LOAD
EmpID
,Salary
FROM.......EmployeeTable
WHERE Date = $(vMaxDate);
Hi,
find attached app ,
you ma need to modify according your need.
Thanks
BKC