# How to Visualize a Metric. Difference Between Current Week and Last Week

**URL:** <https://discuss.elastic.co/t/how-to-visualize-a-metric-difference-between-current-week-and-last-week/235392>\
**Category:** Kibana\
**Created:** [June 2, 2020, 6:29pm UTC](https://discuss.elastic.co/t/how-to-visualize-a-metric-difference-between-current-week-and-last-week/235392 "2020-06-02T18:29:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Magnuss](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnuss/32/66169_2.png) [@Magnuss](https://discuss.elastic.co/u/Magnuss)\
**Post date:** [June 2, 2020, 6:29pm UTC](https://discuss.elastic.co/t/how-to-visualize-a-metric-difference-between-current-week-and-last-week/235392/1 "2020-06-02T18:29:56Z")

</div>

Hello All,

I'm currently trying to visualize some data. Everyday at 6 am my data will be ingested into Elasticsearch. The data contains information like product titles, stock, prices etc etc. So everyday a new document will be ingested of the same products everyday.

Now i would like to visualize for example a metric that show the difference in stock of the current week and last week. Also it would be nice to visualize the top 20 most decreased count of stock for products.

```auto
{
  "_index": "test",
  "_type": "_doc",
  "_id": "eLo4c3IASD2Fj5FOcYO7",
  "_version": 1,
  "_score": null,
  "_source": {
    "URL": "https://www.test.com/nl/p/manfrotto-1314b-zwart-tripod/9223418/",
    "Description": "Lorem ipsem, Lorem ipsem, ",
    "Product title": "Lorem ipsem, Lorem ipsem, Lorem ipsem",
    "Category": "Elektronica",
    "Rating": null,
    "@version": "1",
    "Stock": 10,
    "Price": "243.99",
    "@timestamp": "2020-06-02T04:09:38.339Z",
    "Sub Category": "Camera's & Accessoires>Studiofotografie>Achtergrondsystemen>Achtergronddoeken",
    "host": "localhost.localdomain",
    "Image": "https://someimage.com/RWyE0QGD3xE/550x461.jpg",
    "EAN Number": "9234234010081018"
  },
  "fields": {
    "@timestamp": [
      "2020-06-02T04:09:38.339Z"
    ]
  },
  "sort": [
    15932432478339
  ]
}

```

---

<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:** [June 3, 2020, 12:55pm UTC](https://discuss.elastic.co/t/how-to-visualize-a-metric-difference-between-current-week-and-last-week/235392/2 "2020-06-03T12:55:41Z")

</div>

You can use [TSVB](https://www.elastic.co/guide/en/kibana/current/TSVB.html) to compare metrics between time periods

---

<div class="post-metadata">

**Author:** ![Magnuss](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnuss/32/66169_2.png) [@Magnuss](https://discuss.elastic.co/u/Magnuss)\
**Post date:** [June 4, 2020, 11:40am UTC](https://discuss.elastic.co/t/how-to-visualize-a-metric-difference-between-current-week-and-last-week/235392/3 "2020-06-04T11:40:57Z")

</div>

Great, thanks. Is it also possible the visualise the difference between for example current week and last week?

---

<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:** [June 4, 2020, 12:34pm UTC](https://discuss.elastic.co/t/how-to-visualize-a-metric-difference-between-current-week-and-last-week/235392/4 "2020-06-04T12:34:05Z")

</div>

Yes. With TSVB, you can customize the offset to the require period.

---

<div class="post-metadata">

**Author:** ![Magnuss](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnuss/32/66169_2.png) [@Magnuss](https://discuss.elastic.co/u/Magnuss)\
**Post date:** [June 4, 2020, 12:48pm UTC](https://discuss.elastic.co/t/how-to-visualize-a-metric-difference-between-current-week-and-last-week/235392/5 "2020-06-04T12:48:11Z")

</div>

Thanks for helping it's really nice also like the new control feature.

---

<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 2, 2020, 12:50pm UTC](https://discuss.elastic.co/t/how-to-visualize-a-metric-difference-between-current-week-and-last-week/235392/6 "2020-07-02T12:50:32Z")

</div>

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