反馈已提交

网络繁忙

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

Intercept the specified characters in a field

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

    1.1 Problem description

    The user needs to get the content of a segment in a field.

    For example, to intercept the last few fixed digits of a string, the effect is shown in the following figure.

    39.png

    1.2 Implementation idea

    Use the text function to intercept characters.

    2. Intercept a fixed number of characters

    2.1 Operation steps

    Take the RIGHT function as an example, intercept the last eight digits of the "phone" number to build a new field "left function".

    1)Use the demo data "Supplier Information table" to create a self-service dataset, and select the fields "Supplier ID" and "Phone".

    2)Select the new column, using the RIGHT function, the new column "left" function intercepts the last eight digits of the phone number, as shown in the following figure.

    40.png

    Function description.

    FunctionDescription
    LEFTReturns the character on the left side of the string
    RIGHT
    Returns the character on the right side of the string
    MID
    Returns a certain number of characters in the text string starting from the specified position

    2.2 Effect view

    The effect of intercepting the last few fixed digits of a string is shown in the following figure.

    41.png

    3. Intercept all characters before a character

    Use function: LEFT function and FIND function (FIND function can find the position of a character in the string)

    Example data: interceptedfields.xlsx

    3.1 Operation steps

    For example, from the "user account and password" field, extract the user account to build a new field "left Interceptd not fixed".

    1)Make a self-service dataset using the downloaded interceptedfields.xlsx and select all fields.

    2)Add a new column and enter the formula LEFT(user account and password,FIND(":",user account and password)), as follows.

    Note: If you do not need the ":" in the field, you can change the formula to LEFT(user account and password, FIND(":",user account and password)-1).

    42.png

    Formula description.

    FormulaDescription
     LEFT(user account and password,FIND(":",user account and password))Extracts the characters in the field from the left to the right, the number of characters extracted is the number of ":" in the field found using the FIND() function.

    3.2 Effect view

    Get ":" and all the characters before it from the string, as shown below.

    43.png

    4. Intercept all characters after a certain character

    Functions used: RIGHT、FIND 、LEN。

    Example data: Section 3 data

    4.1 Operation steps

    Intercept the password in the "user account and password" field to form a new "Password" column.

    Add a new column, enter the formula: RIGHT(user account and password,LEN(user account and password)-FIND(":",user account and password))as shown below.

    44.png

    Formula description.

    Formula

    Description

    LEN(user account and password)-FIND(":",user account and password)The number of characters extracted is the length of the field using the LEN() function - the number of characters in the field where the ":" is found using the FIND() function.
    RIGHT(user account and password),LEN(user account and password)-FIND(":",user account and password))Extracts the characters in the field from the right to the left.

    4.2 Effect view

    Intercept all the characters after ":" as shown below.

    45.png

    5. Intercept characters of variable length starting from a certain character

    Sample Data: Intercept Fields-Variable-Length.xlsx

    Get the password in the middle of "user account and password" to form a new column "mid password".

    5.1 Operation steps

    1)Make a self-service dataset using the "Intercepted Fields - Variable-Length" table.

    2)Add a new column and enter the formula:MID(user account and password,FIND(":",user account and password)+1,FIND(",",user account and password)-FIND(":",user account and password)-1), as shown below.

    46.png

    Formula description.

    FormulaDescription
    FIND(":",use account and password)+1Start position of the intercept field = find the location of ":" using the FIND() function + the length of ":" 1.
    FIND(",",use account and password)-FIND(":",use account and password)-1The length of the intercepted string = "," location serial number - ":" location serial number - 1.
    MID(use account and password,FIND(":",use account and password)+1,FIND(",",use account and password)-FIND(":",use account and password)-1)After the ":" in the "use account and password" string, get the middle part of the characters representing the password.

    5.2 Effect view

    Get all the characters after ":" and before ",". The following figure shows.

    47.png

    6. Remove a fixed number of characters before and after a field

    Example data: text-intercept.xlsx

    6.1 Operation steps

    Upload data and use the uploaded Excel data set to create a self-service data set, select all fields, add "New Column", enter the formula: LEFT(Province,LEN(Province)-6), click "OK", as shown in the following figure.

    48.png

    Formula description.

    FormulaDescription
    LEN(Province)-3Get the length of the Province field and subtract 3
    LEFT(Province,LEN(Province)-3)Intercept the first LEN(Province)-3 bits of the Province field from the left

    6.2 Effect view

    Remove the "Branch" suffix at the end of the field and keep the company name, as shown below.

    49.png

    Note: If you need to remove the specified number of strings before the field can be used RIGHT (field, LEN (field) - the number of strings).

    Attachment List


    Theme: 部署集成
    Already the First
    Already the Last

    售前咨询电话

    400-811-8890转1

    在线技术支持

    在线QQ:800049425

    热线电话:400-811-8890转2

    总裁办24H投诉

    热线电话:173-1278-1526

    文 档反 馈

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

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

    不再提示

    10s后关闭