Referrals Fact Table

This table records referral events, where existing customers introduce new customers to the brand. The person who makes the referral is known as a referrer, while the individual who receives the referral invite is called a referee. This fact table captures all the information surrounding the referral event, such as the date and time of the referral, store associated with the referral, referrer and referee identifiers, and the campaign associated with the referral.

Databricks Table Name: referrals

Referrals Fact - Entity Relationship Diagram (ERD)

Zoom in the table for more clarity. Click the table title to view its details.

Referralsauto_update_time: bigintcontext_id: bigintdim_campaign_id: bigintdim_event_date_id: bigintdim_event_time_id: bigintdim_event_user_id: bigintdim_event_zone_till_id: bigintdim_latest_updated_date_id: bigintdim_latest_updated_time_id: bigintdim_referred_to_user_id: bigintevent_type: stringPKreferee_id: bigintyear: intDateLKdate_id: intday_of_month: intweek_of_year: intmonth: stringyear: intquarter: stringweek_number: intweek_start_date: stringweek_end_date: stringday_of_week: stringmonth_no: intmonth_no_of_year: intmonth_of_year: stringday_of_week_no: intquarter_no: intyearly_quarter_no: intdate: stringDateTimeLKtime_id: biginttime: stringhour_of_day: intminute_of_day: intday_shift: stringday_shift_no: inthour_range: stringTimeZone_tillsstore_country: stringexternal_id_1: stringstore: stringauto_update_till_parent: bigintarea: stringstore_name: stringstore_city: stringstore_state: stringtill: stringauto_update_till_store_relation: bigintis_ffc_enabled: stringLKtill_id: biginttype: stringtill_description: stringauto_update_till: bigintstore_channel: stringexternal_id: stringis_billable: stringstore_id: bigintis_active: stringauto_update_store: bigintstore_description: stringlatitude: stringtimezone: stringexternal_id_2: stringtill_name: stringzone_name: stringZone Tillsusersauto_update_merged_customer: bigintauto_update_loyalty: bigintfraud_status: stringtest_control_bucket: stringis_merged_customer: stringsubscription_status_email_bulk: stringfirst_name: stringslab_name: stringsubscription_status_wechat_bulk: stringemail: stringlast_name: stringmerged_user_id: bigintLKuser_id: bigintsubscription_status_wechat_trans: stringsubscription_status_sms_bulk: stringndnc_status: stringsubscription_status_email_trans: stringtest_control_status: stringauto_update_fraud_user: bigintis_inactive: stringsource: stringslab_number: intauto_update_users: bigintregistered_till_id: bigintauto_update_customer_enrollment: bigintslab_expiry_date: stringcustomer_external_id: stringsubscription_status_sms_trans: stringmobile: stringloyalty_type: stringauto_update_ndnc_status: bigintUsersCampaignsis_recurring: stringcampaign_end_date: stringis_migrated: stringauto_update_campaign: bigintLKcampaign_id: bigintcampaign_type: stringroi_type: stringcampaign_start_date: stringname: stringCampaignsReferrals

Legend

PK   Primary Key

LK   Linking Key

Fact Table
Dimension Table

Referrals Fact Table

Column NameData TypeDescriptionLinked Table
auto_update_timebigintDate and time when the corresponding table available at the source was last updated. It is in the Unix timestamp format._
context_idbigintIdentifier for the context in which the action occurred, such as a specific campaign or promotion context._
dim_campaign_idbigintIdentifier for the campaign associated with the referral action.campaign
dim_event_date_idbigintDate when the referral action occurred.date
dim_event_time_idbigintTime when the referral action occurred.time
dim_event_user_idbigintIdentifier for the customer associated with the referral action.users
dim_event_zone_till_idbigintIdentifier assigned to the point-of-sale (POS) terminal within a store, where the referral occurred. It distinguishes one checkout location from another within the same store.zone till
dim_latest_updated_date_idbigintDate when the data corresponding to this event/row is changed in the source table.date
dim_latest_updated_time_idbigintTime when the data corresponding to this event/row is changed in the source table.time
dim_referred_to_user_idbigintIdentifier for the customer who was referred (referee).users
event_typestringThe type of event, such as "Referral Registration" (when a referee registers as a result of a referral) or "Referral Transaction" (when a referee makes a transaction as a result of a referral)._
referee_idbigintUnique identifier for the referee (the customer who was referred). It is the primary key of the table._
yearintYear of the referral._