FIND - Returning the Position of a Specified Character in Text

  • Last update:  2023-08-28
  • Overview

    Grammar

    FIND(find_text,within_text,start_num)

    Returns the first specified substring (find_text) in the character string (within_text) starting from the index position (start_num).

    iconNote:
    For real-time data, a defaulted value needs to be added if there are fewer than 3 parameters in the function.

    Parameter 1

    find_text

    A substring to be found

    Parameter 2

    within_text

    A string containing the substring to be found (find_text)

    The search starts from the first character of within_text. If start_num is not specified, the default value 1 is used.

    Parameter 3

    start_num

    Index position where the search starts.

    iconNote:
    Negative values are not supported in real-time data.


    iconNote:
    The function returns 0 if no find_text is found.

    Notes

    • The first and second parameters of the FIND function are of any type and the third is a number that can be defaulted.

    Example

    Take fuzzy search as an example, which is similar to the LIKE operator in SQL.

    Add a formula column to label values containing Women, Men, and other characters in Category description in the built-in Store sales statistics dataset as "Women Products", Men Products", and "Others", respectively.

    Enter the formula IF(FIND("Women",Category description)!=0,"Women Products",IF(FIND("Men",Category description)!=0,"Men Products","Others")), as shown in the following figure.

    FIND.png


    iconNote:
    Only values of Category description fields displayed with a blue background are valid.

    The following table explains each part of the formula above.

    Formula
    Explanation

    FIND("Women",Category description) != 0

    Returns TRUE if the Category description field contains "Women", otherwise, returns FALSE.

    IF(FIND("Women",Category description)!=0,"Women Products",IF(FIND("Men",Category description)!=0,"Men Products","Others"))

    Labels Category description fields containing Women as "Women Products", Men as "Men Products", or otherwise, as "Others".

    The following table describes more examples.

    Formula
    ResultNotes
    FIND("I","Information")

    Single Login Setting

    Returns the index position of "I" in "Information", that is, 1.

    FIND("o","Information",2)

    Login Authentication Setting


    FIND("o","Information",-1)

    Null

    Negative values of start_num are not supported in real-time data.

    FIND("t","Information",1)

    8



    Attachment List


    Theme: Advanced Data Analyis
    前の記事
    次の記事
    • いいね
    • 良くない
    • 閲覧しただけ

    フィードバック

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

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

    不再提示

    9s后关闭

    反馈已提交

    网络繁忙