# How to show "N/A" in a field has null value

**URL:** <https://discuss.elastic.co/t/how-to-show-n-a-in-a-field-has-null-value/293416>\
**Category:** Elasticsearch\
**Created:** [January 4, 2022, 8:12am UTC](https://discuss.elastic.co/t/how-to-show-n-a-in-a-field-has-null-value/293416 "2022-01-04T08:12:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![v.le](https://avatars.discourse-cdn.com/v4/letter/v/49beb7/32.png) [@v.le](https://discuss.elastic.co/u/v.le)\
**Post date:** [January 4, 2022, 8:12am UTC](https://discuss.elastic.co/t/how-to-show-n-a-in-a-field-has-null-value/293416/1 "2022-01-04T08:12:49Z")

</div>

Hi, I am new for Elasticsearch!  
I had imported my data content to Elasticsearch but I cant work out how to show the N/A value of the sales field. Here's the data :

```auto
country group brand PT date sales
Japan	Toyota Group	Toyota	EV	202110	129
Japan	Toyota Group	Toyota	EV	202111	N/A
Japan	Toyota Group	Toyota	EV	202112	-

```

I set the "sales" field type to "number". And the "N/A" value is automatically turn to "0". How can I show the "N/A" but still keeping the field type-"number".

Thank you so much and sorry for my broken English 😊 !!!

---

<div class="post-metadata">

**Author:** ![v.le](https://avatars.discourse-cdn.com/v4/letter/v/49beb7/32.png) [@v.le](https://discuss.elastic.co/u/v.le)\
**Post date:** [January 4, 2022, 8:22am UTC](https://discuss.elastic.co/t/how-to-show-n-a-in-a-field-has-null-value/293416/2 "2022-01-04T08:22:34Z")

</div>

I tried this in the dev tool

```auto
POST sales_finale/_update_by_query
{
  "query": {
    "bool": {
      "must_not": {
        "exists": {
          "field": "sales"
        }
      }
    }
  },
  "script": {
    "source": "ctx._source.put('sales', 'N/A');"
  }
}

```

but the error is

```auto
"failures" : [
    {
      "index" : "sales_finale",
      "type" : "_doc",
      "id" : "rM3GAX4BuGsV_tj3wH97",
      "cause" : {
        "type" : "mapper_parsing_exception",
        "reason" : "failed to parse field [sales] of type [long] in document with id 'rM3GAX4BuGsV_tj3wH97'. Preview of field's value: 'N/A'",
        "caused_by" : {
          "type" : "illegal_argument_exception",
          "reason" : "For input string: \"N/A\""
        }
      },
      "status" : 400
    },

```

---

<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 1, 2022, 8:23am UTC](https://discuss.elastic.co/t/how-to-show-n-a-in-a-field-has-null-value/293416/3 "2022-02-01T08:23:05Z")

</div>

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