> ## Documentation Index
> Fetch the complete documentation index at: https://docs.adriel.com/llms.txt
> Use this file to discover all available pages before exploring further.

# FAQs

> Common questions, expected behaviors, and troubleshooting for the CSV File data source.

## Why can I not change a column from text to a number after uploading?

Each column's type is inferred once, on the first upload, by sampling the file's rows. That decision is fixed for the lifetime of the data source. A column detected as text stays text even if every later upload contains numbers only, and an inferred type cannot be overridden manually.

For a column to become a numeric metric, its values must parse as numbers on that first upload. A few things force a column to text instead:

* Any mix of numeric and non-numeric values in the sampled rows.
* An ID-like column name (for example, one ending in `_id`, or named exactly `id`) — these are kept as text even when the values look numeric, so they group as breakdowns rather than aggregating.
* A column name containing `percent`, `pct`, or `%`, which is preserved as text to keep its formatting.

Values written with a leading currency symbol (such as `$100` or `₩5000`) are read as numbers, so a clean currency column is detected as numeric. The most reliable fix for an already-created data source is to correct the source file and load it as the first file of a new CSV File data source.

## Why was my second file rejected when the first uploaded fine?

The first upload establishes the column set, and under the default Append method (and under Upsert) every later file must match it. Incoming headers are compared against the stored columns as an unordered set, after connector-internal columns are excluded, so column order does not matter but the column names and count must line up. A file that adds a column, drops one, or renames a header is rejected with `INVALID_CSV_WRONG_COLUMNS`.

Replace is the exception: it discards the existing table and rebuilds it on each upload, so it does not enforce header matching. To load a differently-shaped dataset alongside the original, create a separate CSV File data source.

## Why was my file rejected at upload?

Files are validated before any data is stored, and a file that fails validation is rejected as a whole. The common reasons:

* **Wrong extension.** Only `.csv` is accepted. XLSX, TSV, JSON, and other formats are rejected before parsing.
* **No data rows.** A header row is required, plus at least one data row; a header-only file is rejected with `INVALID_CSV_MISSING_DATA`.
* **Empty cells** in the header or the first data row also raise `INVALID_CSV_MISSING_DATA`.
* **Duplicate column names** in the header are rejected with `INVALID_CSV_DUPLICATE_COLUMN_NAME`.
* **Mismatched columns** against an existing data source, as described above.

Reserved names (`file_id`, `filename`, `created_at`, `updated_at`, `channel`, `id`) are not rejected — they are automatically renamed with a `csv_` prefix, so a column named `id` appears as `csv_id`. Very long column names are truncated to fit the database limit; if two names collide after truncation, the file is rejected so the collision can be resolved in the source.

## How do I control whether new uploads add to, update, or replace existing rows?

The behavior of additional uploads is set by the update method chosen when the data source is created:

* **Append** (default) adds every file's rows to the same table and tags each row with its source file, so repeated uploads accumulate.
* **Upsert** merges rows on a declared unique-key column, so re-uploading a row updates the matching record instead of creating a duplicate. A unique key must be specified at setup; a data source set to Upsert without one cannot be created.
* **Replace** atomically swaps the entire table contents on each upload, so only the latest file's rows remain.

The method is selected during connection setup — see [How to connect CSV File to Adriel](/data-sources/a-f/csv-files/how-to-connect).

## How do I combine a CSV data source with another connector?

CSV data is viewed in a generic table and does not combine natively with other connector types unless they share the same breakdowns. To report CSV data alongside a platform-native connector, use the Blend Data settings to join them on a shared breakdown, such as a common date or campaign column present in both sources.

## Common issues

<AccordionGroup>
  <Accordion title="Why does a CSV column aggregate to 0, blank, or NaN?">
    When a CSV is uploaded, Adriel infers each column's type from the first 10 rows.

    * A column whose first 10 rows are numeric is typed as a number. Later text values in the same column are stored as NaN and cannot aggregate.
    * Nulls in a numeric column can push the column to be typed as text, so sums return 0.
    * Numbers with comma thousand-separators (`1,234`) cannot be cast to number and are stored as strings. The source file has to remove the commas.

    Columns must have a consistent data type across all rows. The column type can also be corrected manually on the data source as a workaround.
  </Accordion>

  <Accordion title="Why is CSV data missing from the beginning of the file or ordered incorrectly by date?">
    Two settings to check on the CSV data source:

    * **Data start column** skips every column to the left of the configured letter. Set to `D`, only column D onward is cached. Lower the setting to include earlier columns.
    * **Date format** must match how the source file writes dates (for example, `MM/DD/YYYY` versus `YYYY/MM/DD`). If the mapping is wrong, dates parse incorrectly and rows appear missing.
  </Accordion>
</AccordionGroup>

## Related

<CardGroup cols={2}>
  <Card title="CSV File data reference" href="/data-sources/a-f/csv-files/data-reference">
    Import model, field type mapping, and limits for the CSV File data source.
  </Card>

  <Card title="How to connect CSV File" href="/data-sources/a-f/csv-files/how-to-connect">
    Upload a file and choose the update method during setup.
  </Card>

  <Card title="Custom URL Import data reference" href="/data-sources/a-f/custom-url-import/data-reference">
    Fetch CSVs from a URL on a scheduled refresh instead of manual upload.
  </Card>

  <Card title="File from SFTP data reference" href="/data-sources/a-f/file-from-sftp/data-reference">
    Pull files from an SFTP server on a schedule.
  </Card>
</CardGroup>
