# Intervalos de hora

**URL:** <https://community.amazonquick.com/t/intervalos-de-hora/32971>\
**Category:** Q&A\
**Tags:** calculations, Business-Intelligence-Engineer, quick-sight\
**Created:** [July 23, 2024, 8:55pm UTC](https://community.amazonquick.com/t/intervalos-de-hora/32971 "2024-07-23T20:55:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Santi98](https://avatars.discourse-cdn.com/v4/letter/s/e0b2c6/32.png) [@Santi98](https://community.amazonquick.com/u/Santi98)\
**Post date:** [July 23, 2024, 8:55pm UTC](https://community.amazonquick.com/t/intervalos-de-hora/32971/1 "2024-07-23T20:55:30Z")

</div>

Hola a todos!

Tengo una consulta, actualmente requiero sacar el conteo de una variable por intervalos de 15 minutos, algo así  
“00:00 a 15:00”,  
“15:00 a 30:00”,  
“30:00 a 45:00”,  
“45:00 a 00:00” tengo el campo de hora tipo string pero no logro sacar ese intervalo de tiempo he intentando de la sigueinte forma  
intervalo=extract(‘HH’, parseDate({Hora}, ‘HH:mm:ss’)) \* 60 + extract(‘MI’, parseDate({Hora}, ‘HH:mm:ss’))  
ifelse(  
{intervalo} % 60 \< 15, “00:00 a 15:00”,  
{intervalo} % 60 \< 30, “15:00 a 30:00”,  
{intervalo} % 60 \< 45, “30:00 a 45:00”,  
“45:00 a 00:00”  
) pero no me da el intervalo, me podrían ayudar?  
 ![image](https://d1wl4jav5dp96l.cloudfront.net/original/3X/2/f/2f53ad353c65ed4366bfc39ee39624eaf4da80df.png)

---

<div class="post-metadata">

**Author:** ![Shahid\_Muhammad](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/shahid_muhammad/32/24673_2.png) [@Shahid\_Muhammad](https://community.amazonquick.com/u/Shahid_Muhammad)\
**Post date:** [July 24, 2024, 4:54am UTC](https://community.amazonquick.com/t/intervalos-de-hora/32971/2 "2024-07-24T04:54:47Z")

</div>

Hi  
To achieve the desired results you need to perform following steps.

- **Parse the time field into a datetime object**.
- **Extract the hour and minute components and compute the total minutes since midnight**.
- **Determine the correct 15-minute interval**.

---

<div class="post-metadata">

**Author:** ![Xclipse](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/xclipse/32/20455_2.png) [@Xclipse](https://community.amazonquick.com/u/Xclipse)\
**Post date:** [July 30, 2024, 4:00am UTC](https://community.amazonquick.com/t/intervalos-de-hora/32971/3 "2024-07-30T04:00:04Z")

</div>

Hi @Santi98, did this solution work for you? I am marking this reply as, “Solution,” but let us know if this is not resolved. Thanks for posting your questions on the Quick Sight Community!
