# Can you set partition field and count by as the same field?

**URL:** <https://discuss.elastic.co/t/can-you-set-partition-field-and-count-by-as-the-same-field/316244>\
**Category:** Kibana\
**Tags:** elastic-stack-machine-learning\
**Created:** [October 10, 2022, 3:54pm UTC](https://discuss.elastic.co/t/can-you-set-partition-field-and-count-by-as-the-same-field/316244 "2022-10-10T15:54:24Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![richcollier](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/richcollier/32/115035_2.png) [@richcollier](https://discuss.elastic.co/u/richcollier)\
**Post date:** [October 20, 2022, 2:27am UTC](https://discuss.elastic.co/t/can-you-set-partition-field-and-count-by-as-the-same-field/316244/2 "2022-10-20T02:27:57Z")

</div>

hi!

there is no `count by` field in the [ML jobs](https://www.elastic.co/guide/en/elasticsearch/reference/8.4/ml-put-job.html).

I assume you mean `by_field_name ` which is a way to split the analysis (like a "for each"). It is similar to `partition_field_name` but has [subtle differences](https://discuss.elastic.co/t/ml-what-is-the-difference-between-by-field-name-and-partition-field-name/108720/2).

sounds like all you need is a `count` function and define a `partition_field_name` and that's all!

---

_[View the full topic](https://discuss.elastic.co/t/can-you-set-partition-field-and-count-by-as-the-same-field/316244)._
