# Dutation field type - days to weeks error

**URL:** https://discuss.elastic.co/t/dutation-field-type-days-to-weeks-error/320996
**Category:** Kibana
**Created:** [December 12, 2022, 5:48am UTC](https://discuss.elastic.co/t/dutation-field-type-days-to-weeks-error/320996 "2022-12-12T05:48:42Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Matt.Wash](https://avatars.discourse-cdn.com/v4/letter/m/3ec8ea/32.png) [@Matt.Wash](https://discuss.elastic.co/u/Matt.Wash)
#### Post date: [December 12, 2022, 5:48am UTC](https://discuss.elastic.co/t/dutation-field-type-days-to-weeks-error/320996/1 "2022-12-12T05:48:42Z")

</div>

using a horizontal lens vis and a duration metric to human readable duration metrics, there appears to be a conversion miscalculation between days to weeks.

the attached except shows the x axis increasing by 2.3 days until it get to 6.9 days and then itincreases to 2.3 weeks.

Please can someone explain why this is happening?

 ![1](https://us1.discourse-cdn.com/elastic/original/3X/0/5/05d6de4d733d4b389b5d01e5f279d0cdd75992cf.png)

---

<div class="post-metadata">

### Author: ![dadiasish](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadiasish/32/114221_2.png) [@dadiasish](https://discuss.elastic.co/u/dadiasish)
#### Post date: [December 12, 2022, 6:08am UTC](https://discuss.elastic.co/t/dutation-field-type-days-to-weeks-error/320996/2 "2022-12-12T06:08:14Z")

</div>

I guess, when you go into advanced settings on the horizontal axis, you'll find the time shift, which might be left to empty/auto.

If you set it to 1d, 1w as such, depending on your requirement, it will divide the X-Axis on weekly or daily wise.

Try and let me know if that works if that fixes this scenario.

---

<div class="post-metadata">

### Author: ![Matt.Wash](https://avatars.discourse-cdn.com/v4/letter/m/3ec8ea/32.png) [@Matt.Wash](https://discuss.elastic.co/u/Matt.Wash)
#### Post date: [December 12, 2022, 6:54am UTC](https://discuss.elastic.co/t/dutation-field-type-days-to-weeks-error/320996/3 "2022-12-12T06:54:59Z")

</div>

hi,

I thought timeshift, allowed you to look at your current time period i.e. 90days in my case and shifted back 90days from the period you select in the time shift. i.e. 1 week, would look at -7days to -97days. I dont think this is the problem here. the issue is when moving from days to weeks. Thanks for your help though.

Matt

---

<div class="post-metadata">

### Author: ![Marco\_Liberati](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_liberati/32/82953_2.png) [@Marco\_Liberati](https://discuss.elastic.co/u/Marco_Liberati)
#### Post date: [December 12, 2022, 10:54am UTC](https://discuss.elastic.co/t/dutation-field-type-days-to-weeks-error/320996/4 "2022-12-12T10:54:43Z")

</div>

Hi @Matt.Wash

I assume you have selected a field with a `Duration` format assigned.  
The problem you have is the result of multiple approximations stacked, which leads to those rounded values in the X axis.

A possible solution for that can be to tweak the field format to use a `humanized (precise)` format rather than the `(approximated)` one:

 ![Screenshot 2022-12-12 at 11.49.36](https://us1.discourse-cdn.com/elastic/original/3X/c/1/c12e9340efe130977a5a8b58f16b6b74765eb8c7.png)

Ticks will be less "nice" but, at least, rounding should not be that misleading.

---

<div class="post-metadata">

### Author: ![Matt.Wash](https://avatars.discourse-cdn.com/v4/letter/m/3ec8ea/32.png) [@Matt.Wash](https://discuss.elastic.co/u/Matt.Wash)
#### Post date: [December 12, 2022, 9:11pm UTC](https://discuss.elastic.co/t/dutation-field-type-days-to-weeks-error/320996/5 "2022-12-12T21:11:15Z")

</div>

thanks Marco. I am using human-readable precise. I have used 1 and 2 decimal places.

hmmm...

---

<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: [January 9, 2023, 6:34pm UTC](https://discuss.elastic.co/t/dutation-field-type-days-to-weeks-error/320996/6 "2023-01-09T18:34:58Z")

</div>



---

<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: [February 6, 2023, 6:35pm UTC](https://discuss.elastic.co/t/dutation-field-type-days-to-weeks-error/320996/7 "2023-02-06T18:35:52Z")

</div>

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