# Can i config default value with Metic in Timelion?

**URL:** <https://discuss.elastic.co/t/can-i-config-default-value-with-metic-in-timelion/165930>\
**Category:** Kibana\
**Tags:** timelion\
**Created:** [January 28, 2019, 4:38am UTC](https://discuss.elastic.co/t/can-i-config-default-value-with-metic-in-timelion/165930 "2019-01-28T04:38:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![teemoGod](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/teemogod/32/40817_2.png) [@teemoGod](https://discuss.elastic.co/u/teemoGod)\
**Post date:** [January 28, 2019, 4:38am UTC](https://discuss.elastic.co/t/can-i-config-default-value-with-metic-in-timelion/165930/1 "2019-01-28T04:38:10Z")

</div>

Hi. i'm using Timelion in Kibana 6.4.1

im using 'metric:avg'.

if documents doesn't exist at a certain time, Timelion doesn't show at that time.

i want to show all of value about each interval time including that doesn't exist documents at a certain time.

can i config '0' as default Y-Axis value?

---

<div class="post-metadata">

**Author:** ![Larry\_Gregory](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/larry_gregory/32/34969_2.png) [@Larry\_Gregory](https://discuss.elastic.co/u/Larry_Gregory)\
**Post date:** [January 28, 2019, 1:56pm UTC](https://discuss.elastic.co/t/can-i-config-default-value-with-metic-in-timelion/165930/2 "2019-01-28T13:56:17Z")

</div>

A config of '0' isn't strictly possible, but you can use the `fit` function to have Timelion interpolate missing data points:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/d/a/dab40b33c2f5df12e586f782dfb3ea839035610a.png)

I was able to get what you want by essentially running the expression twice, but that will not be very performant. The second time is within an `if` function call that translates anything that isn't greater than 0 to 0:

```auto
.es(index='hass-events-*', timefield='@timestamp', metric='avg:attributes.battery').if(operator='gt', if=0, then=.es(index='hass-events-*', timefield='@timestamp', metric='avg:attributes.battery'), else=0)

```

---

<div class="post-metadata">

**Author:** ![teemoGod](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/teemogod/32/40817_2.png) [@teemoGod](https://discuss.elastic.co/u/teemoGod)\
**Post date:** [January 29, 2019, 1:01am UTC](https://discuss.elastic.co/t/can-i-config-default-value-with-metic-in-timelion/165930/3 "2019-01-29T01:01:34Z")

</div>

thx for your response 😄

i will try this.

by the way, can i using this feature in Visual Builder??

Timelion and Visual Builder is look similar and both are good visualize.

but Visual Builder look good a little for me

i cant find similar property like 'fit' or 'if' in Visual Builder

---

<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 26, 2019, 1:01am UTC](https://discuss.elastic.co/t/can-i-config-default-value-with-metic-in-timelion/165930/4 "2019-02-26T01:01:36Z")

</div>

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