# Query configuration in annotation in TSVB visual

**URL:** <https://discuss.elastic.co/t/query-configuration-in-annotation-in-tsvb-visual/319511>\
**Category:** Kibana\
**Created:** [November 22, 2022, 6:08am UTC](https://discuss.elastic.co/t/query-configuration-in-annotation-in-tsvb-visual/319511 "2022-11-22T06:08:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Seemant\_Bind](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/seemant_bind/32/107045_2.png) [@Seemant\_Bind](https://discuss.elastic.co/u/Seemant_Bind)\
**Post date:** [November 22, 2022, 6:08am UTC](https://discuss.elastic.co/t/query-configuration-in-annotation-in-tsvb-visual/319511/1 "2022-11-22T06:08:28Z")

</div>

Hi,

I wanted to create a visual in TSVB to display Bell icon when total count of category exceeds particular threshold. I have tried category.keyword.count\>10 (referring to this [creating a trend graph based on tsvb + adding annotations - YouTube](https://www.youtube.com/watch?v=A_5nBS7OPlg)) but it is not working. See the screenshot for the configuration.  
Also, is there any other visual to achieve the same?

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/1/6140e3977ef96eb1040e89268920de7f0036e9c3.png)  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/e/b/ebaf382ec78a414fe394e14a722c21ddf0372324.png)

---

<div class="post-metadata">

**Author:** ![Marco\_Liberati](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_liberati/32/82953_2.png) [@Marco\_Liberati](https://discuss.elastic.co/u/Marco_Liberati)\
**Post date:** [November 22, 2022, 9:22am UTC](https://discuss.elastic.co/t/query-configuration-in-annotation-in-tsvb-visual/319511/2 "2022-11-22T09:22:56Z")

</div>

Hi @Seemant_Bind

Annotations are an "event-based" feature, which it means that single events are taken into consideration to add an annotation: for instance, that is useful when you know something happened on 2022-07-15 at 13:00 and you want to annotate it on the chart.

In your case you want to apply an annotation based on a aggregation result, which is not something that is natively possible to do either on TSVB or Lens.  
I think you have two options here:

- preprocess your data and create documents/events on a different index/dataview for when your criteria is passed. At this point it would be possible to use TSDB/Lens annotations.

- use an alternative representation, something like a bar chart in front of the area, with [some formula tricks](https://discuss.elastic.co/t/dec-4th-2021-en-advanced-trick-and-tips-in-lens/289935#comparing-against-a-static-value-7) to isolate only where \> 10

- Use another visualization entirely, like a table and color only cells where the sum of all categories \> 10.

The second one would be much easier to compute when conditionals will be available in Lens formula.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 20, 2022, 9:23am UTC](https://discuss.elastic.co/t/query-configuration-in-annotation-in-tsvb-visual/319511/3 "2022-12-20T09:23:37Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
