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ヶ月前561ビュー
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ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ