# What is the best way to plot difference of particular field value at last monday and last to last monday in timelion?

**URL:** <https://discuss.elastic.co/t/what-is-the-best-way-to-plot-difference-of-particular-field-value-at-last-monday-and-last-to-last-monday-in-timelion/201338>\
**Category:** Kibana\
**Tags:** timelion\
**Created:** [September 27, 2019, 5:54am UTC](https://discuss.elastic.co/t/what-is-the-best-way-to-plot-difference-of-particular-field-value-at-last-monday-and-last-to-last-monday-in-timelion/201338 "2019-09-27T05:54:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Saurabh\_Sharma\_IIT](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/saurabh_sharma_iit/32/48921_2.png) [@Saurabh\_Sharma\_IIT](https://discuss.elastic.co/u/Saurabh_Sharma_IIT)\
**Post date:** [September 27, 2019, 5:54am UTC](https://discuss.elastic.co/t/what-is-the-best-way-to-plot-difference-of-particular-field-value-at-last-monday-and-last-to-last-monday-in-timelion/201338/1 "2019-09-27T05:54:07Z")

</div>

Hi, I want to plot eg. on timelion or any other graph difference in values of particular field at interval of a week eg. let I have field count and I am getting data on daily basis, let there be another field name let's say three name are there X, Y Z each having value of count for each day.  
Now I want to plot difference in value of count for each time for most recent monday which has passed and last to last most recent monday i.e. last week Monday to monday.

I found that offset can be given in timelion and that can be used if I want from today - 7 days this will be difference for pas 7 days, but I want for recent week which has passed i.e. fix either Sat to Sat or Sat to Monday like that.

Thanks

---

<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:** [September 27, 2019, 2:02pm UTC](https://discuss.elastic.co/t/what-is-the-best-way-to-plot-difference-of-particular-field-value-at-last-monday-and-last-to-last-monday-in-timelion/201338/2 "2019-09-27T14:02:41Z")

</div>

You can use the `subtract` function to view the differences between timeperiods

```auto
.es(index=kibana_sample_data_logs).subtract(.es(index=kibana_sample_data_logs,offset=-7d))

```

---

<div class="post-metadata">

**Author:** ![Saurabh\_Sharma\_IIT](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/saurabh_sharma_iit/32/48921_2.png) [@Saurabh\_Sharma\_IIT](https://discuss.elastic.co/u/Saurabh_Sharma_IIT)\
**Post date:** [October 8, 2019, 10:05am UTC](https://discuss.elastic.co/t/what-is-the-best-way-to-plot-difference-of-particular-field-value-at-last-monday-and-last-to-last-monday-in-timelion/201338/3 "2019-10-08T10:05:06Z")

</div>

Hi @Nathan_Reese thank you for your response, I have already tried it. Actually this correctly gives the difference but what was looking is not any difference but specific last Monday data to last to last Monday data. The final graph will not have time on x axis but different field and y axis will have corresponding last Mon value -last to last Mon value.  
Please do suggest what can be a good way to do the same.  
Thank you  
Saurabh

---

<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:** [November 5, 2019, 10:05am UTC](https://discuss.elastic.co/t/what-is-the-best-way-to-plot-difference-of-particular-field-value-at-last-monday-and-last-to-last-monday-in-timelion/201338/4 "2019-11-05T10:05:08Z")

</div>

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