Adding Formulas to Fields

Using uDesigner, you can create formulas for fields that, in Unifier, will calculate the value of the field and display it. Calculated fields usually will be read-only fields. You can also build composite fields that combine string text data elements into one field.

Notes:

Creating Formulas using String (Text) Data

In uDesigner, you can create a composite field that combines multiple data elements. String building involves combining values from text box data elements and specifying a string-type pull-down. For example, you can create a field called "Project Identifier" using a formula that includes Project, Record No., and location.

You can define a string formula only for text box and multi-line text field data elements. This feature is typically for building fund code segments, but you can also use it to build an address code field to Including a Map.

String formulas can be up to 250 characters long, including the delimiters (such as dashes or underscores).

To create a string formula:

  1. Open the form containing the field for which you want to build a formula. The Form Designer window opens.
  2. Click the Properties button on the toolbar. The Elements Properties window opens.
  3. Select the field and click the Formula button. The Formula Creation window opens.
  4. Select the delimiter.

    The delimiter separates the elements. For example if you select a dash (-) between elements for Project Identifier, it would appear as Project-Record-Location.

    You must select the delimiter before adding the element to the right pane.

  5. Select an element from the left pane and click Add Parameter. The element moves to the right pane.

    If you want to change your selection, click Undo or Clear All. After you add an element, the element list is disabled and the delimiter icon is activated.

  6. Click the delimiter icon to add it into the formula creation field.
  7. Continue adding other elements following the same procedure.
  8. Click OK to save the formula and close the window.

Creating Numeric Formulas

You can use any integer, currency, or decimal amount data element to create a formula. The field that holds the calculated value must be numeric with decimals, and there must be other numeric data elements on the form. The formula is based on calculations that you assign to the field by selecting from a list of the numeric data elements on the form. A numeric formula can include a logarithmic function.

Besides integer, decimal or currency amounts, you can also use the values in pull-down menus, radio buttons, and check boxes for numeric formulas. For pull-down menus in calculations, the value of the chosen data set will be used. For radio buttons, the value of the button will be used (1 or 2 are the default values, but the formula will use whatever values are specified when the business process is set up). For check boxes, 1 or 0 will be used in the formula. If the check box is checked, the value will be 1; if it is not checked, the value will be 0.

Numeric formulas can be up to 250 characters long, including the delimiters (such as dashes or underscores).

To create a numeric formula:

  1. Open the form that contains the field for which you want to create a formula. The Form Designer window opens.
  2. In the Form Designer window, select the field for which you want to create the formula.

    When the calculation is performed, this field will appear as read-only on the form and is automatically updated whenever the fields that make up the formula change.

  3. Click the Formula button. A Formula Creation window opens.
  4. In the Formula Type field, choose Formula from the list.
  5. Click the Create button. Another Formula Creation window opens.
  6. In the Element pane, select the data element and click Add Parameter to add it to the Formula pane.

    Only those fields that can be used in a formula will appear in this list.

  7. Use the numeric keypad to enter the calculating operators to create a formula, or to enter numeric values to use on the element.

    Each time you enter an operator, the elements become available again to add to the formula.

  8. Continue Steps 6 and 7 until you have completed the formula.
  9. Click OK to save your changes and close the window.

To create a numeric formula with a logarithmic function:

The log function supports fields on business process forms only, not attribute forms, attribute/detail forms for managers, or manager sheets. Also note: uDesigner calculates base 10 logarithms, so the base is assumed.

  1. Follow steps 1 through 5 explained in the previous procedure.

    You can start the formula using the log function, or start it using an element or numbers and operators, followed by the log function. For example:

    log(SQ Footage) * Unit Cost

    or

    100*Quantity/log(Cost) + 75

  2. However you start the formula, you must click the log button to enter the logarithm. When you do so, uDesigner enters log( ( into the formula box.
  3. To continue the log formula, you can use an element from the Element list, or enter numbers and operators using the number pad.
  4. At the end of the log function, click the end-parenthesis ( ) ) button on the numeric pad.
  5. To complete the formula, add other operators and numbers to the formula, if necessary.
  6. Click OK.

Creating formulas that use dates

You can create two types of date formulas:

Formulas Using Date Fields

uDesigner provides two data definitions upon which date pickers can be built: Date Picker, which includes the date and time, and Date Only, which does not include the time. Data elements built on these definitions cannot be mixed in a formula. For example, to create a date-add formula for a date-and-time type of field, you can add an integer only to another date-and-time element; you cannot use a date-only type of element in the equation.

To create a date plus/minus formula:

  1. Open the form that contains the date field for which you want to create a formula. The Form Designer window opens.
  2. In the Form Designer window, select the date field for which you want to create the formula.

    When the calculation is performed, this field will appear as read-only on the form and will be automatically updated whenever the fields that make up the formula change.

  3. Click the Formula button. A Date Formula window opens.

    Select the date field, choose plus or minus, then specify the number of days to add or subtract from the second data element.

  4. For Calculations based on, choose:
    • Calendar Days to calculate the formula based on calendar days. This option does not take company non-working days into account.
    • Work Days to calculate the formula based on the company calendar working and non-working days.

Example:

When: Date 2 = Date 1 + 1 working day

To create a date-difference formula:

  1. Open the form that contains the field for which you want to create a formula. The Form Designer window opens.
  2. In the Form Designer window, select the date field for which you want to create the formula.

    When the calculation is performed, this field will appear as read-only on the form and will be automatically updated whenever the fields that make up the formula change.

  3. Click the Formula button. A Formula Creation window opens.
  4. In the Formula Type field, choose Date Difference from the list.

    The window expands to show additional fields, as shown in the table below.

  5. Click OK to save your changes and close the window.

In this field:

Do this:

Latest Date

Click the down arrow. uDesigner displays a list of all the numeric fields on the form. From this list, choose the field that contains the later of the two dates that will be used in the calculation.

Earliest Date

Click the down arrow. From this list, choose the field that contains the earlier of the two dates that will be used in the calculation.

Calculations based on

Choose Calendar Days to include all the days of the week in the calculation. Choose Work Days to use only the work days of the week in the calculation.

Linking Data Pickers Using a Formula

Data pickers can be linked to corresponding pickers in order to make available to the user the functionality of the data picker and also of the linked picker.

To link a data picker:

  1. Open the form on which you want to link the pickers.
  2. In the Form Design window, click the Properties button. The Elements Properties window opens.
  3. On the Elements Properties window, select the shell picker, the code picker of a configurable manager, or the user picker you want to connect to a data picker.
  4. Click the Formula button. The Formula Definition window opens.
  5. In the Data Picker Element field, select the data picker element on the form that you want to link to the picker or shell you selected.
    • For rollups to a configurable manager sheet: The configurable manager data picker will populate the code picker for the manager with the value and the data will roll up to the code on the sheet. The field becomes read-only. Anytime the data picker value changes, it will be automatically reflected on the code picker.
    • For BP auto-creation across shells: The shell will use the shell data picker to tell it where to create the business process.
    • For business processes, a Configurable Manager, and shells: The user data picker, when linked to the User Picker, will provide the functionality of both the User Picker and the User Data Picker. Refer to the Unifier Data Reference Guide for descriptions of the picker data elements.

Using a Formula in a Required Field

You can define a formula for a required field in your form.

If you create a BP record or line item by way of CSV/Excel or RESTful web services, if the required elements are set as formulas, and the required elements are not included in the Integration tab (company or shell), then the system will not complete the BP record or line item creation.

Note: In the Bidder detail form, the short description (short_desc) DE is a required field. You cannot add the (short_desc) DE in a hidden block.



Last Published Monday, June 3, 2024