About Calculated Attributes

Calculated attributes are read-only. Administrators can add attributes to the attributes sections in the Actions dialog boxes, and workflow users can view them in the actions dialog boxes and in transactions. Administrators can restrict access to certain roles by setting access to Do Not Display. For example, for calculated attribute XYZ, an administrator could add Viewer: Do Not Display access to it, so that XYZ would not be displayed to viewers.

Any user role can add calculated attributes as columns in views and portlets. They can also be added as filterable attributes in the Filter Panel.

Note:

You cannot create calculated attributes that result in a cyclic dependency. For example, the following calculated attributes are not allowed, where A and B are dependent on each other: A= {B}*(-1) and B= {A} + 100, since that causes a cyclic dependency which is not permitted and causes errors.

About Calculation Types

  • Assign Value to List—Assign a value to a List type attribute

  • Assign List To Value—Assign a List Value to the value of a different attribute. Only available for attributes of type List

  • Conditional—A conditional calculation (If – Then – Else)

  • Scripted—A free-form scripted calculation. Scripted is available for attributes of type Text, Number, or Integer

The following table lists the calculation types that each attribute type can use when the Calculation option is chosen:

Table 10-3 Calculation Types that Each Attribute Type Can Use When the Calculation Option is Chosen

Attribute Type Assign Value to List Conditional Scripted Assign List to Value
Date     X  
Integer X X X  
List        
Number X X X  
Text X X X  
Yes/No   X    

Examples of Scripted Functions

Other scripted function examples:

  • Date Difference: Returns the difference in days, hours minutes, or seconds between two dates. For Date1 and Date 2, the values 'TODAY' and 'NOW' can be used, which denote the current date (with no time component) and date-time, respectively.

    DATE_DIFF(<Date1>, <Date2>, <Type>)

    Example: DATE_DIFF('TODAY', {Preparer End Date}, 'DAYS') or DATE_DIFF({Preparer End Date}, 'NOW', 'HOURS')

  • Extract Text: Returns the substring within the value, from the positions specified.

    SUBSTRING(<Value>, <Location>, <Length>)

    Example: SUBSTRING( {Name} , 5, 10)

  • If Then Else: Allows the user to insert a conditional calculation into the scripted calculation. IF_THEN_ELSE calculations can also be nested to support "ELSE IF" type calculations.

    IF_THEN_ELSE(<Condition>, <Value1>, <Value2>)

    Example:

    IF_THEN_ELSE( {Risk Rating} = 'Low', 'Good',
    IF_THEN_ELSE( {Risk Rating} = 'Medium', 'Better',
    IF_THEN_ELSE({Risk Rating} = 'High', 'Best','Bad')))
    
  • Length Takes a text value as a parameter and returns an integer which is the number of characters in the text.

    LENGTH('Value') returns 5, and LENGTH({Name}) would return the number of characters in the name of the object. If the value is empty/null, the calculation will return 0.

    Use the calculation with SUBSTRING to extract the last 4 characters of a text value.

    Example: SUBSTRING( {MyString}, LENGTH ({MyString}) - 4

  • Lowercase Returns the value in lower case.

    LOWERCASE(<Value>)

    Example: LOWERCASE( {Description} )

  • Maximum: Returns the maximum value from a list of attributes. There can be any number of parameters.

    MAX(<Value1>, <Value2>,<ValueN>)

    Example: MAX({Acccount1},{Account2},{Account3})

  • Minimum: Returns the minimum value from a list of attributes. There can be any number of parameters.

    MIN(<Value1>, <Value2>,<ValueN>)

    Example: MIN({Acccount1},{Account2},{Account3})

  • Round: Returns the value rounded to the decimal places specified.

    ROUND(<Value>, <Decimal Places>)

    Example: ROUND( ({Scripted Translate} /7), 4)

  • Text Location: Returns the index of the substring within the value, starting at 1 as the first position.

    INSTRING(<Value>, <Value To Search>)

    Example: INSTRING( UPPERCASE( {Name} ), 'TAX' )

  • Uppercase: Returns the value in upper case.

    UPPERCASE(<Value>)

    Example: UPPERCASE( {Name} )