# Kapacitor Join issue - returns empty

**URL:** <https://community.influxdata.com/t/kapacitor-join-issue-returns-empty/8536>\
**Category:** Systems\
**Tags:** kapacitor\
**Created:** [February 12, 2019, 2:29pm UTC](https://community.influxdata.com/t/kapacitor-join-issue-returns-empty/8536 "2019-02-12T14:29:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![taln](https://avatars.discourse-cdn.com/v4/letter/t/e47774/32.png) [@taln](https://community.influxdata.com/u/taln)\
**Post date:** [February 12, 2019, 2:29pm UTC](https://community.influxdata.com/t/kapacitor-join-issue-returns-empty/8536/1 "2019-02-12T14:29:15Z")

</div>

I’m trying to make a join between two batches but it’s not working and I can’t figure why

> var meanw = batch  
> |query(‘’’ SELECT mean as value FROM “metrics”.“default”.“mean\_week\_1h” ‘’')  
> .period(2d)  
> .every(10s)

will return this result:

> time value  
> ---- ----  
> 2019-02-11T01:00:00Z 1987.604285714286

> var current\_val = batch │  
> |query(‘’’ SELECT FIRST(“value”) as value FROM “metrics”.“default”.“daily\_perf” where “network” = ‘A’ AND “measure” = ‘measure’ ORDER BY “time” DESC LIMIT 1’‘’)  
> .period(1d)  
> .every(10s)  
> .groupBy(time(1d, 1h))  
> │

current\_val result is:

> time value  
> ---- -----  
> 2019-02-12T01:00:00Z 2019.26

now the merge:

> current\_val  
> |join(meanw)  
> .as(‘current\_val’, ‘meanw’)  
> .tolerance(1w)  
> |influxDBOut()  
> .database(‘metrics’)  
> .measurement(‘joined\_measurement’)

now I see the time is different so I added a tolerance to the join but still the joined measurement is not written in influx. I assume because of empty result of the join.

Can anyone help me please?

---

<div class="post-metadata">

**Author:** ![samaust](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/samaust/32/867_2.png) [@samaust](https://community.influxdata.com/u/samaust)\
**Post date:** [February 13, 2019, 3:55am UTC](https://community.influxdata.com/t/kapacitor-join-issue-returns-empty/8536/2 "2019-02-13T03:55:56Z")

</div>

The documentation explains it well. You need to group by time with the same interval and fill in both queries.

> **[Calculate rates across joined series + backfill | Kapacitor 1.6 Documentation](https://docs.influxdata.com/kapacitor/v1.5/guides/join_backfill/#joining-with-batch-data)**
>
> Use a prepared data generator to calculate rates across joined series and backfill.
