Skip to content

Logical delete

If you want to delete records, you can select the default option logical delete to ensure that the records are no longer visible in the GDAL current and oasi_bk views. This way the data remains traceable and auditable.

How it works

  • In the Logical Validation Layer (LVL)
    • a new row with value R for the column acm_record_ind is added.
  • In the Central Facts Layer (CFL):
    • the deleted rows from a Context (normal, bi-temporal) are end-dated and a new row with value R for the column acm_record_ind is added
    • the rows from Dependent (Links) and Independent (Anchors) entities are logically deleted by changing the acm_exists_ind from 1 to 0

How to logically delete data

  1. Create a delivery
  2. Select the delete type logical
    Select logical delete
  3. Run the delivery

Example

In the following example, the dataset is a batch delivery where the entities are delivered in full.

There are four customers in the first dataset. In the next dataset, customer nbr 4 is not delivered anymore. What will happen if you remove this record with the logical delete option from the i-refactory engine?

LVL

Before the logical delete you see 4 customers.

nbr name address nation_nbr phone_nbr account_balance market_segment comment acm_source_transaction_ind acm_start_dt acm_end_dt acm_audit_id acm_record_ind acm_rownumber acm_entity_id
1 Joep Lutterveld Gerritweg 22 1 024-2542634 914.16 FURNITURE NULL NULL 2023-02-16 16:01:41.7140000 NULL 989 N 1 285
2 Frederique Bakker Markbaan 71 1 0283 621751 68.50 HOUSEHOLD NULL NULL 2023-02-16 16:01:41.7140000 NULL 989 N 2 285
3 Sterre Hexspoor Vigostraat 31 1 050 4047917 6755.50 HOUSEHOLD NULL NULL 2023-02-16 16:01:41.7140000 NULL 989 N 3 285
4 Benjamin Boehm Grolmanstraße 48 2 0421 434651 15.00 FURNITURE NULL NULL 2023-03-02 11:15:50.3730000 NULL 1514 N 6 285

After the logical delete of customer nbr 4, a new record for customer nbr 4 is added with a new acm_start_dt and acm_record_ind = R.

nbr name address nation_nbr phone_nbr account_balance market_segment comment acm_source_transaction_ind acm_start_dt acm_end_dt acm_audit_id acm_record_ind acm_rownumber acm_entity_id
1 Joep Lutterveld Gerritweg 22 1 024-2542634 914.16 FURNITURE NULL NULL 2023-02-16 16:01:41.7140000 NULL 989 N 1 285
2 Frederique Bakker Markbaan 71 1 0283 621751 68.50 HOUSEHOLD NULL NULL 2023-02-16 16:01:41.7140000 NULL 989 N 2 285
3 Sterre Hexspoor Vigostraat 31 1 050 4047917 6755.50 HOUSEHOLD NULL NULL 2023-02-16 16:01:41.7140000 NULL 989 N 3 285
4 Benjamin Boehm Grolmanstraße 48 2 0421 434651 15.00 FURNITURE NULL NULL 2023-03-02 11:15:50.3730000 NULL 1514 N 6 285
4 Benjamin Boehm Grolmanstraße 48 2 0421 434651 15.00 FURNITURE NULL NULL 2023-03-02 11:18:21.5760000 NULL 1619 R 7 285

CPL

Anchor before the logical delete

id nbr acm_audit_id acm_entity_id acm_exists_ind acm_latest_start_dt acm_last_created_dt acm_physically_removed_ind acm_physically_removed_by
1 1 945 233 1 2023-02-16 16:01:41.7140000 2023-02-16 16:01:41.7140000 0 NULL
2 2 945 233 1 2023-02-16 16:01:41.7140000 2023-02-16 16:01:41.7140000 0 NULL
3 3 945 233 1 2023-02-16 16:01:41.7140000 2023-02-16 16:01:41.7140000 0 NULL
4 4 1155 233 1 2023-03-02 10:55:26.0180000 2023-03-02 10:55:26.0180000 0 NULL

In the Anchor after the logical delete. The record is logically deleted by changing the acm_exists_ind from 1 to 0

id nbr acm_audit_id acm_entity_id acm_exists_ind acm_latest_start_dt acm_last_created_dt acm_physically_removed_ind acm_physically_removed_by
1 1 945 233 1 2023-02-16 16:01:41.7140000 2023-02-16 16:01:41.7140000 0 NULL
2 2 945 233 1 2023-02-16 16:01:41.7140000 2023-02-16 16:01:41.7140000 0 NULL
3 3 945 233 1 2023-02-16 16:01:41.7140000 2023-02-16 16:01:41.7140000 0 NULL
4 4 1260 233 0 2023-03-02 11:00:05.7370000 2023-03-02 10:55:26.0180000 0 NULL

Context before the logical delete

id acm_start_dt acm_end_dt name address phone_nbr account_balance market_segment comment h_nation_id acm_audit_id acm_entity_id acm_record_ind acm_missing_ind acm_source_transaction_ind acm_source_key_transaction_ind acm_modifier_id
1 2023-02-16 16:01:41.7140000 8900-12-31 00:00:00.0000000 Joep Lutterveld Gerritweg 22 024-2542634 914.16 FURNITURE NULL 1 946 235 N NULL NULL NULL TPCH
2 2023-02-16 16:01:41.7140000 8900-12-31 00:00:00.0000000 Frederique Bakker Markbaan 71 0283 621751 68.50 HOUSEHOLD NULL 1 946 235 N NULL NULL NULL TPCH
3 2023-02-16 16:01:41.7140000 8900-12-31 00:00:00.0000000 Sterre Hexspoor Vigostraat 31 050 4047917 6755.50 HOUSEHOLD NULL 1 946 235 N NULL NULL NULL TPCH
4 2023-03-02 10:55:26.0180000 8900-12-31 00:00:00.0000000 Benjamin Boehm Grolmanstraße 48 0421 434651 15.00 FURNITURE NULL 2 1156 235 N NULL NULL NULL TPCH

Context after the logical delete. The old record is end-dated (acm_end_dt is not 8900-12-31 anymore) and a new row with value R for the column acm_record_ind is added.

id acm_start_dt acm_end_dt name address phone_nbr account_balance market_segment comment h_nation_id acm_audit_id acm_entity_id acm_record_ind acm_missing_ind acm_source_transaction_ind acm_source_key_transaction_ind acm_modifier_id
1 2023-02-16 16:01:41.7140000 8900-12-31 00:00:00.0000000 Joep Lutterveld Gerritweg 22 024-2542634 914.16 FURNITURE NULL 1 946 235 N NULL NULL NULL TPCH
2 2023-02-16 16:01:41.7140000 8900-12-31 00:00:00.0000000 Frederique Bakker Markbaan 71 0283 621751 68.50 HOUSEHOLD NULL 1 946 235 N NULL NULL NULL TPCH
3 2023-02-16 16:01:41.7140000 8900-12-31 00:00:00.0000000 Sterre Hexspoor Vigostraat 31 050 4047917 6755.50 HOUSEHOLD NULL 1 946 235 N NULL NULL NULL TPCH
4 2023-03-02 10:55:26.0180000 2023-03-02 11:00:05.7370000 Benjamin Boehm Grolmanstraße 48 0421 434651 15.00 FURNITURE NULL 2 1156 235 N NULL NULL NULL TPCH
4 2023-03-02 11:00:05.7370000 8900-12-31 00:00:00.0000000 Benjamin Boehm Grolmanstraße 48 0421 434651 15.00 FURNITURE NULL 2 1261 235 R NULL NULL NULL TPCH