Counting the Number of Identical Characters in a Field

  • Last update:December 19, 2024
  • Overview

    • You can click Save Dashboard As to view the internal steps or operate the steps by yourself.

    Expected Effect

    The number of identical characters in the field is returned. For example, you can count the number of / in the Account field, as shown in the following figure. 

    1.png

    Implementation Method

    1. Create an analysis subject and upload data.

    2. Click Formula Column, and nest the SUBSTITUTE function or the REPLACE function inside the LEN function to achieve the effect. This document uses the nesting of the SUBSTITUTE function and the LEN function as an example.

    3. Save and update the data to view the effect.

    Procedure

    Sample data: Counting the Number of Identical Characters.zip

    Data Upload

    1. Click New Subject in My Analysis to create an analysis subject and upload the downloaded sample data, as shown in the following figure.

    2.png


    2. After uploading User Permission Table, select Sheet2, and modify the field type as needed. In this example, modify the field type of Password to Text. Click OK to complete the upload. 

    5.png

    Field Selection

    Remain the default selection of all fields and rename the new analysis subject Counting the Number of Identical Characters, as shown in the following figure.

    6.png

    Column Adding

    1. Click Formula Column, as shown in the following figure.

    7.png

    2. Since the added column is used to count the number of the / (slash) in the Amount field, enter LEN(Account)-LEN(SUBSTITUTE(Account,"/","")). Account must be selected from the left text fields. Otherwise, the function will be illegal. Finally, click OK, as shown in the following figure. 

    8.png

    The following table explains the formula in detail.

    Formula
    DescriptionFunction

    LEN(Account)

    Returns the number of characters in the Amount field string.

    LEN(Args): returns the number of characters in a text string or the length of an array.

    SUBSTITUTE(Account,"/","")

    Replaces all slashes  (/) in the Account field with null values.

    SUBSTITUTE(Text,Old_text,New_text,Instance_num)replaces Old_text with New_text.

    LEN(SUBSTITUTE(Amount,"/",""))

    Returns the number of characters in the Account field with all slashes removed.

    LEN(Amount)-LEN(SUBSTITUTE(Amount,"/",""))

    Subtracts the number of characters in the Account field with all slashes removed from the number of characters in the original Account field, and returns the difference (namely the number of /).

    3. After adding the column Counting the Number of Slashes, click Save and Update to save and update the created analysis subject, as shown in the following figure.

    9.png

    Effect Display

    For details, see section "Expected Effect."

    附件列表


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