Consolidating a list of phone numbers coming from a CRM solution
The CRM Export dataset corresponds to an Excel file that has been exported from a CRM solution.
It contains a list of people with their phone numbers for both regular and mobile phones. As these phone numbers are French, they are 10 digits long; numbers starting with 01, 02, 03, 04, or 05 correspond to landline numbers and numbers starting with 06 correspond to mobile phone numbers.
In order to have a consolidated list of phone numbers to call, you will create a new column listing all the mobile phone numbers: this column will also be filled with the landline number when there is no mobile phone. Also, if the landline and mobile phone numbers have been mixed up, you will correct them.
Whereas in other tools you would use conditions like "if" to perform these actions, with Talend Data Preparation, you will create filters.
Download the file: CRM_export.csv.
Adding a preparation for the CRM Export dataset
Add a preparation to start preparing and cleansing your data.
You can create a preparation from a dataset already available in Talend Cloud Data Preparation or one of your local files. When you add a preparation with the corresponding button, it will be created in the folder in which you are currently working. Furthermore, your preparation will automatically be saved in the preparations list, and all the changes you make are also saved automatically.
Before you begin
Procedure
Results
Your dataset opens with an empty recipe, and you can start adding preparation steps. All your changes are automatically saved.
Duplicating a column
In order to have a copy of the original data without having to create a new column and manually copy the data, you can simply duplicate a column.
Before working on the data, you will create a new column to receive the consolidated numbers.
Procedure
Results
The mobile column is duplicated and can now receive the consolidated data.
Renaming a column
In order to better identify a column, you can rename it.
You will rename the column previously created and give it a meaningful name.
Procedure
Results
The mobile_copy column is renamed.
Filling empty cells with data from another column
The white part of the quality bar indicates that the column contains empty records.
You will fill the empty cells from the phone number to use, with landline numbers extracted from the phone column.
Procedure
Results
The empty cells in the phone number to use column are filled with data from the phone column.
Identifying if your data matches a pattern
If you want to identify whether there are mobile phone numbers among the landline numbers, you can use the Match pattern function.
Because the French mobile phone numbers start with 06, you are going to search for this pattern in the phone column.
Procedure
Results
The information is stored in a new column and you can now apply a filter to isolate the mobile phone numbers present in the phone column.
Creating a filter
Creating a filter is a quick way to identify or isolate data.
You will isolate the values in the phone column that actually match the pattern defined in the previous step. This will be possible through the use of a filter on the values that were found as true in the phone_matching column.
Procedure
Results
The data is filtered on the value true, and you will now work on this small sample of data.
Replacing values with data from another column
You can take the data from any column, and use it to consolidate another.
Now that only the mobile phone numbers are selected, you will use these values to replace the wrong numbers in the phone number to use column.
Procedure
Results
You have used the filtered data to update the information of the consolidated column.
Deleting the column used for matching
If you want to remove a column you do not need, you can delete a column.
Now that you have used the phone_matching for filtering purposes, you can delete it.
Procedure
Results
The phone_matching column is deleted.
Removing empty records from a column
The grey part of the quality bar indicates that a column contains empty records. You may want to remove the rows containing these empty records.
In the quality bar, data that matches the column type is shown in green, while red shows invalid data that does not match the column type.
Procedure
Results
All the rows containing empty records are removed from the dataset and the quality bar under each column is now fully green.
Exporting the consolidated phone numbers
Once your preparation is complete, you may want to export the data you have cleansed.
You have managed to filter and consolidate a list of phone numbers, and you can now export the result of this preparation.
Procedure
- Click the Export button.
-
Choose the file format you want to use when exporting your
data:
- If you choose Local CSV file, select which field delimiter, text enclosure and escape characters to use and enter a name for the file to export.
- If you choose Local XLSX file, choose a name for the file to export.
- If you choose Amazon S3, enter your credentials and other information to store your file on Amazon S3.
Results
The data you cleansed using your preparation is exported to a local file.