Editing Arrays
ProAdmin expects certain salary and service data to be in organized into specific formats or structures. For example:
Reported salary and hours histories should be start/stop arrays where the start/stop dates reflect when the salary or hours were earned,
Event or status history should be an effective date array with a code to indicate what event or status occurred.
When your original data is not in the appropriate format, you can reformat it outside of ProAdmin (e.g., your DBA creates a view with the data in the appropriate format), or edit it from within ProAdmin. In ProAdmin, you may edit data in a data default or from within an Hours or Salary Transformation expression. Because ProAdmin is a parameterized system, the earlier you edit the data, the less the parameters will have adjusted/modified the data. Data defaults are one of the first things that are performed (before almost any parameters have been applied) and transformation expressions are performed after most of the Salary/Service Definition’s parameters are applied. For example, if you need to edit your salary data and you do it in the Salary Transformation expression, you might have to do something extra in your expression to project the edited data because the salary projection was performed before the Salary Transformation is applied. Thus, editing the data in the Data Defaults is preferred: do it earlier and let ProAdmin do most of the work for you!
When you use Data Defaults to edit data:
You almost always should apply the data default for all values, whether or not missing.
When you edit an existing field (e.g., Salary) in data defaults, you need another field to hold the edited data. You might be tempted to call that field AdjustedSalary, but SalaryAdjusted is probably a better name because member data is display alphabetically. This way, you will see the data in your Salary field, immediately followed by the data in SalaryAdjusted, making is much easier to check your edits.
Below are several example expressions for editing data from within the Data Defaults. Most of them are organized as follows:
The first 3-4 lines assign some local variables with the start dates, stop dates (if appropriate), and values of an existing array (e.g., the salary field called Salary)
B_DT:= #START Salary & ; start datesE_DT:= #STOP Salary & ; stop datesV:= #VALUE Salary & ; values (i.e., the reported salaries)
The last few lines create the final start/stop or effective date array (e.g., AdjustedSalary) from various local variables and may be followed by notes:
11 #ARRAY(B_DT,E_DT,V) ; create a start/stop array (start,stop,values); NOTE: #ARRAY drops any row with a ZERO start or stop date
The middle section contains the interesting part of the expression which “adjusts” dates and values of the original array.
Most of the examples take advantage of the fact that if you set an effective, start, or stop date equal to zero (i.e., 1/1/1900), #ARRAY automatically drops that row from the final array.
Most of examples require some kind of date calculation (e.g., find the beginning of the plan year containing the stop date). Often there are multiple ways of performing the same date calculation. In these examples we try to illustrate some of the different ways you can adjust a date in an expression.
You can find many other ways to adjust dates in Date Rounding in Expressions.
Below are examples of editing arrays: