# Vega: Set a text for empty data set

**URL:** https://discuss.elastic.co/t/vega-set-a-text-for-empty-data-set/325099
**Category:** Kibana
**Tags:** vega
**Created:** [February 9, 2023, 7:09am UTC](https://discuss.elastic.co/t/vega-set-a-text-for-empty-data-set/325099 "2023-02-09T07:09:29Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Irwan\_Kurniawan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/irwan_kurniawan/32/101755_2.png) [@Irwan\_Kurniawan](https://discuss.elastic.co/u/Irwan_Kurniawan)
#### Post date: [February 9, 2023, 7:09am UTC](https://discuss.elastic.co/t/vega-set-a-text-for-empty-data-set/325099/1 "2023-02-09T07:09:29Z")

</div>

Actually my condition same with this thread but when I try, it doesn't work for me.

> [@Vega: Handle a situation where data-set returned is empty](https://discuss.elastic.co/t/vega-handle-a-situation-where-data-set-returned-is-empty/262210):
>
> When querying for data, there are situations where the returned data-set is empty for certain time ranges. Such a situation occurred in Vega (returned an empty array) and I tried to create a condition using expressions to check if the data-set is empty but it doesn't seem to work. length(data('table')) == 0 ? '-' : datum.sum Adding the above test condition in a formula transform says Undefined data set name: "table". Nothing seems to change when it is used inside a mark as a signal for a field.…

I did the filter transform and when there's no rows that shown after the transform, I want to make a static text to inform that.

---

<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: [March 9, 2023, 7:09am UTC](https://discuss.elastic.co/t/vega-set-a-text-for-empty-data-set/325099/2 "2023-03-09T07:09:51Z")

</div>

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