In this article, we will demonstrate how to import tables from a CSV file, handle null values using transformations, and migrate the cleaned data into the destination database using Bold Data Hub. Follow the step-by-step process below.
Sample Data Source:
Sample CSC Data
Note: On-Demand Refresh will be triggered when the pipeline is saved. If needed, the pipeline can be scheduled in the Schedules tab.
Go to the Transform tab and click Add Table.
Enter the table name to create a transform table for customer satisfaction summary.
Note: The data will initially be transferred to the DuckDB database within the designated {pipeline_name} schema before undergoing transformation for integration into the target databases. As an illustration, in the case of a pipeline named “customer_service_data”, the data will be relocated to the customer_service_data table schema.
Learn more about transformation here
When working with CSC data, missing or null values can impact data accuracy. This section explains how to replace null values with predefined defaults or imputed values to ensure data consistency.
To handle null values effectively, we use the COALESCE
function in DuckDB. This function replaces NULL
values with specified defaults:
0
if missing3
if missingUse the following SQL query to clean your data:
SELECT
Ticket_ID,
Customer_ID,
Customer_Name,
Ticket_Category,
Issue_Description,
Ticket_Status,
Priority,
COALESCE(Resolution_Time, 0) AS Resolution_Time,
Agent_ID,
Agent_Name,
COALESCE(Customer_Satisfaction, 3) AS Customer_Satisfaction,
Ticket_Creation_Date,
Ticket_Resolution_Date,
Ticket_Comments,
Region,
City,
Country
FROM {pipeline_name}.sample_csc_data;