Formatting date/time data
AnsweredHi all,
I have a request to sort data by minutes or divide an hour into blocks, let's say to have three 20-minute blocks in each hour. We want to know how many visitors finish a certain set of actions within the first, second or third part of the hour.
Any ideas?
J ~~
-
Hi Jane,
you would need to do two things on your ElastiCube. On table holding your date-time field add an additional field of type integer and in it use following function GetMinute([date-time field]); let's assume this field will be called Field1. Then add a second field (text field) which will have following syntax:
CASE
WHEN Field1 >=0 and Field1 <20 THEN 'First 20 minutes'
WHEN Field1 >=20 AND Field1 <40 THEN 'Middle 20 minutes'
WHEN Field1 >=40 and Field1 <=59 THEN 'Last 20 minutes'
ELSE 'No time'
END
That should give you a text field which will allow you to group data by 20 minutes blocks within each hour. Hope it helps.
Regards,
Michał
Please sign in to leave a comment.
Comments
2 comments