Data Merging/Truncation/Splitting

  • Last update:  2022-04-26
  • 1. Overview

    When performing data merging, the splicing and merging of fields and the split of columns are indispensable.

    Sometimes it is necessary to merge some of the required fields in the dataset.

    In the dataset, the field structure is a string connected by certain delimiters. When using it, it needs to be split to extract only the string at a fixed position, or the whole is split into multiple columns.

    2. Field Combination

    2.1 Fields are merged directly

    In versions after 5.1.12, the merging of text fields is achieved through "+", of course, the function CONCATENATE can also be used.

    Note: similar to & in Excel.

    For example, the last name and first name need to be merged into a field "name", as shown in the figure below:

    3.png

    Enter the formula: First name+Last name, then the fields are merged, as shown in the following figure:

    You can also use the CONCATENATE function, as shown in the figure below:

    4.png

    2.2 Merge fields and separate them with one character

    If you want to add a character to separate each field, you can also use "+".

    For example, to use the data in "package>FRDemo_map_WorldMa", you need to merge the "Continent", "Country", and "Capital" data and separate them with "-".

    Create a field, name the field and enter the formula: Continent + "-" + Country + "-" + Capital, click "OK", as shown below:5.png

    The resulting "Region" field is shown in the figure below:

    6.png

    3. Split fields

    According to the characters in the field, split the field into multiple columns.

    In FineBI, you can use functions to create "new column" or add "calculation indicator" to the dashboard to achieve field split.

    3.1 Example

    For example, you need to intercept phone numbers. For example, create a new field in the self-service dataset for sorting, and intercept the last eight digits of the "Home telephone" to construct a new field "phone number".

    1) Use Demo data "FRDemo_Employe_copy" to make a self-service dataset, select the fields "Full Name" and "Home telephone", as shown in the figure below:

    7.png

    2) Select the new column, use the RIGHT function, add the new column "phone number" to intercept the last eight digits of the phone number, and enter the formula: RIGHT(Home telephone, 8), as shown in the figure below:

    3.2 More formulas

    See the table below for more breakdown formulas.

    DemandFormula
    Characters only appear once in the fieldIntercept characters with a fixed number of digits

    RIGHT、LEFT、MID

    For example:RIGHT(Home telephone,8)

    11.png

    Get the contents of the field "before the character"

    LEFT(field name,FIND("character",field name)-1)

    For example:LEFT(Account and password,FIND(":",Account and password)-1)

    13.png

    Get the contents of the field "after the character"

    RIGHT(field name,LEN(field name)-FIND("character",field name))

    For example:RIGHT(Account and password,LEN(Account and password)-FIND(":",Account and password))

    14.png

    Remove the fixed number of characters after the field

    LEFT(field name,LEN(field name)-length of the characters that need to be removed)

    For example:

    12.png

    Remove the fixed number of characters before the fieldRIGHT(field name,LEN(field name)-length of the characters that need to be removed)
    Characters appear multiple times in the fieldTake the content after the last character in the field

    INDEXOF(SPLIT(field name,"_"),LEN(SPLIT(field name,"_"))-1)

    For example:INDEXOF(SPLIT(field name,"_"),LEN(SPLIT(field name,"_"))-1)

    15.png

    Take the content after the penultimate character in the field

    INDEXOF(SPLIT(field name,"_"),LEN(SPLIT(field name,"_"))-2)

    For example:INDEXOF(SPLIT(field name,"_"),LEN(SPLIT(field name,"_"))-2)

    16.png

    By analogy, you can achieve field separation...

    After sorting, you may need to merge multiple split fields into one column. At this time, you can use the upper and lower merge function. For details, see: Inverse Perspective.

    附件列表


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