# Lens graph formula missing fit(carry) ability in a formula summing up multiple indexes with sparse data

**URL:** <https://discuss.elastic.co/t/lens-graph-formula-missing-fit-carry-ability-in-a-formula-summing-up-multiple-indexes-with-sparse-data/311192>\
**Category:** Kibana\
**Created:** [August 2, 2022, 9:22am UTC](https://discuss.elastic.co/t/lens-graph-formula-missing-fit-carry-ability-in-a-formula-summing-up-multiple-indexes-with-sparse-data/311192 "2022-08-02T09:22:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mark\_Duncan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_duncan/32/46467_2.png) [@Mark\_Duncan](https://discuss.elastic.co/u/Mark_Duncan)\
**Post date:** [August 2, 2022, 9:22am UTC](https://discuss.elastic.co/t/lens-graph-formula-missing-fit-carry-ability-in-a-formula-summing-up-multiple-indexes-with-sparse-data/311192/1 "2022-08-02T09:22:43Z")

</div>

In timelion, if I had 2 indexes of data:  
a with 1 data point every day at midnight  
b with 1 data point every hour

I could create a graph with hourly intervals, and then sum the 2 indexes together in a single line that would be the sum of the 2 values every hour over the course of a day - which would increment up every hour:

> .es(index=a,...).fit(carry).add(.es(index=b,...))

But, in the lens graph, if I wanted to create the same line with a fomula, the hourly increments would not show up in the line plotted until the next doc in b index occurs, i.e. the line would only increase in value every 24 hours despite a increasing in value every hour.

> cumulative\_sum(sum('field\_b', kql='\_index : "b"'))  
> +  
> last\_value(field\_a, kql='\_index : "a"')

This issue might well be the crux of it - [[Lens] Formula: provide fitting function for missing/null values · Issue #115761 · elastic/kibana · GitHub](https://github.com/elastic/kibana/issues/115761) - does anyone have a workaround in the interim? Running Kibana 7.15.2

Thanks in advance!

---

<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 30, 2022, 9:23am UTC](https://discuss.elastic.co/t/lens-graph-formula-missing-fit-carry-ability-in-a-formula-summing-up-multiple-indexes-with-sparse-data/311192/2 "2022-08-30T09:23:16Z")

</div>

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