Learning Objectives

By the end of this chapter, you will be able to:

  • Group warehousing into content, shape, and flow and state why OLTP cannot be warehouse.
  • State ETL as extract, transform, and load with one IRD transform each.
  • Group mining into predict, group, link, and exception and match each to a bank task.
  • Compute support and confidence and price action in NPR dated BS 2081.

The counter writes, the warehouse remembers

Siddhartha posts deposits all day in three branches to OLTP. At 02:00 the warehouse loads the day. Managers ask questions the counter cannot run. Mining runs on warehouse, not live ledger.

flowchart LR
  POS[POS and teller OLTP] --> ETL[ETL]
  CBS[Loan and member] --> ETL
  ETL --> DW[(Warehouse: subject, integrated, time variant, non volatile)]
  DW --> MINE[Mining]
  MINE --> BI[Report and decision]

Without nightly copy, large query locks queue. Without mining, warehouse is attic.

Framework 1: Warehouse, grouped

A. Content versus OLTP

OLTP at counter Warehouse
Current, one deposit Rs 40,000 Historical, all members 2078 to 2081
Row level, one member at 11:20 Branch month totals and five year trend
Must stay fast Read only, no lock on counter

B. Shape, four traits

  • Subject oriented: by member, product, branch, not by screen.
  • Integrated: cleaned from POS, loan, CRM so one code for Butwal.
  • Time variant: every row carries time 2081-08-10, so Dashain compares to last Dashain.
  • Non volatile: loaded then not edited, history stable for NRB and IRD. A data mart is slice for one department.

C. Flow, ETL

  • Extract: copy from POS, CBS, CRM, sheets.
  • Transform: fix types, remove duplicates, standardise branch codes, apply 13 percent VAT rule.
  • Load: insert nightly with lineage so auditor traces warehouse total to source rows.
Step Failure Risk
Extract Sunwal file arrives late and skipped Shrawan understated
Transform BT and BTL remain as two codes for Butwal One branch splits into two
Load Duplicate load on 2081-08-11 Double counts deposit

Framework 2: Mining, grouped by question

A. Predict by label, classification and prediction

Classification assigns to known class: will loan default. Prediction estimates number: next month sales.

  • BBA example: default yes or no for member 9841 from past labelled loans.

B. Group without label, clustering

Groups by similarity without class. Finds segments such as three shopper types.

  • BBA example: 4,800 members into four clusters for product design.

Finds co occurrence. Market basket uses support and confidence.

  • Support: both items in all transactions.
  • Confidence: given first, fraction with second.

D. Exception, anomaly

Flags what breaks pattern. Fraud. Withdrawal at 02:14 from closed branch is flagged.

Family Question BBA ask
Predict What class or value Will micro loan be repaid
Group What segments exist Which members behave alike
Link What occurs together Which products sell together
Exception What breaks habit Which transaction is suspicious

Nepal worked example: mart basket on BS 2081-08-14 (NPR)

10,000 bills between 2081-04-01 and 2081-08-14. Bread in 2,000, butter in 1,600, both in 1,200. Bread margin Rs 28, butter Rs 65.

Support bread and butter = 1,200 / 10,000 = 12 percent. Confidence bread implies butter = 1,200 / 2,000 = 60 percent.

Action: move butter to bread shelf and bundle Rs 15 discount. Incremental 420 butters a month because 60 percent of 700 bread buyers who skipped butter now take it. Margin = 420 x (65 - 15) = Rs 21,000 a month. Warehouse taxable for campaign is Rs 4,20,000, so IRD register stays correct while counter stays fast.

Self-check

Try this: basket and VAT (calculable)

10,000 bills, bread 2,000, both 1,200, taxable Rs 4,20,000, input Rs 22,000.

  1. Compute support and confidence.
  2. Compute output VAT at 13 percent on Rs 4,20,000 and net payable.
  3. If late sheet Rs 18,000 omitted on 2081-08-14, compute corrected taxable, corrected output, understated.
  4. Which mining family segments 4,800 members without labels and which flags night withdrawal?
Answer sketch 1. Support 12 percent, confidence 60 percent. 2. Output = 54,600, net = 32,600. 3. Corrected taxable 4,38,000, corrected output 56,940, understated 2,340. Late extract caused gap. 4. Clustering for segmentation, anomaly for night withdrawal.

Summary

  • OLTP records moment, warehouse stores history as subject, integrated, time variant, non volatile. Transform decides audit fitness.
  • Mining groups into predict, group, link, exception. Support 12 percent and confidence 60 percent turn anecdote into number.

Key Takeaways

  • Never mine live counter, copy first.
  • Time is column in warehouse.
  • One bad code duplicates branch in every chart.

Exercises

Short answer

  1. Define warehouse on four traits and a data mart.
  2. Differentiate extract, transform, load with one IRD transform.
  3. Compare classification and clustering on labels.

Long answer

  1. Show ETL before mining with 2081-08-14 bills, support 12 percent confidence 60 percent, margin Rs 21,000, net VAT Rs 32,600.
  2. Group mining into four families with loan, clustering, basket, fraud examples.