# Kafka Stream aggregation how to get only aggregated result for a window

**URL:** <https://forum.confluent.io/t/kafka-stream-aggregation-how-to-get-only-aggregated-result-for-a-window/9645>\
**Category:** Kafka Streams\
**Created:** [21 December 2023 05:26 UTC](https://forum.confluent.io/t/kafka-stream-aggregation-how-to-get-only-aggregated-result-for-a-window/9645 "2023-12-21T05:26:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lakitha\_dias](https://avatars.discourse-cdn.com/v4/letter/l/59ef9b/32.png) [@lakitha\_dias](https://forum.confluent.io/u/lakitha_dias)\
**Post date:** [21 December 2023 05:26 UTC](https://forum.confluent.io/t/kafka-stream-aggregation-how-to-get-only-aggregated-result-for-a-window/9645/1 "2023-12-21T05:26:19Z")

</div>

Hi, I am currently working on a task where it needs to group incoming events based on an identifier within a given time window.

Tumbling window mechanism used in this scenario and its correctly aggregating the results.

The problem is, I am seeing multiple intermediate aggregation results within the given time window, appreciate if someone can suggest a solution for this.

Below is the code section for the aggregation.

 ![image](https://us1.discourse-cdn.com/flex019/uploads/confluentcommunity/original/2X/1/19e08c3232a3cecbcf80a6fe3c1d2ba25cc5736b.png)

---

<div class="post-metadata">

**Author:** ![lbrutschy](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/lbrutschy/32/2371_2.png) [@lbrutschy](https://forum.confluent.io/u/lbrutschy)\
**Post date:** [21 December 2023 08:33 UTC](https://forum.confluent.io/t/kafka-stream-aggregation-how-to-get-only-aggregated-result-for-a-window/9645/2 "2023-12-21T08:33:01Z")

</div>

Hey. You may be looking for suppression. See [Suppressed (kafka 3.6.1 API)](https://kafka.apache.org/36/javadoc/org/apache/kafka/streams/kstream/Suppressed.html#untilWindowCloses(org.apache.kafka.streams.kstream.Suppressed.StrictBufferConfig))

---

<div class="post-metadata">

**Author:** ![lakitha\_dias](https://avatars.discourse-cdn.com/v4/letter/l/59ef9b/32.png) [@lakitha\_dias](https://forum.confluent.io/u/lakitha_dias)\
**Post date:** [21 December 2023 09:20 UTC](https://forum.confluent.io/t/kafka-stream-aggregation-how-to-get-only-aggregated-result-for-a-window/9645/3 "2023-12-21T09:20:21Z")

</div>

Hi, thanks for the response. I have added the suppression configuration , looks the behavior is same as earlier, Other point to mention is, i am using the wall clock time in the consumer.

 ![image](https://us1.discourse-cdn.com/flex019/uploads/confluentcommunity/original/2X/3/3d98ad9b82df35fc6c3e2013ec58858f2ec4c626.png)

I have tried with the emit strategy options as well and ended up with the same result.

emitStrategy(EmitStrategy.onWindowClose())
