[{TableOfContents }]
!!!DEFINE USER CALCULATIONS
[{Image src='IMUC.JPG' width='360' align='right' link='attach/IMUC/IMUC.JPG'}]


UserCalcs may be defined within the Define UserCalcs (IMUC) form. This screen will allow
you to create the lines, variables, commands, etc. for each UserCalc.  The definition data for the Define User Calculations screen is stored in the [P2K_AM_USER_CALCS] tables.

;[User Calc|USER_CALC_CODE]: This field refers to the user-defined name given to the UserCalc. Once the UserCalc has been created it can be edited, however, you can not edit it once the UserCalc is in production. You have to Un-Publish it on [IMUCA] first. As with Benefit and Attendance UserCalcs, we recommend that a naming convention be used for Workflow UserCalcs. For example, AT is used for the Attendance application, BE for the Benefits application and WF for the Workflow application. This will allow for efficient queries once the UserCalc list becomes large.  See [special characters|Naming Convention] section for naming rules.


;[Description]: The description field may be used to further define the purpose of the UserCalc in more detail than is available in the UserCalc name.

;[Product]: The product indicates which module the UserCalc has been defined for. For example, PR-Payroll, BE-Benefits, AT- Attendance, FC-Forecasting & Costing and WF-Workflow.

With respect to Workflow, this field specifies the table code on which the workflow trigger is located. This field should be identical to the name of the "Table" in [IMWA]. In all cases except workflow, it is the application that controls which fields in which tables will be accessible by the UserCalc. For example, in an Attendance UserCalc, the Leave Accrual Table would be accessible, but not benefits information.

;[Status|USER_CALC_STATUS]: This field describes the status of the UserCalc. The following values are available.
|Under Construction|This status value indicates that the UserCalc has not been completed and therefore will not be published.
|Being Tested      |This status value indicates that the UserCalc has been completed, compiled and is being tested by the user who created it. It will not be published.
|To Be Published   |This status value indicates that the UserCalc is ready for publishing. You can not set the user calc to this value manually.
|In Production     |This status value indicates that the UserCalc has already been published and is in use.

;[Type|USER_CALC_TYPE]: The 'type' of UserCalc defines what values may be used/passed between UserCalcs and what capabilities may be performed. Three types are available:
|Qualifiers | Used to reduce the number of employees or calculations processed by the UserCalc.
|Functions  | Used to perform a calculation or query, and return a value to the calculation. The Attendance and Benefits Applications use Functions exclusively.
|Calculations| Used as the main program area, and may call Qualifiers and Functions in order to perform some kind of customized
action or operation. Calculations are only performed in the Payroll Calculation, and Forecasting and Costing applications.

;[Return Value|RETURN_VALUE_TYPE]: The return value is used by Functions and Qualifiers to define what type of value will be returned by the Function or Qualifier UserCalc. If the UserCalc type is Qualifier, the return value will be set to Boolean. If the UserCalc type is Function, the user may choose Boolean, Char(acter), Date or Number as the type of value that will be returned.
;[Usage|USER_CALC_USAGE]:The Usage field defines whether or not the UserCalc will be used to print a disbursement message. Disbursement messages are lines of information that will print on the employee's payroll stub/deposit stub.
|Disbursement Message|the UserCalc will be executed when UPDISB is run.
|Not Specified|Use this or leave it blank for most purposes.
|Secondary WF |This option tells the Work Flow engine that this User Calc is ONLY to be called from another user calc and should NOT be fired on its own by the triggering product.

;[Compile UserCalc]: This button allows the user to check the syntax of a UserCalc by creating the SQL code. This step does not ensure accuracy of the UserCalc, it merely checks that there are no UserCalc language errors such as incorrect syntax or infinite loops.
;[Publish UserCalc]: If the user is signed-on as 'P2K' then a UserCalc may be re-published directly in the IMUC form if it was already 'In Production' and needed to be re-validated. If a user has taken a copy of an 'In Production' UserCalc and wishes to test it without losing the original UserCalc, then they may publish it. This means that wherever the original UserCalc is referenced, Personality will now use the newly published version.
;[Pre-publish]: [CLEANUP]
----
[{Image src='IMUC_Lines.JPG' width='360' align='right' link='attach/IMUC/IMUC_Lines.JPG'}]
!!Lines

The data shown in this tab is stored in the [P2K_AM_USER_CALC_DETAILS] table.

;[Line|COMMAND_LINE]: (00010, 00020, etc.)
This field defines the sequential order in which the UserCalcs will follow instructions.
;CMD: See detailed descriptions in the [User Calc Commands|UC Commands] section. 
;[OT|OPERANDn_TYPE]: OT is Operand Type. Operands must have a ‘Type’. This type is defined in the field before each Operand. See detailed descriptions in the [Operand Types] section. 
;[Operand|OPERANDn]: Operand1 is typically used to store the result of any line of a UserCalc, or to compare to a value in Operand2. Operand2 is used to compare values or assign values.Operand 3 is used, when necessary, to further define Operand 2, or in mathematical operations. 
;OPER Operators are the action to be taken in regard to the command issued and the operands indicated. See detailed description in the [Operators|UC Operators] section.
;[If Goto|GOTO_LINE]: The ''If Goto'' field must be completed for every line. For any IF, FREQ, PPE, BOM, or EOM command there must be a true path (If
Goto), and a false path (Else Goto).  • The ''If Goto'' field tells the UserCalc program which line to proceed to in a __True__ situation. In a situation without a true and false path (i.e. Let PC 110 Equal +12), only the ''If Goto'' field is mandatory. If the ''If Goto'' column is double-clicked on the user will be taken to that line.
;[Else Goto|ELSE_LINE]: For any IF, FREQ, PPE, BOM or EOM command, the ''Else Goto'' field tells the program which line to proceed to in the __False__ situation.  If the 'Else Goto' column is double-clicked on the user will be taken to that line.
;[Description]: To make UserCalcs more easily read and maintained, a Notes field has been provided. Notes should be used to explain the calculations made and the logic of the UserCalc.
----
[{Image src='IMUC_Variables.JPG' width='360' align='right' link='attach/IMUC/IMUC_Variables.JPG'}]
!!Variables

!Section Headings within in each tab
;[FieldName]:Definition
----
[{Image src='IMUC_Globals.JPG' width='360' align='right' link='attach/IMUC/IMUC_Globals.JPG'}]
!!Globals

!Section Headings within in each tab
;[FieldName]:Definition
----
[{Image src='IMUC_Commands.JPG' width='360' align='right' link='attach/IMUC/IMUC_Commands.JPG'}]
!!Commands

!Section Headings within in each tab
;[FieldName]:Definition
----
[{Image src='IMUC_Operators.JPG' width='360' align='right' link='attach/IMUC/IMUC_Operators.JPG'}]
!!Operators

!Section Headings within in each tab
;[FieldName]:Definition


[CLEANUP]