Coupons Fact Table

This table captures the event wherein coupons are issued to or redeemed by the customer. It captures the date and time of the coupon issual/ redemption, the associated bill amount, expiry date of the coupon, and the customer for which the coupon issual/ redemption has been done.

Databricks Table Name: coupons

Coupons - Entity Relationship Diagram (ERD)

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

Couponsauto_update_time_coupons: stringbill_id: bigintcoupon_code: stringcoupon_code_src: stringdim_campaign_group_id: bigintdim_campaign_id: bigintdim_coupon_issual_type_id: bigintdim_coupon_series_id: bigintdim_entry_type_id: bigintdim_event_date_id: bigintdim_event_time_id: bigintdim_event_user_id: bigintdim_event_zone_till_id: bigintdim_expiry_date_id: bigintdim_issual_campaign_group_id: bigintdim_issual_date_id: bigintdim_issual_time_id: bigintdim_issual_type_id: bigintdim_issual_zone_till_id: intdim_issued_to_user_id: bigintdim_latest_updated_date_id: bigintdim_latest_updated_time_id: bigintPKevent_id: bigintissual_coupon_id: bigintredemption_bill_amount: doubleused_bill_number: stringyear: intPKdim_coupon_event_type_id: bigintCoupon Issual TypeLKid: biginttype: stringCoupon Seriespurpose: stringdiscount_type: stringdescription: stringLKcoupon_series_id: bigintauto_update_campaign_base: bigintowner_valid_till_date: stringmetadata: stringcampaign: stringclient_handling_type: stringdiscount_value: stringauto_update_voucher_series: bigintcampaign_id: bigintexpiry_strategy_type: stringvalid_till_date: stringseries_type: stringseries_id: stringdiscount_code: bigintexpiry_strategy_value: stringauto_update_owner_info: bigintEntry TypeLKid: bigintvalue: stringCampaign Groupis_recurring: stringcampaign_end_date: stringgroup_version_number: stringgroup_type: stringname: stringLKid: bigintcampaign: stringcampaign_start_date: stringroi_type: stringCampaignsis_recurring: stringcampaign_end_date: stringis_migrated: stringauto_update_campaign: bigintLKcampaign_id: bigintcampaign_type: stringroi_type: stringcampaign_start_date: stringname: stringdateLKdate_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: stringTimeusersauto_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: bigintUsersCampaign GroupCampaignsCouponsCoupon SeriesCoupon Issual TypeEntry TypeZone_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 TillsEntry TypeLKid: bigintstatus: stringRedeemed Status

Legend

PK   Primary Key

LK   Linking Key

Fact Table
Dimension Table

Coupons Fact Table

Column Name

Data Type

Description New

Linked Table

Availability for Export in theCoupons template

auto_update_time

  • coupons

string

Date and time when the corresponding record in the coupons table available at the source was last updated. It is in the Unix timestamp format.

Yes; Measure Name: Auto Update Time Coupons

bill_id

bigint

Identifier for the bill against which the coupons have been issued or redeemed.

Yes; Measure Name: Bill Id

coupon_code

string

A unique identifier generated for the coupons.

Yes; Measure Name: Coupon Code

coupon_code_src

string

Represents the source coupon code. It is the same as the coupon code.

Yes; Measure Name: Coupon Code Src

dim_campaign_group_id

bigint

Identifier for the campaign group (test or control) for which the coupon has been issued or redeemed.

campaign_group

Yes; Dimension Name: Campaign Group

dim_campaign_id

bigint

Identifier for the campaign for which the coupon has been issued or redeemed.

campaigns

Yes; Dimension Name: Campaign Id

dim_coupon_issual

  • type_id

bigint

Identifier of the type of coupon issued. Possible values are - Single, and Bulk. Single: A single coupon is issued, in response to a specific event. Bulk: Multiple coupons are issued simultaneously.

coupon_issual

Yes; Dimension Name: Coupon Issual Type

dim_coupon_series_id

bigint

Identifier of the coupon series against which the coupon has been issued or redeemed.

coupon_series

Yes; Dimension Name: Coupon Series

dim_entry_type_id

bigint

Captures the entry type for the coupon, whether it is a manual entry or through Intouch.

entry_type

Yes; Dimension Name: Entry Type

dim_event_date_id

bigint

Date when the coupon issual or redemption has occurred.

date

Yes; Dimension Name: Date

dim_event_time_id

bigint

Time when the coupon issual or redemption has occurred.

time

Yes; Dimension Name: Time

dim_event_user_id

bigint

Identifier of the user, set internally by Capillary.

users

Yes; Dimension Name: User Id

dim_event_zone_till_id

bigint

Identifier assigned to the point-of-sale (POS) terminal within a store, where the coupon was issued/redeemed. It distinguishes one checkout location from another within the same store.

zone_tills

Yes; Dimension Name: Store Hierarchy > Till Id

dim_expiry_date_id

bigint

Date when the coupon is set to expire.

date

Yes; Dimension Name: Expiry Date

dim_issual_campaign

  • group_id

bigint

Identifier for the campaign group associated with the coupon issual.

campaign_group

Yes; Dimension Name: Campaign Group

dim_issual_date_id

bigint

Date when the coupon has been issued.

date

Yes; Dimension Name: Issual Date

dim_issual_time_id

bigint

Time when the coupon has been issued.

time

Yes; Dimension Name: Issual Time

dim_issual_type_id

bigint

Captures the issual type. Possible values are store and customer.

coupon_issual

Yes; Dimension Name: Issual Type

dim_issual_zone_till_id

int

Identifier assigned to the point-of-sale (POS) terminal within a store, where the coupon was issued. It distinguishes one checkout location from another within the same store.

zone_tills

Yes; Dimension Name: Issual Zone Till

dim_issued_to_user_id

bigint

Identifier of the customer to whom the coupon has been issued.

users

Yes; Dimension Name: User Id

dim_latest_updated

  • date_id

bigint

Date when the data corresponding to this event/row is changed in the source table.

date

Yes; Measure Name: Latest Updated Date

dim_latest_updated

  • time_id

bigint

Time when the data corresponding to this event/row is changed in the source table.

time

Yes; Measure Name: Latest Updated Time

event_id

bigint

Unique identifier of the coupons issual/redemption event, It is the primary key of this table.

Yes; Measure Name: Event Id

issual_coupon_id

bigint

Unique identifier assigned to the coupon which has been issued.

Yes; Measure Name: Issual Coupon Id

redemption_bill_amount

double

Total transaction amount of the bill against which the coupon has been redeemed.

Yes; Measure Name: Redemption Bill Amount

used_bill_number

string

Bill number used while redeeming the coupon.

Yes; Measure Name: Used Bill Number

year

int

Year when the coupon was issued/redeemed.

Yes; Dimension Name: Year

dim_coupon_event

  • type_id

bigint

Identifier for the coupons event type (issual, redemption). It is the primary key of this table.

redeemed_status

Yes; Dimension Name: Coupon Event Type