Was this page helpful?
Yes No

Create a schema.ini File

Sometimes when you attempt to import custom geographic information in Tableau using a .csv file, you may see a ".csv could not be used because it does not contain a unique column" error message.

This is because your .csv file might contain numerical data, such as numeric postcodes. Tableau will only accept text fields for new geographic roles. However, you can create a schema.ini file to tell Tableau that the numeric field you want to import should be treated as a text field.

A schema.ini file is a Microsoft configuration file associated with the Microsoft JET engine. It tells JET how to interpret the contents of text files, including data structure, date formats, and other settings. For example, creating a schema.ini file that specifies that the numeric postcodes in your import file should be treated as text will allow you to plot the postcodes on a map.

To create a schema.ini file

  1. Open a text file.

  2. In the text file, using the following syntax, specify the names and data types for each column in your import file:

  3. [YOURCSVFILENAME.csv]
    ColNameHeader=True
    Format=CSVDelimited
    Col1="Name of 1st Column Header in your .csv file" Dataype
    Col2="Name of 2nd Column Header in your .csv file" Dataype
    Col3="Name of 3rd Column Header in your .csv file" Dataype
    Col4="Name of 4th Column Header in your .csv file" Dataype

    For example, if your import (.csv) file contained the columns German Post Code, Latitude, and Longitude, and was named German Postal Codes.csv, your schema.ini file would look like the following:

    [German Postal Codes.csv]
    ColNameHeader=True
    Format=CSVDelimited
    Col1="German Post Code" Text
    Col2="Latitude" Double
    Col3="Longitude" Double

  4. Save the file as schema.ini in the same folder as your.csv file.

You're now ready to import your .csv and schema.ini files into Tableau.

See also

Geocode Locations Tableau Does Not Recognize and Plot Them on a Map