Skip to content

Text Comments Dimension ​

Freeform text - order notes, service call summaries, complaint descriptions - arrives attached to individual transactions. It is tempting to store it directly in the fact table, but two properties usually argue against it:

  • Sparsity. Most transactions have no comment. A text column that is null for 95% of rows still occupies space in every row.
  • Repetition. Comments are rarely unique. Standard phrases like "Customer requested expedited shipping" recur across thousands of transactions.

Storing the text once in a comments dimension and referencing it by foreign key avoids both.

Fact Table:

transaction_iddate_keycustomer_keycomment_keyamount
TXN-12320260101C-100COM-5$100
TXN-12420260101C-212COM-0$250

Comments Dimension:

comment_keycomment_text
COM-0No Comment
COM-5Customer requested expedited shipping due to holiday.

Transactions without a comment reference the No Comment member rather than storing a NULL foreign key.

Derived Attributes on the Comment ​

Because the dimension holds one row per distinct comment, attributes derived from the text - sentiment score, category, language, whether it mentions a competitor - can be stored alongside it and used for grouping and filtering without reprocessing the text at query time:

comment_keycomment_textsentimentcategory
COM-5…NeutralShipping
COM-9…NegativeBilling

This is often the stronger argument for the separate dimension: derived attributes computed once per distinct comment rather than once per transaction.

NOTE

The sparsity and repetition arguments are weaker on columnar platforms, where nulls cost little and repeated values compress well. If comments are near-unique and your platform handles wide sparse columns efficiently, keeping the text in the fact table is a reasonable choice. Decide from your storage engine and cardinality, not from the rule alone.