IN

  • Last update:  2023-06-28
  • Overview

    Version

    FineBI Version
    6.0.9

    Functions

    IN is used to evaluate whether the result of the expression belongs to the set constructed by para 1, para 2, para 3, and so on. If it belongs, the result is 1. If not, the result is 0.

    Syntax

    IN(exp,para1,para2,para3,...)

    Evaluate whether the result of the expression belongs to the set constructed by para 1, para 2, para 3, and so on.

    Parameter 1

    exp

    Any type of expression (cannot be NULL)

    Parameter 2

    para1,para2,para3,...

    Constant/constant expression/component parameter of any type

    Notes

    1. All parameters in the IN function must be of the same type.

    2. When parameter 1 of IN is a component parameter and is assigned multiple values (such as a parameter bound to a multiselect text filter component). Component error: "The first parameter of IN cannot be a multivalued parameter".

    1.png

    Example

    Find the contract volume of standing agreement and standing agreement order in the Contract Information table.

    1. Create a subject, and upload example data: Contract InformationCreate a component based on this table. Add a calculation indicator to evaluate whether the contract type is a standing agreement.

    If the value of Contract Type is Standing Agreement or Standing Agreement Order, the contract is a standing agreement. Enter the formula: IN(Contract Type, "Standing Agreement Order", "Standing Agreement").

    Note: The Contract Type in the formula is not entered manually. Instead, you can select it by clicking the field on the left.

    1.png

    Drag Contract ID and Contract Type to Dimensions, Whether the Contract Type is a Standing Agreement to Indicators. It can be found that the value of Standing Agreement and Standing Agreement Order is 1 while the value of other types is 0.

    2.png

    2. Calculate the contract volume of standing agreements. Add a calculation indicator, and enter the formula: DEF_ADD(SUM_AGG(Contract Volume),[],Whether the Contract Type is a Standing Agreement).

    1.png

    In this way, you can only view the contract volume of standing agreements in the component.

    2.png

    The contract volume of standing agreements displayed with KPI indicator card is shown below:

    33.png

    3. More examples:

    Formula

    Result

    Note

    IN(1,1,2,3)

    1

    /

    IN(City,"Tokyo","New York","London")

    Rows with the city field values that equal to Tokyo, New York, or London = 1, all other rows = 0.

    /

    DEF(SUM(Sales Volume),[],[IN(City,$Component Parameter)])

    Calculate the total sales amount of the cities that belong to the component parameter value.

    /

     

     


    附件列表


    主题: Advanced Data Analyis
    • 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