You may need to extract characters at specified positions following a particular character that appears multiple times within a field value.
For instance, you may need to extract the substrings after the last underscores (_) within variable-length strings, as shown in the following figure.
Alternatively, you may need to extract the values of the field B in the A|B|C field. For example, you may need to extract all educational background information, as shown in the following figure.
You can extract the character(s) either through the one-click splitting by separator or through a combination of functions such as INDEXOF, FIND, MID, SUBSTITUTE, and RIGHT.
Example data: Extracting Content After Repeated Specified Characters.xlsx
You can upload the example data to FineBI, as shown in the following figure.
For details about how to create an analysis subject, see Creating an Analysis Subject.
Click Formula Column, set Name of the Added Formula Column to Characters After the Last Underscore (_), enter the formula INDEXOF(SPLIT(Field,"_"),LEN(SPLIT(Field,"_"))-1), and click OK, as shown in the following figure. INDEXOF(SPLIT(a_b_c,"_"),LEN(SPLIT(a_b_c,"_"))-1)
The following table describes the formula in detail.
Formula
Result
SPLIT(Field,"_")
The formula is used to split field values into groups according to the underscore(_).
Before splitting: a_b_c
After splitting: a,b,c
LEN(SPLIT(Field,"_"))-1
The formula is used to calculate the number of characters in the array after the field is split by underscores (_) and then subtract 1.
For example, LEN(SPLIT(a_b_c,"_"))-1 returns 2.
INDEXOF(SPLIT(Field,"_"),LEN(SPLIT(Field,"_"))-1)
The formula returns the last character of the array after the array is split by the SPLIT function.
For example,INDEXOF(SPLIT(a_b_c,"_"),LEN(SPLIT(a_b_c,"_"))-1) returns c.
Method Three
1. Click Formula Column, set Name of the Added Formula Column to Counting the Characters After the Array is Split by the Underscores, enter the formulaLEN(SPLIT(Field,"_")), and click OK. For example, LEN(SPLIT(a_b_c,"_")) returns 3, as shown in the following figure.
2. Click Formula Column, set Name of the Added Formula Column to Replacing the Last Underscore with a Hyphen, enter the formula SUBSTITUTE(Field,"_","-",LEN(SPLIT(Field,"_"))-1), and click OK, as shown in the following figure.
3. Click Formula Column, set Name of the Added Formula Column to Position of the Hyphen Starting from the First Character, enter the formula FIND("-",SUBSTITUTE(Field,"_","-",LEN(SPLIT(Field,"_"))-1),1), and click OK, as shown in the following figure.
4. Click Formula Column, set Name of the Added Formula Column to Counting the Characters After the Last Hyphen, enter the formula LEN(Field)-FIND("-",SUBSTITUTE(Field,"_","-",LEN(SPLIT(Field,"_"))-1),1), and click OK, as shown in the following figure.
5. Click Formula Column, set Name of the Added Formula Column to Extracting Specified Characters, enter the formula RIGHT(Field,LEN(Field)-FIND("-",SUBSTITUTE(Field,"_","-",LEN(SPLIT(Field,"_"))-1),1)), and click OK, as shown in the following figure.
For details, see the "Expected Effect" section.
Example data: Recruitment Information.xlsx
Upload the example data to FineBI, as shown in the following figure.
Method One
Choose More > Split Field on the data editing page to enter the function page, as shown in the following figure.
Split the field by the separator (|) and enter 2 in Split Result, as shown in the following figure.
Method Two
Click Formula Column, set Name of the Added Formula Column to Extracting the Middle Characters, enter the formula INDEXOF(SPLIT(RegionEducationCount,"|"),1), and click OK, as shown in the following figure.
SPLIT(RegionEducationCount,"|")
The formula is used to split the values of RegionEducationCount into three separate arrays by the separator (|).
For example, SPLIT(Shenzhen|Bachelor's degree|5 openings,"|") returns Shenzhen,Bachelor's degree,5 openings.
INDEXOF(SPLIT(RegionEducationCount,"|"),1))
The formula is used to return the second array after splitting.
For example, INDEXOF(Shenzhen,Bachelor's degree,5 openings,1)) returns Bachelor's degree.
For details about extracting specific field content, see Data Merging and Splitting.
滑鼠選中內容,快速回饋問題
滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。
不再提示
10s後關閉
Submitted successfully
Network busy