# Timelion Expression is not supporting .offset function

**URL:** <https://discuss.elastic.co/t/timelion-expression-is-not-supporting-offset-function/336619>\
**Category:** Kibana\
**Created:** [June 21, 2023, 7:15pm UTC](https://discuss.elastic.co/t/timelion-expression-is-not-supporting-offset-function/336619 "2023-06-21T19:15:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kumar\_Abhinav](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kumar_abhinav/32/122208_2.png) [@Kumar\_Abhinav](https://discuss.elastic.co/u/Kumar_Abhinav)\
**Post date:** [June 21, 2023, 7:15pm UTC](https://discuss.elastic.co/t/timelion-expression-is-not-supporting-offset-function/336619/1 "2023-06-21T19:15:59Z")

</div>

I am trying to visualize the counts of one field for this month and compare it with the count for the next month. I am using the time lion expression with .offset -1m but the same is not working. It gives me an error. My expression is like this. .es(offset=-1y, index=notifications\_100, timefield='createDate', metric='count:docId').label('count of doc in the last year)  
.es(index=notifications\_100, timefield='createDate', metric='count:docId').label('count of doc in the current year) and the error is this. - [timelion\_vis] \> Timelion request error: {"type":"incompleteFunction","function":"label","location":{"min":86,"max":92},"text":".label"}. Please help me with this.

---

<div class="post-metadata">

**Author:** ![Kumar\_Abhinav](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kumar_abhinav/32/122208_2.png) [@Kumar\_Abhinav](https://discuss.elastic.co/u/Kumar_Abhinav)\
**Post date:** [June 21, 2023, 9:18pm UTC](https://discuss.elastic.co/t/timelion-expression-is-not-supporting-offset-function/336619/2 "2023-06-21T21:18:13Z")

</div>

I am trying to visualize the counts of one field for this month and compare it with the count for the next month. I am using the time lion expression with .offset -1m but the same is not working. It gives me an error. My expression is like this.

.es(offset=-1m, index=notifications\_100, timefield='createDate', metric='count:docId').label('count of doc in the last year)  
.es(index=notifications\_100, timefield='createDate', metric='count:docId')  
.label('count of doc in the current year)

and the error is this.

- [timelion\_vis] \> Timelion request error: {"type":"incompleteFunction","function":"label","location":{"min":86,"max":92},"text":".label"}.

Please help me with this.

---

<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:** [July 19, 2023, 9:18pm UTC](https://discuss.elastic.co/t/timelion-expression-is-not-supporting-offset-function/336619/3 "2023-07-19T21:18:49Z")

</div>

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