본문으로 건너뛰기
Workshop overview
Chapter 2 of 7
15 min

Clean orders before connecting customers

Run the order-cleaning pipeline and inspect the removal and replacement policies for missing identifiers.

Question for this chapter

Which rows can be trusted before orders are connected to customers?

Why this matters now

Customer segments group orders by customer_id. An order without an amount or customer ID cannot represent a valid purchase. When only the product ID is missing, the order can be preserved under an unknown-product identifier.

Try it

Open the orders_cleaning pipeline under analytics and select Run. The null_cleanup code treats null and blank strings as missing across order_id, order_date, customer_id, product_id, and amount. It replaces a missing product ID with PRD-UNKNOWN and removes rows missing any other required value.

Korean Portal showing a successful order-cleaning pipeline from raw orders to cleaned orders
The Portal capture is in Korean. Verify the connected input, cleanup code, output, and successful run.

Success looks like this

The pipeline removes 12 of 100 source rows and replaces the product ID on two more, producing 88 clean orders.

Source problemHandlingResult
Seven orders with a null amountRemove because no valid purchase amount exists7 removed
Five orders with a blank customer_idRemove because no customer-purchase relation can be formed5 removed
Two orders with a blank product_idReplace with PRD-UNKNOWN2 retained

There is no missing order_date in the current seed. No null or blank string remains in the five required columns.

Korean Portal cleaned-orders table showing an order preserved with the PRD-UNKNOWN product identifier
The Portal capture is in Korean. Removed rows are gone, while product-only gaps are retained as PRD-UNKNOWN.

Interpret the result

null and "" have different storage representations, but both are missing values in this pipeline. The result depends on the field's meaning. A row without a customer or order identity is removed; a row missing only its product is grouped under the unknown product.

This contract produces 22 customer-analytics rows and a complete ontology with 22 customers, 88 orders, and 9 products. It also creates 88 customer-order relations and 88 order-product relations.

Next decision

You know the scope available for segmentation. Next, turn recency, frequency, and monetary value into plain customer-state questions.