Data Visualizer CSV Upload drops leading zeros

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!

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...

YAY

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"
        }
      }
    ]
  }
}

1 Like

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

1 Like

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