Designing a Formula Component

You can create a formula component from the System View or any other view. You can also create a formula component from within the Rule or Template Designer as you are designing a business rule or template. Formula components can be used in business rules and templates.

To create a formula component:

  1. In System View, right-click Formulas, and then select New.

    The New Formula dialog is populated with the Planning application type, the Planning application, and the plan type.

    Note:

    You can also create a formula component from within a business rule or template by dragging a new formula component into the business rule or template flow chart.

  2. Enter a name, application type, application, and plan type to which the formula component belongs.
  3. Click OK.
  4. Optional: On the Component Designer, you can perform any of these tasks:
    • Click Add Grid, and select Insert Grid Before, Insert Grid After, or Insert Grid At End to add another grid. By default, the Formula tab displays one grid.

    • Click Delete Grid to delete a selected grid.

    • Click the Find icon to find text in the formula grid in which you are working. Perform these tasks:

    • Click the Find and Replace icon to find and replace text within the script.

  5. On Formula, enter a caption for the formula.
  6. Users creating a formula component for a template only: On the Formula tab, select Use Design Prompt if you want to use a design-time prompt in the formula component. Then in the condition grid, define a condition for the design-time prompt by performing these tasks:
    1. In DTP, select a design-time prompt.
    2. In Operator, select an operator: = = or <>.
    3. In Value, select a value from the dropdown list.
    4. Repeat these steps to create as many statements in the condition as you need.

      Tip:

      Click the plus (+) and minus (-) icons to add and delete rows from the grid. Change the And to Or by clicking in the field next to And; select Or from the dropdown list.

  7. By default, processing of a formula component calculation starts with the first member you enter in the grid. If you want to start processing the formula component calculation with another member, enter the member or function name in Member Block, or click the Ellipsis icon to pick one from the Member Selector. See About Adding Members and Functions to a Component.
  8. In Comment, enter comments for the conditional and formula statements you want to create.
  9. Optional: To create a conditional statement (that is, an IF statement) for the formula component, click Add Condition. See Using the Condition Builder to Create Conditional Statements.
  10. Optional: In the IF row that is displayed, enter the text of the condition statement, or click the Add/Edit condition icon in the right column of the row to access the Condition Builder. The Condition Builder enables you to design a condition statement graphically.

    Note:

    Though you can select IF, ELSE IF, and ELSE from the down arrow, by default, the first statement must be an IF statement.

  11. Optional: Use the Condition Builder to design the IF conditional statement. See Using the Condition Builder to Create Conditional Statements.
  12. In the Formula row, click in the row to the left of the equal sign to create a formula statement. Click the Actions icon, and select:

    Note:

    If you created a conditional statement (that is, an IF statement) in step 9 through step 11, the formula statement you create in this step is the THEN statement of the condition.

  13. In the Formula row, click in the row to the right of the equal sign to complete the formula statement. Click the Actions icon, and select:
  14. Click the Comments icon to enter comments about the calculation statement row. Click OK.
  15. Optional: If you want to create another IF statement, or an ELSE IF or ELSE statement, complete these steps:
    1. Click Add Condition.
    2. Click the down arrow, and select one of these options:
      • IF: select this to create an IF conditional statement. If the IF statement is TRUE, then actions are performed; if the IF statement is FALSE, then other actions are performed.

      • ELSE IF: select this to create an ELSE IF conditional statement. The actions in this statement are performed if there is an associated IF statement and the IF statement is FALSE.

      • ELSE: select this to create an ELSE conditional statement. The actions in this statement are performed if there is an associated ELSE IF statement and the ELSE IF statement is FALSE.

        Note:

        If you remove the condition statement from an IF or ELSE IF block, and if the next block contains an ELSE IF statement, then the next block is changed to an IF block. However, if the next block contains an ELSE statement, then the condition statement in this block is removed.

    3. Repeat step 9 through step 14 to design additional statements for the formula component. A formula grid can consist of one or more formula blocks that contain a collection of formula statements. You can also enter a comment and a condition for the block, though this is optional.

      Tip:

      If necessary, click the + icon to add more formula rows.

  16. On Properties, complete these steps:
    1. Users creating a formula component for a business rule only: When you drag and drop the formula component into a business rule from New Objects, Shared is not selected. To make this formula shared, select the Properties tab of the formula, select Shared, and name the formula.

      When you create a formula component from the System View, Shared is selected by default, and you cannot change it. If, instead, you want a copy of the formula in a business rule, drag the shared formula into the business rule, then clear the Shared check box on the Properties tab. This creates a copy of the shared formula in the business rule; the copy of the shared formula is not changed if the shared formula is changed. When you save the business rule, the formula no longer has a name.

    2. Optional: Edit the formula's name by entering a new one of up to 50 characters. (The name defaults from the New Formula dialog.)
    3. Optional: Enter a description of up to 255 characters for the formula.
    4. Optional: Enter a caption for the formula. The caption is displayed below the formula in the Designer and Template Designer flow charts.

      Note:

      If the component does not have a caption, and the component is not shared, the first part of the component is shown in the flow chart. For example, if you have a formula, "Salaries" = 40, that is not shared and does not have a caption, then the flow chart shows "Salaries" = 40 for the formula component. If the component is shared, and does not have a caption, the name of the component is shown in the flow chart.

    5. Enter comments for the formula. For example, you may want to tell users what the formula should be used for.
  17. Users creating a formula component for a business rule only: On Usages, you can view the rules that use the formula component.

    Note:

    None of the information on the Usages tab can be edited.

  18. Click Save button.