# Problem In last\_value

**URL:** https://discuss.elastic.co/t/problem-in-last-value/362755
**Category:** Elasticsearch
**Created:** [July 9, 2024, 3:39am UTC](https://discuss.elastic.co/t/problem-in-last-value/362755 "2024-07-09T03:39:19Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![nway.onm](https://avatars.discourse-cdn.com/v4/letter/n/ce73a5/32.png) [@nway.onm](https://discuss.elastic.co/u/nway.onm)
#### Post date: [July 9, 2024, 3:39am UTC](https://discuss.elastic.co/t/problem-in-last-value/362755/1 "2024-07-09T03:39:19Z")

</div>

i have some math function using lens formula, and when i use last\_value function when it's doesn't match my filter i want some default value like 0.

but now it's return nothing and all the result for my formula become - .

For example

```auto
 last_value(tran.target_volume, kql='shop.sale_office: "Office 1" ') + 
last_value(tran.target_volume, kql='shop.sale_office: "Office 2"') 

```

for Office2 there are no data for sales , and return null and my result become " - ".
