反馈已提交

网络繁忙

You are viewing 5.1 help doc. More details are displayed in the latest help doc.

Calculation operator and priority

  • Recent Updates: April 08, 2022
  • 1. Overview

    Operator is used to specify the type of calculation to perform on the elements in the formula. There is a default calculation order, but you can change this order using parentheses.

    2. Operator type

    There are four different types of evaluation operators: arithmetic, comparison, logic, and string splicing.

    2.1 Arithmetic operator

    Perform basic mathematical operations, such as addition, subtraction, multiplication, division, etc., and use the following arithmetic operators in the formula:

    Arithmetic operator
    ExampleResult
    +(Plus)= 3 + 36
    -(Minus)= 3 - 12

    *(Multiply)

    = 3 * 3

    9

    /(Divide)

    = 15 / 3

    5

    %(Remainder)

    = 20 % 6

    2

    ^(Power)

    = 3 ^ 2

    9

    2.2 Comparison operator

    You can compare two values using the following operators. When these operators are used to compare two values, the result is a logical value of "TRUE" or "FALSE".

    Comparison operator
    MeaningExample

    =(Equal sign)

    Equal

    A1 = B1

    >(Greater than sign)

    Greater than

    A1 > B1

    <(Smaller than sign)

    Less than

    A1 < B1

    >=(Greater than or equal to sign)

    Greater than or equal to

    A1 >= B1

    <=(Less than or equal to sign

    Less than or equal to

    A1 <= B1

    !=(Unequal sign)Note: it is different from < > in Excel.

    Unequal to

    A1 != B1

    2.3 Logical operator

    Logical operators are used in the same way as "AND" and "OR".

    Logical operatorMeaningExample
    &&

    Logical and, satisfying multiple expression conditions at the same time

    Sales volume>=10&&Sales person>=2
    ||Logical or, as long as one of multiple expression conditions is satisfiedSales volume>=10||Sales person>=2

    Note: logical operators can only connect two boolean or numeric expressions.

    2.4 String splicing operator

    You can use the "+" operator to merge text fields

    For example, the text fields "store style" and "store name" can be spliced together. Of course, the CONCATENATE indicator can be used, but a simpler scheme is to directly use "+", as shown in the following figure:

    3. Order of formula operation

    In some cases, the order in which calculations are performed may affect the return value of the formula, so you must know how to determine the order and how to change the order to obtain the desired results.

    3.1 Operator priority

    If there are several operators in a formula, FineBI will calculate in the order in the following table. If several operators in a formula have the same priority (for example, if a formula has both a multiplication sign and a division sign), finebi will calculate the operators in the following direction.

    PriorityOperatorMeaningUsageCombination direction
    1

    -

    Minus

    -Para

    From right to left

    2^PowerPara^Para

    From left to right

    3*

    Multiply

    Para*Para
    /

    Divide

    Para/Para
    %

    Remainder

    Para%Para
    4+

    Plus

    Para+Para
    -MinusPara-Para
    5>

    Greater than

    Para>Para
    <Less thanPara<Para
    >=

    Greater than or equal to

    Para>=Para
    <=

    Less than or equal to

    Para<=Para
    6=、==Equal to

    Para=Para

    Para==Para

    !=Unequal toPara!=Para
    7&&

    Logical AND

    Para&&Para
    8||

    Logical OR

    Para||Para

    3.2 Calculation method using parentheses

    To change the calculation order, you need to enclose the part of the formula to be calculated first in parentheses.

    For example, the following formula generates 11 because multiplication is calculated before addition. The formula first multiplies 2 and 3, and then adds 1 and 4 to the result.

    =1+2*3+4

    However, if you change the syntax with parentheses, you add 1 and 2 together, then multiply the result by 3, and then add 4 to get 13.

    =(1+2)*3+4



    Attachment List


    Theme: Advanced Data Analyis
    Already the First
    Already the Last
    • Helpful
    • Not helpful
    • Only read

    售前咨询电话

    400-811-8890转1

    在线技术支持

    在线QQ:800049425

    热线电话:400-811-8890转2

    总裁办24H投诉

    热线电话:173-1278-1526

    文 档反 馈

    鼠标选中内容,快速反馈问题

    鼠标选中存在疑惑的内容,即可快速反馈问题,我们将会跟进处理。

    不再提示

    10s后关闭