Gift Cards Fact Table
ZTZenoti Docs Team Updated April 10, 2026 2 min readGuide
Stores gift card sale and redemption transactions, including pricing, discount, tax, and redemption details.
Columns
| Column Name | Data Type | Nullable | Description |
|---|---|---|---|
| factgiftcardwid | BIGINT IDENTITY | NOT NULL | Surrogate key and primary key for the gift card record. |
| factgiftcardid | BIGINT | YES | Source system identifier for the gift card fact. |
| paymentdate | DATE | YES | Date the payment was made for the gift card. |
| saledate | DATE | YES | Date the gift card was sold. |
| closeddate | DATE | YES | Date the associated invoice was closed. |
| recordtypeid | SMALLINT | NOT NULL | Record type identifier distinguishing sale vs. redemption records. |
| itemwid | BIGINT | YES | Foreign key to the item dimension for the gift card item. |
| redemptionitemwid | BIGINT | YES | Foreign key to the item dimension for the redeemed item. |
| giftcarduserwid | BIGINT | YES | Foreign key to the user who owns the gift card (Bi_DimUser.userwid). |
| userwid | BIGINT | YES | Foreign key to the user associated with the transaction (Bi_DimUser.userwid). |
| redemptionuserwid | BIGINT | YES | Foreign key to the user who redeemed the gift card (Bi_DimUser.userwid). |
| centerwid | BIGINT | YES | Foreign key to the center where the transaction occurred (Bi_DimCenter.centerwid). |
| podid | INTEGER | YES | Identifier for the pod (database partition). |
| invoiceid | VARCHAR(36) | YES | GUID of the associated invoice. |
| invoiceitemid | VARCHAR(36) | YES | GUID of the associated invoice item. |
| itemtypewid | SMALLINT | YES | Foreign key to the item type dimension. |
| redemptioncenterwid | BIGINT | YES | Foreign key to the center where redemption occurred (Bi_DimCenter.centerwid). |
| expirydate | DATE | YES | Expiry date of the gift card. |
| saleprice | DOUBLE PRECISION | YES | Sale price of the gift card. |
| giftcardvalue | DOUBLE PRECISION | YES | Face value of the gift card. |
| redemamount | DOUBLE PRECISION | YES | Amount redeemed from the gift card. |
| factortoprice | DOUBLE PRECISION | YES | Factor applied to the price. |
| discount | DOUBLE PRECISION | YES | Discount applied to the gift card. |
| tax | DOUBLE PRECISION | YES | Tax amount on the gift card transaction. |
| void | INTEGER | YES | Soft-delete flag (0 = active, non-zero = voided). Default: 0. |
| activationdate | TIMESTAMP | YES | Date/time the gift card was activated. |
| invoiceno | VARCHAR(160) | YES | Human-readable invoice number. |
Note: All fact tables also include standard ETL metadata columns (
podname,organizationid,groupid,etlCreatedDate) which are omitted from this reference for brevity.
Primary Key
factgiftcardwid
Foreign Keys
| Column | References |
|---|---|
| giftcarduserwid | Bi_DimUser.userwid |
| userwid | Bi_DimUser.userwid |
| redemptionuserwid | Bi_DimUser.userwid |
| centerwid | Bi_DimCenter.centerwid |
| redemptioncenterwid | Bi_DimCenter.centerwid |
Enumerator Values
| Column | Values |
|---|---|
| recordtypeid | 0 = Not Applicable 1 = Accrual 2 = Redemption |
| void | 0 = active; non-zero = voided/soft-deleted. |
Was this article helpful?
Your feedback helps us improve our documentation.