# Kibana - How to join the values of a field cross events based on userId and sessionIDinto 1 string by timestamp ascendly with script fields

**URL:** <https://discuss.elastic.co/t/kibana-how-to-join-the-values-of-a-field-cross-events-based-on-userid-and-sessionidinto-1-string-by-timestamp-ascendly-with-script-fields/177172>\
**Category:** Kibana\
**Created:** [April 17, 2019, 12:32am UTC](https://discuss.elastic.co/t/kibana-how-to-join-the-values-of-a-field-cross-events-based-on-userid-and-sessionidinto-1-string-by-timestamp-ascendly-with-script-fields/177172 "2019-04-17T00:32:47Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [April 17, 2019, 5:19am UTC](https://discuss.elastic.co/t/kibana-how-to-join-the-values-of-a-field-cross-events-based-on-userid-and-sessionidinto-1-string-by-timestamp-ascendly-with-script-fields/177172/2 "2019-04-17T05:19:11Z")

</div>

Scripted fields run in the context of a single document, not a collection of documents, so I do not think this can be done using scripted fields. For scenarios where ordering of multiple events is important [creating a separate entity-centric index](https://discuss.elastic.co/t/updating-a-field-in-a-doc-with-the-fields-been-obtained-from-another-dataset-basically-joins-like-feature/175080/4) might be the best approach.

---

_[View the full topic](https://discuss.elastic.co/t/kibana-how-to-join-the-values-of-a-field-cross-events-based-on-userid-and-sessionidinto-1-string-by-timestamp-ascendly-with-script-fields/177172)._
