# Data Visualizer CSV Upload drops leading zeros

**URL:** <https://discuss.elastic.co/t/data-visualizer-csv-upload-drops-leading-zeros/354433>\
**Category:** Kibana\
**Created:** [February 29, 2024, 11:08am UTC](https://discuss.elastic.co/t/data-visualizer-csv-upload-drops-leading-zeros/354433 "2024-02-29T11:08:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dc\_3](https://avatars.discourse-cdn.com/v4/letter/d/76d3ee/32.png) [@dc\_3](https://discuss.elastic.co/u/dc_3)\
**Post date:** [February 29, 2024, 11:08am UTC](https://discuss.elastic.co/t/data-visualizer-csv-upload-drops-leading-zeros/354433/1 "2024-02-29T11:08:01Z")

</div>

Hi there,

I've got a CSV I'm trying to upload via the Data Visualizer for analysis, and one of the columns contains data that has leading zeros.

The CSV itself definitely contains the leading zeros, but somewhere between the file and the creating of an index and dataview from the CSV, those zeros fall off.

They're essential to the use case (postcodes). Have you got any tips or advice on how to get these leading zeros retained through the process?

Thank you!

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [February 29, 2024, 1:26pm UTC](https://discuss.elastic.co/t/data-visualizer-csv-upload-drops-leading-zeros/354433/2 "2024-02-29T13:26:36Z")

</div>

hi @dc_3

In Advanced  
Did you try setting the mapping to `keyword` instead of int or `long` in the AND you have to remove the convert...

 ![Screenshot 2024-02-29 at 2.27.06 PM](https://us1.discourse-cdn.com/elastic/original/3X/5/0/505248bef62d6041d08379b41678312ecaf450d2.png)

 ![Screenshot 2024-02-29 at 2.19.21 PM](https://us1.discourse-cdn.com/elastic/original/3X/7/c/7c31a8bfed8e55248c11d721a342a4414e0dac50.png)

 ![Screenshot 2024-02-29 at 2.19.30 PM](https://us1.discourse-cdn.com/elastic/original/3X/4/e/4ec2ad4a6f953156c288dad83531ec136aa37a6b.png)

 ![Screenshot 2024-02-29 at 2.23.23 PM](https://us1.discourse-cdn.com/elastic/original/3X/e/9/e9f067ecb177cc17055cd0ee86d8a33407a35152.png)

YAY

```auto
GET discuss-csv/_search

{
  "took": 0,
  "timed_out": false,
  "_shards": {
    "total": 1,
    "successful": 1,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": {
      "value": 1,
      "relation": "eq"
    },
    "max_score": 1,
    "hits": [
      {
        "_index": "discuss-csv",
        "_id": "HZUI9Y0BBi-RUJEf_mTY",
        "_score": 1,
        "_source": {
          "field1": "hello",
          "field2": "bye",
          "post_code": "0093567"
        }
      }
    ]
  }
}

```

---

<div class="post-metadata">

**Author:** ![dc\_3](https://avatars.discourse-cdn.com/v4/letter/d/76d3ee/32.png) [@dc\_3](https://discuss.elastic.co/u/dc_3)\
**Post date:** [February 29, 2024, 2:12pm UTC](https://discuss.elastic.co/t/data-visualizer-csv-upload-drops-leading-zeros/354433/3 "2024-02-29T14:12:17Z")

</div>

Brilliant. That worked. Removing the `convert` was the step I was unaware of. Thank you!

---

<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 28, 2024, 2:12pm UTC](https://discuss.elastic.co/t/data-visualizer-csv-upload-drops-leading-zeros/354433/4 "2024-03-28T14:12:56Z")

</div>

Closed on March 28, 2024, 2:12pm UTC

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