1 個回答
- 最新
- 最多得票
- 最多評論
0
Below mentioned is the Sample dataset that I have used :
sno | ts |
---|---|
A | 2010-12-30 14:32:00 |
B | 2010-12-30 15:06:00 |
C | 2010-12-30 16:34:00 |
A | 2011-01-06 09:18:00 |
D | 2011-01-06 12:18:00 |
B | 2011-01-06 01:18:00 |
- Created a calculated field to extract the hour from the timestamp field "ts" as follows :
extract('HH', ts)
- Created another calculated field "periodcalc" which groups based on the hours into different intervals as follows :
ifelse(hour<=5,'Q1', hour>5 AND hour<=10,'Q2', hour>10 AND hour<=15,'Q3', hour>15 AND hour<=20,'Q4', 'Q5')
- Finally the result looks like this :
已回答 9 個月前
相關內容
- AWS 官方已更新 2 年前
- AWS 官方已更新 2 年前