# Timelion / Time Series - Limit result

**URL:** <https://discuss.elastic.co/t/timelion-time-series-limit-result/93041>\
**Category:** Kibana\
**Tags:** timelion\
**Created:** [July 13, 2017, 2:47pm UTC](https://discuss.elastic.co/t/timelion-time-series-limit-result/93041 "2017-07-13T14:47:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kornelia\_Watson](https://avatars.discourse-cdn.com/v4/letter/k/a5b964/32.png) [@Kornelia\_Watson](https://discuss.elastic.co/u/Kornelia_Watson)\
**Post date:** [July 13, 2017, 2:47pm UTC](https://discuss.elastic.co/t/timelion-time-series-limit-result/93041/1 "2017-07-13T14:47:04Z")

</div>

Hi.

I have two index patterns: pattern A which is time based, and pattern B, which is not.

Pattern A has an order type, which, as you can guess stores data related to customer orders (date, ID, shipping latency etc). Pattern B stores customer account data amongst which is a date when a specific event happened (they started using automation to process orders).

What I need to do is to create a timeline that shows an average shipping latency but also puts a mark of some sort on a date when a customer started using automation so that an impact of processing orders through it can be seen.

Because pattern B is not time based I don't think it is possible for me to plot it on the same visualisation. I might be wrong though?

Other approach I tried was to

1. plot average shipping latency
2. plot (minimum) order IDs of orders that were processed through the automation.

.es(index=pattern\_a-\*, q='\_type:order', metric=avg:shipping\_latency), .es(index=pattern\_b, q='\_type:order AND is\_processed\_by\_automation:true', metric=min:id)

That nearly does it but is there a way to limit the result of the second query so that I only plot 1 point?

Or is there a better way to achieve what I need?

Thank you

---

<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 13, 2017, 5:46pm UTC](https://discuss.elastic.co/t/timelion-time-series-limit-result/93041/2 "2017-07-13T17:46:32Z")

</div>

I might not fully understand the question, but you _can_ plot pattern A and B on the same Timelion visualization as long as pattern B has a date field, even if it is not selected at the time field for the pattern. The `.es()` function has a `timefield` argument which you can use to override the default timefield. So you could do something like:

```auto
.es(index=pattern_b, timefield=eventDate, q="eventName:automation-started")

```

Does that help? Or am I still missing a piece of the puzzle?

---

<div class="post-metadata">

**Author:** ![Kornelia\_Watson](https://avatars.discourse-cdn.com/v4/letter/k/a5b964/32.png) [@Kornelia\_Watson](https://discuss.elastic.co/u/Kornelia_Watson)\
**Post date:** [July 14, 2017, 7:12am UTC](https://discuss.elastic.co/t/timelion-time-series-limit-result/93041/3 "2017-07-14T07:12:04Z")

</div>

Excellent! That did exactly what I was looking for. Thank you so much for your help. 🙂

---

<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:** [August 11, 2017, 7:12am UTC](https://discuss.elastic.co/t/timelion-time-series-limit-result/93041/4 "2017-08-11T07:12:25Z")

</div>

Closed on August 11, 2017, 7:12am UTC

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