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.


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?


|Dateset 1||


|Dateset 2||