# Unique count number of deviations from average score in Kibana Maps

**URL:** <https://discuss.elastic.co/t/unique-count-number-of-deviations-from-average-score-in-kibana-maps/276906>\
**Category:** Kibana\
**Created:** [June 24, 2021, 10:14am UTC](https://discuss.elastic.co/t/unique-count-number-of-deviations-from-average-score-in-kibana-maps/276906 "2021-06-24T10:14:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roy\_Levy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/roy_levy/32/61613_2.png) [@Roy\_Levy](https://discuss.elastic.co/u/Roy_Levy)\
**Post date:** [June 24, 2021, 10:14am UTC](https://discuss.elastic.co/t/unique-count-number-of-deviations-from-average-score-in-kibana-maps/276906/1 "2021-06-24T10:14:49Z")

</div>

Hey,

I'm trying to build a map (using the 'Maps' feature) which will represent the number of unique device type that are deviating in a certain measurement from the average of this measurement in a certain area.

If the average is 70, all of the ones with measurement of 70+ will be considered a deviation.

The SQL syntax will be something like so:

```auto
SELECT AVG(measurement)
AS overall_measurement
FROM index1

INNER JOIN

SELECT AVG(measurement)
AS device_measurement
FROM index1
GROUP BY device_type

WHERE device_measurement > overall_measurement

```

From what I've found there are only simple Metrics aggregations in Maps.  
Is there any way to get this information in the Maps feature? Or will I have to create a new index with the information?

---

<div class="post-metadata">

**Author:** ![thomasneirynck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thomasneirynck/32/23313_2.png) [@thomasneirynck](https://discuss.elastic.co/u/thomasneirynck)\
**Post date:** [June 24, 2021, 11:13am UTC](https://discuss.elastic.co/t/unique-count-number-of-deviations-from-average-score-in-kibana-maps/276906/2 "2021-06-24T11:13:23Z")

</div>

hi @Roy_Levy ,

thank you for your question.

this would require a new index, since the Maps-application does not allow you to express this query.

This is a fairly sophisticated metric to visualize, and a lot of charts in Kibana would struggle with this. It would be good to raise an issue here: [https://github.com/elastic/kibana/issues/new/choose](https://github.com/elastic/kibana/issues/new/choose)

---

<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:** [July 22, 2021, 11:14am UTC](https://discuss.elastic.co/t/unique-count-number-of-deviations-from-average-score-in-kibana-maps/276906/3 "2021-07-22T11:14:05Z")

</div>

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