# Best pratices to handle multiple value field separated in terms stats?

**URL:** <https://discuss.elastic.co/t/best-pratices-to-handle-multiple-value-field-separated-in-terms-stats/13633>\
**Category:** Elasticsearch\
**Created:** [September 17, 2013, 12:17am UTC](https://discuss.elastic.co/t/best-pratices-to-handle-multiple-value-field-separated-in-terms-stats/13633 "2013-09-17T00:17:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fabien\_Guiraud](https://avatars.discourse-cdn.com/v4/letter/f/57b2e6/32.png) [@Fabien\_Guiraud](https://discuss.elastic.co/u/Fabien_Guiraud)\
**Post date:** [September 17, 2013, 12:17am UTC](https://discuss.elastic.co/t/best-pratices-to-handle-multiple-value-field-separated-in-terms-stats/13633/1 "2013-09-17T00:17:02Z")

</div>

Hi every ElasticSearch Users,

What is the best pratices to handle with ElasticSearch query like that in  
SQL:  
SELECT SUM(col\_a), SUM(col\_b), SUM(col\_c), COUNT(col\_d), col\_e FROM table  
GROUP BY col\_e ORDER BY (col\_a OR col\_b OR col\_c OR col\_d)

It's a real problem for me because I use terms stats with one value per  
field, but I can't handle sorting like that...  
([http://elasticsearch-users.115913.n3.nabble.com/Aggregate-multiple-value-fields-separately-in-terms-stats-facet-td3150664.html](http://elasticsearch-users.115913.n3.nabble.com/Aggregate-multiple-value-fields-separately-in-terms-stats-facet-td3150664.html))

Please anyone help me ☹  
Thanks,

Fabien

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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 6, 2017, 2:16am UTC](https://discuss.elastic.co/t/best-pratices-to-handle-multiple-value-field-separated-in-terms-stats/13633/2 "2017-07-06T02:16:08Z")

</div>


