Data CDR
Document Version: 1.0
Last Updated: 25-01-2026
Maintained By: Niha
Table of Contents
Overview
Summary
This document provides detailed documentation for the Data CDR table, which records all mobile data sessions with corresponding usage, charging, and network information for billing purposes.
The Data CDR table captures detailed records of data usage. Usage is recorded as being either from Free Units (related to offerings) or as Charged PAYG usage. Free Units can either be joined with the PE_FREE_UNIT table (for the specific offering it came from) or the PE_FREE_UNIT_TYPE table (for bucket types).
Tables discussed
| Table Name | Description | Important Columns |
|---|---|---|
Data CDR | Main CDR table for Data | CDR_ID, SUBSCRIBER_KEY |
PE_FREE_UNIT | Free unit instances linked to offerings | FREE_UNIT_ID, OFFERING_ID |
PE_FREE_UNIT_TYPE | Free unit bucket types | FU_TYPE_ID, FU_TYPE_NAME |
Offerings | Offering metadata | OFFERING_ID |
Table Schema
Field Reference
1. CDR Identifiers
Fields that uniquely identify CDR records and sessions.
CDR_ID
- Description: Unique identifier for each CDR record, auto-generated by the CBS system
- Business Logic: Combined with CDR_SUB_ID to form the complete primary key
- Example:
123456789012345
CDR_SUB_ID
- Description: Sub-record identifier for split CDRs
- Business Logic: Value starts at 0 for first record, increments for each split
- Example:
0,1,2 - Notes: Data CDRs are commonly split for long sessions
SESSION_ID
- Description: Session identifier linking related CDRs
- Business Logic:
- For Hybrid subscribers: Multiple CDRs share same SESSION_ID
- For split sessions: All parts share same SESSION_ID (very common for data)
- Can be used to aggregate CDRs representing a single data session
- Critical for Data: Data sessions are frequently split, SESSION_ID is essential for aggregation
StartTime
- Description: Data connection start time in local timezone
- Business Logic: Used for billing cycle assignment and time-based analysis
- Example:
2026-01-25 14:30:45 - Timezone: Local time (Maldives: UTC+5)
StopTime
- Description: Data connection stop time in local timezone
- Business Logic: May be NULL for ongoing sessions or sessions terminated abnormally
- Example:
2026-01-25 14:35:22 - Duration Calculation:
StopTime - StartTime= session duration
2. Subscriber Information
Fields identifying the subscriber and account hierarchy.
PRI_IDENTITY
- Description: Primary identity - MSISDN (mobile number)
- Format: International format without + symbol
- Example:
9607123456 - Business Logic: The charged party's phone number
SUBSCRIBER_KEY
- Description: Service ID from CRM system
- Business Logic: Unique identifier for the service instance, links to CRM
- Example:
5001234567 - Joins: Link to subscriber dimension tables
ACCOUNT_KEY
- Description: Payment account ID from CRM
- Business Logic: Multiple subscribers can share same account (family plans)
- Example:
3001234567 - Joins: Link to account dimension tables
UserState
- Description: Numeric string of seven digits, in the format CCMMMMM. The first and second digits C indicate the life cycle state of a subscriber. The first digit C indicates the state of a prepaid subscriber, and the second digit C indicates the state of a postpaid subscriber. The options are as follows:
0- Idle1- Active2- Suspended3- Disable4- Pool5- Pool without activation
GroupCallType
- Description: Corporate User Group (CUG) classification
| Value | Description |
|---|---|
| 0 | Non-corporate usage |
| 1 | Corporate intra-network |
| 2 | Corporate inter-network |
| 4 | Corporate off-net number group |
| 12 | Corporate off-net number group |
OBJ_TYPE
- Description: Object type being charged
- Valid Values:
S- Subscriber (individual service)A- Account (account-level charging)G- Subscriber Group (for Connect offering)
- Business Logic: Determines what entity the charge applies to
- Example:
S - Notes: For Connect offering, may be Account or Subscriber Group
OBJ_ID
- Description: Object identifier corresponding to OBJ_TYPE
- Business Logic:
- When OBJ_TYPE = 'S': OBJ_ID = SUBSCRIBER_KEY
- When OBJ_TYPE = 'A': OBJ_ID = ACCOUNT_KEY
- When OBJ_TYPE = 'G': OBJ_ID = Subscriber Group ID
- Example:
5001234567
ChargingPartyNumber
- Description: Charging party number
- Format Options:
- Fixed-line: Area code + PSTN number
- Mobile: MSISDN in URI format
- Example:
9607123456(mobile),3301234(fixed-line area code + number)
3. Usage Metrics
Fields capturing data usage volumes and measurements.
USAGE_MEASURE_ID
- Description: Unit of measurement for usage
- Valid Values:
| FU_MEASURE_ID |
|---|
| 1003 |
| 1004 |
| 1006 |
| 1101 |
| 1106 |
| 1107 |
| 1108 |
| 1109 |
| 1121 |
| 1122 |
TotalFlux
- Description: Total data traffic in bytes
- Unit: Bytes
- Business Logic: Sum of UpFlux + DownFlux
- Example:
52428800(50 MB) - Formula:
TotalFlux = UpFlux + DownFlux
UpFlux
- Description: Upstream (upload) traffic in bytes
- Unit: Bytes
- Business Logic: Data sent from device to network
- Example:
5242880(5 MB)
DownFlux
- Description: Downstream (download) traffic in bytes
- Unit: Bytes
- Business Logic: Data received from network to device
- Example:
47185920(45 MB)
FREE_UNIT_AMOUNT_OF_FLUX
- Description: Total free unit usage consumed (aggregated across all free unit instances)
- Unit: Bytes
- Business Logic: Sum of CHG_AMOUNT across all 10 free unit ID groups
- Example:
31457280(30 MB)
RatingGroup
- Description: Rating group reported by MSCC (Mobile Service Control Center)
- Business Logic: Identifies traffic type and zero-rated services
- Valid Values:
| RatingGroup | Traffic Type | Rule Name Examples |
|---|---|---|
| 101 | General Internet | InternetUsage, PAYG, Addon, Booster, Connect |
| 104 | LocalUsage / Uniflex | LocalUsage, Uniflex |
| 105 | SocialUsage / SeraSocial | SocialUsage, SeraSocial |
| 106 | Stream | Stream |
| 107 | Education (SonyLiv) | Edu |
| 112 | Social Media | SocialMedia |
| 113 | Chat | Chat |
| 114 | Games | Games |
| 116 | DhiraaguTV | DhiraaguTV |
| 118 | Imo | Imo |
| 119 | Music | Music |
| 121 | Entertainment | Entertainment |
| 122 | WeekendSocial | WeekendSocial |
| 123 | Pro | Pro |
4. Charging Information
Fields related to billing and charges applied.
DEBIT_AMOUNT
- Description: Total amount deducted from all account sources
- Currency: MVR (Maldivian Rufiyaa)
- Business Logic:
- Formula:
DEBIT_AMOUNT = DEBIT_FROM_PREPAID + DEBIT_FROM_POSTPAID - For Hybrid subscribers with 2 CDRs: Sum both CDRs for total charge
- Represents PAYG (Pay As You Go) charges only
- Formula:
- Example:
25.00 - Revenue Calculation: This is the charged revenue field
DEBIT_FROM_PREPAID
- Description: Amount deducted from prepaid sources (main funds + bonuses)
- Currency: MVR
- Business Logic: Includes all prepaid account deductions
- Example:
25.00
DEBIT_FROM_POSTPAID
- Description: Amount deducted from postpaid sources (credits, bonuses, deposits, prepayments)
- Currency: MVR
- Business Logic: Includes all postpaid account deductions
- Example:
0.00 - Hybrid Note: For Hybrid PayType, check both prepaid and postpaid amounts
5. Plan and Offerings
Fields describing the subscriber's service plan and add-ons.
MainOfferingID
- Description: Primary offering ID (base plan)
- Business Logic: The subscriber's main plan at time of CDR
- Joins: Link to offering dimension for plan details
LastEffectOffering
- Description: Last effective offering ID applied
PayType
- Description: Payment type of subscriber
- Valid Values:
| Value | Type | Charging Behavior |
|---|---|---|
| 0 | Prepaid | Deducted from prepaid balance |
| 1 | Postpaid | Added to postpaid invoice |
| 2 | Hybrid | Generates 2 CDRs (prepaid + postpaid portions) |
- Business Logic:
- Hybrid subscribers generate separate CDRs for prepaid and postpaid portions
- Link Hybrid CDRs using SESSION_ID
6. Network Details
Fields describing network and location information.
SERVICE_CATEGORY
- Description: Type of service/event
- Valid Values:
DATA- Data session (primary value for this CDR type)- [Other categories if applicable]
- Example:
DATA
USAGE_SERVICE_TYPE
- Description: Detailed service classification
- Valid Values:
Local data service- Standard local data usage- [Other classifications as applicable]
- Example:
Local data service
CallingCellID
- Description: Cell tower identifier for the data session
- Business Logic: Location-based analysis and network coverage optimization
- Example:
CELL-MLE-001 - Use Cases: Network performance by location, coverage analysis
RoamState
- Description: Roaming state of charged party
- Valid Values:
0- Home network1- National roaming2- International roaming- [Other values]
- Example:
0 - Business Logic: Impacts rating and charging rules for roaming data
RATType
- Description: Radio Access Technology type
- Valid Values:
0- Reserved (no specific meaning)1- 3G (UTRAN: WCDMA/TDCDMA)2- 2G (GERAN: GSM/GPRS/EDGE)3- WLAN (WIFI/WiMAX)4- GAN5- 3.5G (HSPA)6- 4G (EUTRAN: LTE)10- NR (5G)
- Default:
0 - Business Logic: Use to differentiate network generation (2G/3G vs 4G/5G)
- Example:
6(4G LTE) - Analysis Use: Network performance comparison, technology adoption tracking
7. Free Unit Details (Per Offering)
Fields capturing free unit consumption broken down by offering. The CDR contains 10 sets of these fields (suffixed _1 through _10).
FREE_UNIT_ID_[1-10]
- Description: Unique ID of free unit instance
- Business Logic:
- Links to PE_FREE_UNIT table for offering details
- Up to 10 different free unit instances can be consumed in one CDR
- NULL if no free unit consumed in this slot
- Join:
JOIN PE_FREE_UNIT ON FREE_UNIT_ID_1 = PE_FREE_UNIT.FREE_UNIT_ID
CHG_AMOUNT_[1-10]
- Description: Free unit usage amount for this instance
- Unit: Bytes (for data CDRs)
- Business Logic: The actual usage consumed from this free unit instance
FU_MEASURE_ID_[1-10]
- Description: Free unit measurement ID
- Valid Values: [Reference to measurement ID table - typically bytes for data]
- Business Logic: Defines the unit of CHG_AMOUNT
Business Logic
Usage Classification
1. PAYG Usage (Charged)
- Definition: Usage beyond free unit allowances, charged per MB
- Calculation:
TotalFlux - FREE_UNIT_AMOUNT_OF_FLUX
2. Baseplan Usage
- Definition: Usage covered by free units from base plan
- Identification: Join with PE_FREE_UNIT_TYPE to get bucket type
- Calculation: Sum CHG_AMOUNT per baseplan bucket
3. Addon Usage
- Definition: Usage covered by free units from add-ons
- Identification: Join with PE_FREE_UNIT_TYPE to get bucket type
- Calculation: Sum CHG_AMOUNT per add-on bucket
4. Free App/Social Usage (Zero-rated)
- Definition: Usage from specific apps/services with no charge and no free unit consumption
- Identification: Join with PE_FREE_UNIT_TYPE to get bucket type
- Calculation: Sum CHG_AMOUNT per respective bucket
5. Free Excess / Throttled Usage
- Definition: Usage with no charge and no free unit consumption (throttled after plan exhaustion)
- Identification:
DEBIT_AMOUNT = 0ANDFREE_UNIT_AMOUNT_OF_FLUX = 0ANDRatingGroup = 101 - Business Logic: Typically throttled/reduced speed data after allowance exhaustion
- Example: Unlimited data at reduced speeds after high-speed allowance is used
Bucket vs Offering Classification
- Bucket Classification: Join with PE_FREE_UNIT_TYPE for free unit bucket types (e.g., "Base Data", "Addon Data", "Bonus Data")
- Offering Classification: Join with PE_FREE_UNIT for specific offering instances
- Both classifications can coexist for comprehensive analysis
Charge Calculation
1. PAYG charge
- Definition: Charged incurred within the call
- Calculation: Sum of debit amount
Special Scenarios
Session Splitting
- When: Long data sessions are commonly split into multiple CDRs
- Identification: Same SESSION_ID across multiple CDR_IDs
- Business Rule: Data sessions frequently span hours/days, requiring CDR splits
- Aggregation: CRITICAL - Always group by SESSION_ID for accurate session-level totals
Hybrid Subscriber Handling
- Scenario: Hybrid (PayType=2) subscribers generate 2 CDRs
- Identification: Same SESSION_ID, different CDR_IDs
- Charge Splitting: One CDR has DEBIT_FROM_PREPAID, other has DEBIT_FROM_POSTPAID
- Total Charge: Sum both DEBIT_AMOUNT values
CUG Call Flag
- Field: GroupCallType
- Logic:
GroupCallType != 0for corporate calls - Use Case: Add CUG flag & if OBJ_TYPE != 'S', the charge should not be accounted to the customer
Data Quality
Validation Rules
Mandatory Field Checks
- CDR_ID, CDR_SUB_ID, SESSION_ID, PRI_IDENTITY, SUBSCRIBER_KEY, ACCOUNT_KEY, ACTUAL_USAGE, RATE_USAGE, DEBIT_AMOUNT must not be NULL
Appendix
Related Tables
| Table Name | Purpose | Join Condition |
|---|---|---|
| PE_FREE_UNIT | Free unit instances and offering mappings | FREE_UNIT_ID_[1-10] = FREE_UNIT_ID |
| PE_FREE_UNIT_TYPE | Free unit bucket types | Via PE_FREE_UNIT |
| [SUBSCRIBER] | Subscriber attributes | SUBSCRIBER_KEY |
| [ACCOUNT] | Account attributes | ACCOUNT_KEY |
| [OFFERING] | Offering/plan details | MainOfferingID, LastEffectOffering |
Change Log
| Version | Date | Author | Changes |
|---|---|---|---|
| 1.0 | 2026-01-25 | Niha | Initial documentation |
Document End