# Visualize: Expected numeric type on field \[some\_field\], but got \[string\]

**URL:** <https://discuss.elastic.co/t/visualize-expected-numeric-type-on-field-some-field-but-got-string/142380>\
**Category:** Kibana\
**Created:** [July 31, 2018, 2:06pm UTC](https://discuss.elastic.co/t/visualize-expected-numeric-type-on-field-some-field-but-got-string/142380 "2018-07-31T14:06:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dee/32/18876_2.png) [@Dee](https://discuss.elastic.co/u/Dee)\
**Post date:** [July 31, 2018, 2:06pm UTC](https://discuss.elastic.co/t/visualize-expected-numeric-type-on-field-some-field-but-got-string/142380/1 "2018-07-31T14:06:01Z")

</div>

Hi,  
When going to the index setting I clearly see that the type for field some\_field is number.  
But in the visualization I'm getting this error when trying to do an "average" on this field-

"Visualize: Expected numeric type on field [some\_field], but got [string]"

How can I tell what is the issue here?  
I also have other indices which have the same some\_field and there it's a string. Could it be the cause? If so, I would love to get an explanation why.

Thanks.

---

<div class="post-metadata">

**Author:** ![Bargs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bargs/32/5429_2.png) [@Bargs](https://discuss.elastic.co/u/Bargs)\
**Post date:** [July 31, 2018, 4:32pm UTC](https://discuss.elastic.co/t/visualize-expected-numeric-type-on-field-some-field-but-got-string/142380/2 "2018-07-31T16:32:20Z")

</div>

> I also have other indices which have the same some\_field and there it's a string. Could it be the cause? If so, I would love to get an explanation why.

Do those indices match your kibana index pattern? If not, it shouldn't be a problem.

If you open the network tab of your browser's dev tools you should find an `_msearch` request when reloading the visualization. Looking at the request and response to/from elasticsearch might help us see what's going on.

---

<div class="post-metadata">

**Author:** ![Dee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dee/32/18876_2.png) [@Dee](https://discuss.elastic.co/u/Dee)\
**Post date:** [August 7, 2018, 9:17am UTC](https://discuss.elastic.co/t/visualize-expected-numeric-type-on-field-some-field-but-got-string/142380/3 "2018-08-07T09:17:42Z")

</div>

Hi @Bargs,  
I did as you suggested, the \_msearch query is searching the index that shows me these 2 fields as numbers when I look in Kibana settings \> Indices.  
When I look in elasticsearch at the mapping of my index I see they are strings.. how could it be?

Thanks

---

<div class="post-metadata">

**Author:** ![Bargs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bargs/32/5429_2.png) [@Bargs](https://discuss.elastic.co/u/Bargs)\
**Post date:** [August 7, 2018, 12:52pm UTC](https://discuss.elastic.co/t/visualize-expected-numeric-type-on-field-some-field-but-got-string/142380/4 "2018-08-07T12:52:14Z")

</div>

Which section are you looking at, "Index Management" or "Index Patterns"?

 ![50%20AM](https://us1.discourse-cdn.com/elastic/original/3X/2/d/2d8db894274e5d8613a9c2f9cb39d385786f486f.png)

---

<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:** [September 4, 2018, 12:52pm UTC](https://discuss.elastic.co/t/visualize-expected-numeric-type-on-field-some-field-but-got-string/142380/5 "2018-09-04T12:52:26Z")

</div>

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