How to create 15min interval using datetime & value fields in Quicksight

Hi QS community,

I am struggling to create 15min interval using datetime & value fields.
Basically I am trying to calculate/display number of people count at that given time within the 15min interval based on the value.
Calculated field: datetime (15min Interval) - addDateTime((extract(‘MI’, datetime) % 15), ‘HH’, datetime)

getting below result

|datetime (15min Interval)|value|
|2023-02-28 11:00:10|268|
|2023-02-28 12:00:04|289|
|2023-02-28 13:00:02|304|
|2023-02-28 14:00:01|319|
|2023-02-28 15:00:00|328|
|2023-02-28 16:00:00|333|
|2023-02-28 18:00:01|339|
|2023-02-28 19:13:53|340|
|2023-02-28 20:13:55|680|
|2023-02-28 22:13:52|344|
|2023-02-28 23:13:54|690|

Something like this I am trying to achieve.

Your help will be appreciated

Shouldn’t this be addDateTime((extract(‘MI’, datetime) % 15), 'MI', datetime)

Literally, I have tried with ‘MI’ yesterday, I was testing something else and pasted the wrong formula with ‘HH’.

find the result below, it is still not working

Ah you need to subtract the remainder. Not add it.

addDateTime(-(extract('MI',{arrival_timestamp})%15),'MI',{arrival_timestamp})

Hi folks. I was able to get @Max solution to work in Analysis - thanks. I am wondering about in Dataset preparation - it fails there.

I have two separate datasets that i would like to Join via Data Time. Each dataset reports within a 15 minute window but is off by a minute or two of each other. With no coherence in the minute the Join response is bad.

I had hoped to create a calculated field for each dataset that rounds the time to the 15 minute block, following @faisalchohan, however I get the error (see red text image below) - using many variations of the snippet below.

Any way of tweaking this to use in Dataset editing and calculated field creation to Join datasets?

addDateTime(-(extract(‘MI’,{DateTime})%15),‘MI’,{DateTime})

|Dateset 1||

|DateTime|Value|
|2024/06/01T12:01|20|
|2024/06/01T12:17|80|
|2024/06/01T12:35|30|
|2024/06/01T12:48|11|
|2024/06/01T13:02|65|
|2024/06/01T13:18|89|
|2024/06/01T13:36|41|
|2024/06/01T13:49|30|
|2024/06/01T14:03|22|
|2024/06/01T14:19|55|
|2024/06/01T14:37|68|
|2024/06/01T14:50|11|

|Dateset 2||
|DateTime|Value|
|2024/06/01T12:06|22|
|2024/06/01T12:15|55|
|2024/06/01T12:37|68|
|2024/06/01T12:50|11|
|2024/06/01T13:04|65|
|2024/06/01T13:16|89|
|2024/06/01T13:33|41|
|2024/06/01T13:46|30|
|2024/06/01T14:08|65|
|2024/06/01T14:16|89|
|2024/06/01T14:31|41|
|2024/06/01T14:46|30|