Fields - Time
Time
Time is used to get group of time-based dimensions (like Year, Month, Day, Hour etc) from single column of time data.
Time can reference dimensions.
fields: #begin of fields section (inside View or Model)
- time: time_name #for group of generated time-based dimensions
hidden: false
group_label: 'group label in UI'
group_description: 'group description in UI'
source: time_source
sql: 'SQL expression'
unnest: 'BigQuery UNNEST SQL expression'
timeframes:
- year
- quarter
- quarter_of_year
- month
- month_name
- month_num
- week
- week_of_year
- date
- day_of_week
- day_of_week_index
- day_of_month
- day_of_year
- hour
- hour2
- hour3
- hour4
- hour6
- hour8
- hour12
- hour_of_day
- minute
- minute2
- minute3
- minute5
- minute10
- minute15
- minute30
- time
- time_of_day
- yesno_has_value
Time Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| time* | string | - | Create a group of time dimensions based on column with time data |
| hidden | boolean | false | Hide field in UI |
| group_label | string | - | Group label |
| group_description | string | - | Group description |
| source | enum | timestamp | Provide type of data that will be gathered using sql parameter:
|
| sql* | string | - | Way to calculate field through SQL expression (can use BlockML references to other dimensions) |
| unnest | string | - | (BigQuery) for example "JOIN UNNEST(payload.pages) AS page" |
| timeframes | Timeframes Enum[] | - | Define a set of time dimensions you want to produce |
Timeframes
| Name | Output (2016-01-19 08:47:34 UTC) | Result (implicitly set) |
|---|---|---|
| year | 2016 | ts |
| quarter | 2016-01 | ts |
| quarter_of_year | Q1 | quarter_of_year |
| month | 2016-01 | ts |
| month_name | January | month_name |
| month_num | 1 | number |
| week | 2016-01-18 | ts |
| week_of_year | 4 | number |
| date | 2016-01-19 | ts |
| day_of_week | Tuesday | day_of_week |
| day_of_week_index | 2 (if week starts on Monday) | day_of_week_index |
| day_of_month | 19 | number |
| day_of_year | 19 | number |
| hour | 2016-01-19 08 | ts |
| hour2 | 2016-01-19 08 | ts |
| hour3 | 2016-01-19 06 | ts |
| hour4 | 2016-01-19 08 | ts |
| hour6 | 2016-01-19 06 | ts |
| hour8 | 2016-01-19 08 | ts |
| hour12 | 2016-01-19 00 | ts |
| hour_of_day | 8 | number |
| minute | 2016-01-19 08:47 | ts |
| minute2 | 2016-01-19 08:46 | ts |
| minute3 | 2016-01-19 08:45 | ts |
| minute5 | 2016-01-19 08:45 | ts |
| minute10 | 2016-01-19 08:40 | ts |
| minute15 | 2016-01-19 08:45 | ts |
| minute30 | 2016-01-19 08:30 | ts |
| time | 2016-01-19 08:47:34 | ts |
| time_of_day | 08:47 | string |
| yesno_has_value | Returns Yes if SQL expression (after evaluation) has a value, otherwise No | yesno |