# Question about adding minutes row in hourly summary table

**URL:** <https://forum.kx.com/t/question-about-adding-minutes-row-in-hourly-summary-table/10795>\
**Category:** Community Support\
**Tags:** kdb-and-q\
**Created:** [February 16, 2016, 10:47am UTC](https://forum.kx.com/t/question-about-adding-minutes-row-in-hourly-summary-table/10795 "2016-02-16T10:47:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![carfield11](https://avatars.discourse-cdn.com/v4/letter/c/ec9cab/32.png) [@carfield11](https://forum.kx.com/u/carfield11)\
**Post date:** [February 16, 2016, 10:47am UTC](https://forum.kx.com/t/question-about-adding-minutes-row-in-hourly-summary-table/10795/1 "2016-02-16T10:47:00Z")

</div>

Hi all

I have a table which is aggregated by hour, like this

| time | sym | x | y |  
| 10:00 | a | 2 | 4 |  
| 11:00 | a | 2 | 3 |  
| 12:00 | a | 1 | 3 |  
| 13:00 | a | 1 | 3 |  
| 14:00 | a | 1 | 3 |  
| 15:00 | a | 1 | 2 |  
| 10:00 | b | 2 | 4 |  
| 11:00 | b | 2 | 3 |  
| 12:00 | b | 1 | 3 |  
| 13:00 | b | 1 | 3 |  
| 14:00 | b | 1 | 3 |  
| 15:00 | b | 1 | 2 |

I need to join this with other table with 5 min timebin, which maybe start at 10:05 / 10:10, thus I would like to replicate the data from 10:00 to 10:05, … 10:55 to join it, any suggestion of how to do this?

---

<div class="post-metadata">

**Author:** ![ikorkhov1](https://avatars.discourse-cdn.com/v4/letter/i/d2c977/32.png) [@ikorkhov1](https://forum.kx.com/u/ikorkhov1)\
**Post date:** [February 16, 2016, 2:05pm UTC](https://forum.kx.com/t/question-about-adding-minutes-row-in-hourly-summary-table/10795/2 "2016-02-16T14:05:00Z")

</div>

Are you looking for something along these lines?  
&nbsp; &nbsp;

`ungroup select time+\:00:05*til 12, sym, x, y from t1`

Why can you not use asof join?

---

<div class="post-metadata">

**Author:** ![carfield1](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@carfield1](https://forum.kx.com/u/carfield1)\
**Post date:** [February 17, 2016, 2:19pm UTC](https://forum.kx.com/t/question-about-adding-minutes-row-in-hourly-summary-table/10795/3 "2016-02-17T14:19:00Z")

</div>

Thanks, yes, that what I need, thanks a lot

For asof join, I thought we usually use that to join trade and quote, which to get the most recent quote for trade, where in this joining, we will remove the quote data which cannot match, so it is quite difference, isn’t it?

---

<div class="post-metadata">

**Author:** ![ikorkhov1](https://avatars.discourse-cdn.com/v4/letter/i/d2c977/32.png) [@ikorkhov1](https://forum.kx.com/u/ikorkhov1)\
**Post date:** [February 17, 2016, 2:40pm UTC](https://forum.kx.com/t/question-about-adding-minutes-row-in-hourly-summary-table/10795/4 "2016-02-17T14:40:00Z")

</div>

Maybe I have misinterpreted your question but I thought you wanted to duplicate rows in a table from your original example to be able to join it with another one where timestamps are more granular. For example:

`time sym z p / table2----------------------10:05:00.000 a 20 4010:10:00.000 a 20 3010:15:00.000 a 10 3010:20:00.000 a 10 3010:25:00.000 a 10 3010:30:00.000 a 10 2010:35:00.000 b 20 4010:40:00.000 b 20 3010:45:00.000 b 10 3010:50:00.000 b 10 3010:55:00.000 b 10 30`

Then aj[`sym`time;table2;table1] is

`time sym z p x y--------------------------10:05:00.000 a 20 40 2 410:10:00.000 a 20 30 2 410:15:00.000 a 10 30 2 410:20:00.000 a 10 30 2 410:25:00.000 a 10 30 2 410:30:00.000 a 10 20 2 410:35:00.000 b 20 40 2 410:40:00.000 b 20 30 2 410:45:00.000 b 10 30 2 410:50:00.000 b 10 30 2 410:55:00.000 b 10 30 2 4`

I.e. values of z and p from table1 are used with prevailing values of x and y from table1.
