Function Calculation Syntax

  • Last update: May 16, 2025
  • Overview

    You can add a New Calculation Column operator to create a field by referencing or calculating existing fields without affecting them.

    This document introduces the composition and correct writing format of the formulas in a New Calculation Column operator.

    Formula Composition

    The formula calculation consists of four components:

    Content

    Description

    Function

    A statement used to convert the value or member of a field

    Field

    Fields from your data tables or parameters already set in FineDataLink

    Operator

    A symbol that indicates the operation to be performed

    Constant

    A constant value represented exactly as written in the formula

    For example, consider the following calculation:

    IF(Contract Amount > 2000, "High Value_Order", "Low Value_Order")

    2.png

    The following table shows the corresponding calculation details.

    Content
    Description

    Function

    IF

    Field

    Contract Amount

    iconNote:
    You have to select the field from the left column and cannot enter manually.

    Operator

    For details, see the "Operator Syntax" section.

    Constant

    String: "High-Value_Order" and "Low-Value_Order"

    Numeric value: 2000

    iconNote:
    Not all calculations need all four components.

    For details about how to use each component in a calculation and set the corresponding format, see the following sections.

    Calculation Syntax

    Function Syntax

    In FineDataLink, functions are the main components of calculations.

    1. Functions are displayed in blue, each with a specific syntax.

    For example, add a New Calculation Column operator in the Data Transformation node of a scheduled task, click Add Field Value, and a function list will appear. Next to the function list is the field selection area. When you select a function from the function list, the rightmost section will update to display the required syntax and description of the function, along with one or more examples, as shown in the following figure.

    3.1-1.png

    2. Multiple functions can be used in the calculation. For example: IF(SIGN(Profit)=1,Profit,0).

    Two functions, IF() and SIGN(), are involved in the calculation.

    The above example is a case where one function is included (nested) in another. In this case, the SIGN() function for Profit will be calculated before the IF() function because the SIGN() function is inside the parentheses.

    Field Syntax

    You can insert fields into the calculation. The function syntax usually indicates where to insert the fields. For example: CONCATENATE(Text 1, Text 2, ...)

    For example, if you want to join the Owner_Country and Owner_City fields, enter the formula CONCATENATE(Owner_Country,Owner_City) by selecting the required fields from the left field selection area, as shown in the following figure.

    3.2-1.png

    iconNote:
    Fields are displayed with a light blue background.

    Operator Syntax

    To perform a calculation, you need to know the supported operators. Operators are displayed in black in calculations.

    Arithmetic Operation

    OperatorDescriptionParameter Type and Corresponding Calculation LogicExampleResult Type

    +

    Value addition

    Date calculation

    Text concatenation

    Text + Text / Value / Date / Boolean

    • If any parameter is of text-type, text concatenation is performed.

    • Date-type parameters will be converted into strings in the YYYY-MM-dd HH:mm:ss format.

    • Boolean. FALSE is treated as 0, and TRUE is treated as 1 in calculations.

    • During text concatenation,, if any operand is NULL, it will be considered as an empty string for concatenation.

    • If the values of all operands are NULL, the result will be NULL.

    Date + value X (value X + date) (with the same logic as ADDTODATE())

    • Calculates the date that is X days after the specified date.

    • If the result is a decimal, the fractional part will be converted into hours, minutes, and seconds accordingly.

    • If the value of any operand is NULL, the result is NULL.

    Value X + value Y

    • Value addition

    • If the value of any operand is NULL, the result is NULL.

    iconNote:
    Date + date is not supported.

    3 + 3

    1. Text + text / value / date / Boolean: text type

    2. Date + value X (value X + date): date type

    3. Value X + value Y: value type

    /

    Value division

    Boolean. FALSE is treated as 0, and TRUE is treated as 1 in calculations.

    Value / value: value division

    15/3

    Value type

    If the value of any operand is NULL, the result is NULL.

    If the divisor is 0, the result is NULL.

    iconNote:
    Both sides of this operator must be of the value type.

    *

    Value multiplication

    Boolean. FALSE is treated as 0, and TRUE is treated as 1 in calculations.

    Value * value: value multiplication

    3 * 3

    Value type

    If the value of any operand is NULL, the result is NULL.

    iconNote:
    Both sides of this operator must be of the value type.

    -

    Value subtraction

    Date calculation

    Boolean. FALSE is treated as 0, and TRUE is treated as 1 in calculations.

    Value X - value Y: value subtraction

    Date - value X (with the same logic as ADDTODATE()): calculates the date that is X days before the specified date

    Date - date: calculates the number of milliseconds between the specified dates

    3 – 1

    1. Value X - value Y: value type

    2. Date - value X: date type

    3. Date - date: value type

    4. If the value of any operand is NULL, the result is NULL.

    iconNote:
    Value - date is not supported. Text-type values cannot be used as minuends or subtrahends.

    Comparison Operation

    OperatorDescriptionParameter Type and Corresponding Calculation LogicExampleResult Type

    >

    <

    >=

    <=

    =

    ==

    !=

    Comparison operation

    Text, Value, Date, and Boolean

    1. >, <, >=, and <=: Both sides of the operator must be of the same type. Automatic conversion is not supported.

    2. =, ==, and !=: No type requirement for both sides of the operator. Values of different types are considered unequal. Only when the types are consistent will the value comparison be carried out.

    = and == are considered as equivalent inputs.

    A1 > B1

    A1 < B1

    A1 >= B1

    A1 <= B1

    A1 = B1

    A1 == B1

    A1 != B1

     

    Boolean

    If the value of any operand is NULL, the result is NULL.

    The system first judges the type and then checks whether NULL values exist.

    Logical Operation

    OperatorDescriptionParameter Type and Corresponding Calculation LogicExampleResult Type

    !

    Logical NOT

    Boolean

    FALSE is treated as 0, and TRUE is treated as 1 in calculations.

    For value-type data:

    • Non-zero values are considered true.

    • Zero values are considered false.

     

    !A: If A is true, !A is false.

    Boolean

    If the value of any operand is NULL, the result is NULL.

    Precedence

    OperatorDescriptionParameter Type and Corresponding Calculation LogicResult Type

    ()

    Increases operation precedence

    -

    -

    Constant Syntax

    Text expressions can be used to represent constant values as written. When using functions, you may need to use text expressions to represent values such as numbers and strings.

    Expression TypeDescription

    Text

    Content enclosed in double quotes marks

    Value

    Numbers written without any symbols

    NULL

    Simply written as NULL

    Case-insensitive

    Boolean

    Simply written as TRUE or FALSE

    Case-insensitive

     

     


    附件列表


    主题: Data Development - Scheduled Task
    Previous
    Next
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy