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'

demandé il y a 9 mois561 vues
1 réponse
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
répondu il y a 9 mois

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions