Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi! I have a salary.qvd file that is filled with new data every month:
SalaryPeriod | EmpID | SalaryType | SalaryDescr | Amount |
1901 | 1 | 01 | Montly | 30000 |
1901 | 1 | 02 | Sick Leave | -800 |
1901 | 2 | 01 | Monthly | 38000 |
1901 | 2 | 011 | Overtime | 1500 |
1901 | 3 | 07 | Hourly | 32000 |
1901 | 3 | 011 | Overtime | 1000 |
1902 | 1 | 01 | Monthly | 30000 |
1902 | 1 | 011 | Overtime Hourly | 800 |
1902 | 2 | 01 | Monthly | 38000 |
1902 | 2 | 011 | Overtime Hourly | 1400 |
1902 | 3 | 07 | Hourly | 32000 |
The description of the salary type code might change over time. In the example above, code 011 has changed from "Overtime" to "Overtime Hourly".
I want the end user app to always show the latest description for each code.
My initial thought is to separate the description from the salary table and use mapping load and apply map, but I'm not sure how to solve to only chande description if it has changed.
Any suggestions?:)
I have made a script for you, Firstsortedvalue and separating the Salary desc from the main will make the original table undisturbed. Use the description from SalaryDesc table
Salary:
LOAD SalaryPeriod,
EmpID,
SalaryType,
SalaryDescr as [Original SalaryDescr],
Amount
FROM
[Salary.qvd]
(qvd);
SalaryDesc:
Load SalaryType, FirstSortedValue(DISTINCT [Original SalaryDescr], -1 * SalaryPeriod) as SalaryDescr
Resident Salary
Group by SalaryType;
thanks
Celambarasan