IN

  • Last update:October 17, 2025
  • Overview

    Version

    FineBI Version

    6.0.9

    Function Description

    The IN function is used to determine whether the result of an expression belongs to the set constructed by parameter 1, parameter 2, parameter 3, ..., and parameter N. If the result of the expression belongs to the set, the returned value is 1. Otherwise, the returned value is 0.

     

    Syntax

    IN(Exp,Para1,Para2,Para3,...)

    Used to determine whether the result of an expression belongs to the set constructed by parameter 1, parameter 2,   parameter 3, ..., and parameter N.

    Parameter 1

    exp

    Any expression of any type (not 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 the IN function is a component parameter and is assigned multiple values (for example, a component parameter bound to a filter component and configured with multiple values), a component error will occur, saying "The first parameter of IN cannot be a multivalued parameter", as shown in the following figure.

    1687864363363630.png

    Example

    For example, you can use the function to calculate the contract amounts of long-term orders in Contract Fact Table.

    1. Create an analysis subject, and upload the data table Contract Fact Table. Create a component with the table, select Add Calculation Field to add a calculation field, and name the field Long-term Order or Not.

    When the contract type is Long-term agreement or Long-term agreement orders, the order belongs to the long-term order. Enter the formula: IN(Contract Type,"Long-term agreement orders","Long-term agreement")

    iconNote:
    Contract Type in this formula is not manually entered, but selected from the fields on the left side.

    2.png

    When you add fields to the component, the values for long-term orders are set to 1, while all others are set to 0, as shown in the following figure.

    3.png

    2. To calculate the contract amounts of long-term orders, add a calculation field with the formula DEF_ADD(SUM_AGG(Total Amount),[],Long-term Order or Not).

    4.png

    Only the contract amounts of long-term orders are displayed in the component, as shown in the following figure.

    5.png

    You can display the total contact amount in a KPI card, as shown in the following figure.

    6.png

    2. The following table shows more examples.

    Formula


    Result

    Remarks

    IN(1,1,2,3)

    1

    /

    IN(City,"Beijing","Shanghai","Guangzhou")

    If the value of the City field in a row is Beijing, Shanghai, or Guangzhou,   the returned value in the row is 1. Otherwise, the returned value is 0.

    /

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

    The formula is used to calculate the   total sales amount for cities that match the component parameter values.


     

    附件列表


    主题: System Management
    • 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