反馈已提交

网络繁忙

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

Count the number of occurrences of a character in a field

  • Recent Updates: May 10, 2022
  • 1. Overview

    1.1 Expected view

    Count the number of occurrences of the same character in the field. For example, count the number of occurrences of "/" in the "Account" field. As shown below:

    1.png

    1.2 Implementation ideas

    1) After uploading the data, add the fields to be analyzed in the self-service dataset.

    2) Then add a formula in the newly added column, and use the nested formula of the SUBSTITUTE function and the LEN function to achieve the effect.

    3) After saving the self-service dataset, update the data to view the effect.

    2. Operation steps

    Sample usage data: count the number of same characters.rar

    2.1 Upload data

    Add "EXCEL Dataset" under "Package" in "Data Preparation", upload the original data, as shown below:

    2.png

    After uploading the "User Authority Table", modify the table name to "Count the same characters", modify the field type as needed, and click "OK" to finish uploading, as shown below:

    3.png

    2.2 Create a new self-service dataset

    After uploading the data, continue to add the "self-service dataset" under the "package" to analyze and process the data, as shown below:

    4.png

    2.3 Selection field

    Add a table name to the newly created self-service dataset, and then select all the fields in the uploaded EXCEL table "Count the same characters" and add them to the dataset, as shown in the following figure:

    5.png

    2.4 New column

    1) Add "New Column", as shown in the figure below:

    6.png

    2) Add a new column to count the number of "/" in the "Account" field. Enter the formula:

     LEN(account)-LEN(SUBSTITUTE(account,"/","")), where the "account" field needs to be added in the text field on the left to be effective. Click "OK" when finished, as shown below:

    The formula description is shown in the following table:

    FormulaDescriptionFunction
    LEN(Account)Count the string length of the "Account" field.

    LEN(args): Returns the number of characters in the text string or the length of the array.

    SUBSTITUTE(Account,"/","")Replace the "/" in the "Account" field with a null value to achieve the effect of removing the "/".SUBSTITUTE(text,old_text,new_text,instance_num): Replace old_text in the text string with new_text.
    LEN(SUBSTITUTE(Account,"/",""))The string length of the "account" field with "/" removed.-
    LEN(Account)-LEN(SUBSTITUTE(Account,"/",""))The length of the "account" field is subtracted from the length of the "account" field after removing the "/" to get the number of "/".-

    7.png

    After adding the "Count the number of '/' " column, click "Save" to complete the data processing, as shown below:

    8.png

    Click "Update Data" to update the created self-service dataset, as shown in the figure below:

    9.png

    3. View the effect

    For details of the effect, please refer to section 1.1 of this article.

    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后关闭