Quicksight - Parse a timestamp to extract and group hours

0

I wanted to bin the timestamp column into periods, Currently we have a Timestamp column in the format of 'yyyy-MM-dd HH:mm:ss' and we are using calculated filed 'substring(formatDate({aggregate_ts}), 12, 5)' to extract the hours, here aggregate_ts is the column with timestamps

Is there anyway we can parse the timestamp to group them in bins such as 1pm to 5pm in 'Q1' and 5pm to 10pm in 'Q2'

질문됨 9달 전562회 조회
1개 답변
0

Below mentioned is the Sample dataset that I have used :


snots
A2010-12-30 14:32:00
B2010-12-30 15:06:00
C2010-12-30 16:34:00
A2011-01-06 09:18:00
D2011-01-06 12:18:00
B2011-01-06 01:18:00

  1. Created a calculated field to extract the hour from the timestamp field "ts" as follows :

extract('HH', ts)

  1. 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')

  1. Finally the result looks like this :

Enter image description here

AWS
답변함 9달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠