Columns
| Column | Type | Size | Nulls | Auto | Default | Children | Parents | Comments | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| dim_date_id | serial | 10 | √ | nextval('dim_date_seq'::regclass) |
|
|
Primary Key; an identifier for this record |
|||||||||||||||||||||||||||||||
| date_value | date | 13 | now() |
|
|
Date-only typed value of the date |
||||||||||||||||||||||||||||||||
| date_iso | bpchar | 10 | √ | null |
|
|
String representation in YYYY-MM-DD format, e.g. 2014-08-24 |
|||||||||||||||||||||||||||||||
| year | int2 | 5 | √ | null |
|
|
Just the year, YYYY, e.g. 2014 |
|||||||||||||||||||||||||||||||
| quarter | int2 | 5 | √ | null |
|
|
Quarter number that the month falls into, January - March = 1, April - June =2, July - September = 3, October - December = 4 |
|||||||||||||||||||||||||||||||
| quarter_name | bpchar | 2 | √ | null |
|
|
Q(n) quarter name that the month falls into, January - March = Q1, April - June = Q2, July - September = Q3, October - December = Q4 |
|||||||||||||||||||||||||||||||
| month | int2 | 5 | √ | null |
|
|
Numeric representation of the month, January = 1, February = 2, … December = 12 |
|||||||||||||||||||||||||||||||
| month_name | varchar | 10 | √ | null |
|
|
English titled month, January, February, … December |
|||||||||||||||||||||||||||||||
| month_abbreviation | varchar | 10 | √ | null |
|
|
Abbreviated english titled month, Jan, Feb, … Dec |
|||||||||||||||||||||||||||||||
| week | int2 | 5 | √ | null |
|
|
Week number of the year the day fell on, first week of January = 1, last week of December = 52 |
|||||||||||||||||||||||||||||||
| day_of_month | int2 | 5 | √ | null |
|
|
Day of the month this date fell on, e.g. 24 if 2014-08-24 |
|||||||||||||||||||||||||||||||
| day_of_year | int2 | 5 | √ | null |
|
|
Day of the year this date fell on. Count starts on 1st Jan (1) & finishes on 31st Dec (365/6), ie 2014-08-24 = 236 |
|||||||||||||||||||||||||||||||
| day_of_week | int2 | 5 | √ | null |
|
|
Day of the week this date fell on, Monday = 1 … Sunday = 7 |
|||||||||||||||||||||||||||||||
| day_name | varchar | 10 | √ | null |
|
|
English titled day, Monday … Sunday |
|||||||||||||||||||||||||||||||
| day_abbreviation | varchar | 10 | √ | null |
|
|
Abbreviated English titled day, Mon … Sun |
|||||||||||||||||||||||||||||||
| is_weekend | bool | 1 | √ | false |
|
|
||||||||||||||||||||||||||||||||
| is_weekday | bool | 1 | √ | false |
|
|
||||||||||||||||||||||||||||||||
| is_today | bool | 1 | √ | false |
|
|
||||||||||||||||||||||||||||||||
| is_yesterday | bool | 1 | √ | false |
|
|
||||||||||||||||||||||||||||||||
| is_this_week | bool | 1 | √ | false |
|
|
||||||||||||||||||||||||||||||||
| is_last_week | bool | 1 | √ | false |
|
|
||||||||||||||||||||||||||||||||
| is_3_week | bool | 1 | √ | false |
|
|
||||||||||||||||||||||||||||||||
| is_4_week | bool | 1 | √ | false |
|
|
||||||||||||||||||||||||||||||||
| is_5_week | bool | 1 | √ | false |
|
|
||||||||||||||||||||||||||||||||
| is_6_week | bool | 1 | √ | false |
|
|
||||||||||||||||||||||||||||||||
| is_this_month | bool | 1 | √ | false |
|
|
||||||||||||||||||||||||||||||||
| is_last_month | bool | 1 | √ | false |
|
|
||||||||||||||||||||||||||||||||
| is_2_month | bool | 1 | √ | false |
|
|
||||||||||||||||||||||||||||||||
| is_3_month | bool | 1 | √ | false |
|
|
||||||||||||||||||||||||||||||||
| is_4_month | bool | 1 | √ | false |
|
|
||||||||||||||||||||||||||||||||
| is_5_month | bool | 1 | √ | false |
|
|
||||||||||||||||||||||||||||||||
| is_6_month | bool | 1 | √ | false |
|
|
||||||||||||||||||||||||||||||||
| is_9_month | bool | 1 | √ | false |
|
|
||||||||||||||||||||||||||||||||
| is_18_month | bool | 1 | √ | false |
|
|
||||||||||||||||||||||||||||||||
| is_30_month | bool | 1 | √ | false |
|
|
||||||||||||||||||||||||||||||||
| is_42_month | bool | 1 | √ | false |
|
|
||||||||||||||||||||||||||||||||
| is_this_year | bool | 1 | √ | false |
|
|
||||||||||||||||||||||||||||||||
| is_last_year | bool | 1 | √ | false |
|
|
||||||||||||||||||||||||||||||||
| is_3_year | bool | 1 | √ | false |
|
|
||||||||||||||||||||||||||||||||
| is_4_year | bool | 1 | √ | false |
|
|
||||||||||||||||||||||||||||||||
| is_5_year | bool | 1 | √ | false |
|
|
||||||||||||||||||||||||||||||||
| is_over_5_year | bool | 1 | √ | false |
|
|
||||||||||||||||||||||||||||||||
| age_range | text | 2147483647 | √ | null |
|
|
Age category the date falls into (this is updated daily) so age_range changes daily. The categories are: <18, 18-25, 26-30, 31-35 … 76+ |
|||||||||||||||||||||||||||||||
| days_since | int4 | 10 | √ | 0 |
|
|
Indexes
| Constraint Name | Type | Sort | Column(s) |
|---|---|---|---|
| dim_date_pkey | Primary key | Asc | dim_date_id |
| dim_date_date_iso_key | Must be unique | Asc | date_iso |
| dim_date_date_value_key | Must be unique | Asc | date_value |



