# Timelion: secondary axis as yesterday total cusum?

**URL:** <https://discuss.elastic.co/t/timelion-secondary-axis-as-yesterday-total-cusum/196856>\
**Category:** Kibana\
**Created:** [August 27, 2019, 1:31am UTC](https://discuss.elastic.co/t/timelion-secondary-axis-as-yesterday-total-cusum/196856 "2019-08-27T01:31:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![joaociocca](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joaociocca/32/15827_2.png) [@joaociocca](https://discuss.elastic.co/u/joaociocca)\
**Post date:** [August 27, 2019, 1:31am UTC](https://discuss.elastic.co/t/timelion-secondary-axis-as-yesterday-total-cusum/196856/1 "2019-08-27T01:31:48Z")

</div>

So! Wild guess here: I've been trying to get it on my own, but I'm running out of ideas on how this could be achieved. The idea would be to have the main axis as points and the secondary as line, with it being the cumulative sum of yesterday - no matter the interval set for the chart.

I thought "interval" on .es() could make this work, something along the lines of `.es(q='*',interval='time:(from:now-1d%2Fd,mode:relative,to:now-1d%2Fd)').cusum()` maybe could work, just like the parameter on dashboard URL, but nothing shows up =(

I hate to use this word, but is it impossible to achieve this?

((edit)) maybe I could feed a .static() with the .max() of yesterday... I'd still need to find how to use that interval, maybe I'm doing it wrong? ((/edit))

---

<div class="post-metadata">

**Author:** ![Nathan\_Reese](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nathan_reese/32/84829_2.png) [@Nathan\_Reese](https://discuss.elastic.co/u/Nathan_Reese)\
**Post date:** [August 28, 2019, 10:21pm UTC](https://discuss.elastic.co/t/timelion-secondary-axis-as-yesterday-total-cusum/196856/2 "2019-08-28T22:21:43Z")

</div>

Using `interval` parameter in the `es` source is not recommend. Below is the help text for `interval`.

 ![27%20PM](https://us1.discourse-cdn.com/elastic/original/3X/2/9/29f04e55ebd112e63d27cb08bac2dee6e961f3ad.png)

You can use `offset` parameter to show yesterdays data.

```auto
.es(index=kibana_sample_data_logs*,timefield=@timestamp).bars()
,.es(index=kibana_sample_data_logs*,timefield=@timestamp,offset=-1d).bars().label('yesterday')

```

 ![05%20PM](https://us1.discourse-cdn.com/elastic/original/3X/b/1/b11954825fc0bd85ddfeb811d6d748f8d652699b.png)

---

<div class="post-metadata">

**Author:** ![joaociocca](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joaociocca/32/15827_2.png) [@joaociocca](https://discuss.elastic.co/u/joaociocca)\
**Post date:** [August 29, 2019, 1:51am UTC](https://discuss.elastic.co/t/timelion-secondary-axis-as-yesterday-total-cusum/196856/3 "2019-08-29T01:51:18Z")

</div>

Thanks Nathan! I saw that \*do not use\*, but I couldn't help myself to not try it.

I thought about using the offset option, but I'm not sure it would do exactly what I want... the idea would be to have a single line drawn, like the .static does, but showing the max cumulative sum of yesterday.

To take from your example... I'd want a way to do something like this:

```auto
.es(index=kibana_sample_data_logs*,timefield=@timestamp).bars()
,static(value=.es(index=kibana_sample_data_logs*,timefield=@timestamp,offset=-1d).max(cusum())).lines().label('yesterday')

```

Which, of course, I've tried but to no success. So the idea would be for my main chart to show the current running values, and the static line show what was yesterday's final total... does this makes sense?

---

<div class="post-metadata">

**Author:** ![Nathan\_Reese](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nathan_reese/32/84829_2.png) [@Nathan\_Reese](https://discuss.elastic.co/u/Nathan_Reese)\
**Post date:** [August 29, 2019, 1:29pm UTC](https://discuss.elastic.co/t/timelion-secondary-axis-as-yesterday-total-cusum/196856/4 "2019-08-29T13:29:24Z")

</div>

I don't think this is currently possible. You can open a feature request at [https://github.com/elastic/kibana/issues/new?template=Feature\_request.md](https://github.com/elastic/kibana/issues/new?template=Feature_request.md)

---

<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 26, 2019, 1:29pm UTC](https://discuss.elastic.co/t/timelion-secondary-axis-as-yesterday-total-cusum/196856/5 "2019-09-26T13:29:39Z")

</div>

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