Data Merging and Splitting

  • Last update:August 22, 2023
  • Overview

    Merging and splitting of fields are essential to data integration.

    In datasets, some fields need to be merged.

    Some fields merged by separators need to be split into multiple columns or be split to extract characters at a specified position.

    Field Merging

    Merging Directly

    Text fields can be merged through + or the CONCATENATE function.

    iconNote:
    The function of + in FineBI is similar to the & in Excel.

    Take merging of City and Province by + as an example.

    1预览.png

    Enter the formula City+Province, to merge these two columns, as shown in the following figure.

    2公式列.png

    You can also use the CONCATENATE function, as shown in the following figure.

    3函数.png

    Merging by Separators

    + can also be used to merge fields by separators.

    For example, to merge City and Province in the Demo data BIDemo_Urban Area Dimension, and connect two fields with -, add a formula column, enter the formula City+"-"+Province, and click OK, as shown in the following figure.

    4-连接.png

    Wait until the result is displayed, as shown in the following figure.

    5效果.png

    Field-based Data Splitting

    More columns can be added based on characters in a field.

    In FineBI, you can use the function Formula Column or Calculation Indicator in the dashboard to add more columns based on a field

    Example

    For example, you can follow the steps below to add a formula column that contains the last 12 digits of the Client ID field in the self-service dataset.

    1. Create a self-service dataset with the Demo data Contract Fact. Click Field Settings, and select Contract ID and Client ID.

    6字段设置.png

    2. Click Formula Column and enter the formula RIGHT(Client ID,12). The added column contains the last 12 digits of Client ID, as shown in the following figure.

    7截取.png

    8截取效果.png

    More Formulas

    The following table introduces more formulas for field splitting.

    Requirement
    Formula
    Fields with only one separator

    Extract a specified number of characters.

    RIGHT, LEFT, MID

    Example: LEFT(Express line,7)

    9固定位数.png

    Extract the first several characters.

    LEFT(Field Name,FIND("separator",Field Name)-1)

    Example: LEFT(Express line,FIND("-",Express line)-1)

    10LEFT (2).png

    Extract the last several characters.

    RIGHT(Field Name,LEN(Field Name)-FIND("separator",Field Name))

    Example: RIGHT(Express line,LEN(Express line)-FIND("-",Express line))

    11RIGHT.png

    Remove a specified number of the last several characters.

    LEFT(Field Name,LEN(Field Name)-number of characters to be removed)

    Example: LEFT(Payment Type,LEN(Payment Type)-7)

    12去掉后缀.png

    Remove a specified number of the first several characters.

    RIGHT(Field Name,LEN(Field Name)-number of characters to be removed)

    Fields with several separators

    Extract characters after the last separator.

    INDEXOF(SPLIT(Field Name,"separator"),LEN(SPLIT(Field Name,"separator"))-1)

    Example: INDEXOF(SPLIT(route,"-"),LEN(SPLIT(route,"-"))-1)

    13倒数第一.png

    Extract characters after the penultimate separator.

    INDEXOF(SPLIT(Field Name,"separator"),LEN(SPLIT(Field Name,"separator"))-2)

    Example: INDEXOF(SPLIT(route,"-"),LEN(SPLIT(route,"-"))-2)

    14倒数第二.png

    By following the previous steps, you can add more columns based on fields in various ways.



    附件列表


    主题: Advanced Data Analysis
    Previous
    Next
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    9s后關閉

    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