# CSV Import

## Steps to upload new tables

1. Click on <mark style="color:blue;">**Upload CSV**</mark>, then <mark style="color:green;">**Upload New File**</mark>

<figure><img src="https://133649292-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIYMCWeQmo9kVg5C6SOyv%2Fuploads%2FljzDQ3ljaE5nQaJJolc6%2Fimage.png?alt=media&#x26;token=89a27c87-b3c4-45cd-b2d2-7b81a2833195" alt="" width="338"><figcaption></figcaption></figure>

{% hint style="warning" %}
Required format for CSV Upload:

* The table needs to contain at least one <mark style="color:blue;">**ID**</mark> column and one <mark style="color:blue;">**Date**</mark> column;
* ID column needs to contain **unique** values only;
* Column names need to be **unique** and contains **alphabet letters or numbers only** (Vietnamese letters are also applicable);
* Date format must be in <mark style="color:green;">**YYYY-MM-DD**</mark>.&#x20;

If you wish to create numerical metrics, you need to make sure that the columns are formatted with <mark style="color:blue;">**`Number.`**</mark> If there are **`Null`** or **`Blank`** cells in the metric columns, please fill them with number "0".
{% endhint %}

2. Indicate the ID column, then review the file and click <mark style="color:blue;">**Upload to Presight**</mark>.

<figure><img src="https://133649292-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIYMCWeQmo9kVg5C6SOyv%2Fuploads%2FVRZsY8llLHsEoTEem68W%2Fimage.png?alt=media&#x26;token=b82cb703-dc9c-48bb-9e56-2f5b07ddb78f" alt=""><figcaption></figcaption></figure>

3. After successfully uploading, you can view your new table and dimensions from the table at <mark style="color:blue;">**Data Hub**</mark>.
4. Join the **Date column** of your transactional tables to **Date column** of <mark style="color:blue;">**Presight's Dimdates table**</mark>. Then, you can start creating metrics.

{% hint style="info" %}
Instructions for joining with the <mark style="color:blue;">**Dimdates table**</mark>, creating metrics and editing dimensions in the documentations below:
{% endhint %}

{% content-ref url="dimensional-dates-dimdates-table" %}
[dimensional-dates-dimdates-table](dimensional-dates-dimdates-table)
{% endcontent-ref %}

{% content-ref url="broken-reference" %}
[Broken link](broken-reference)
{% endcontent-ref %}

{% content-ref url="../../../model/segments-and-custom-segments/create-a-new-dimension" %}
[create-a-new-dimension](../../../model/segments-and-custom-segments/create-a-new-dimension)
{% endcontent-ref %}

## Steps to update data for existing metrics with CSV Upload

1. Choose <mark style="color:green;">**Update Data for Existing Files**</mark> .&#x20;

<figure><img src="https://133649292-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIYMCWeQmo9kVg5C6SOyv%2Fuploads%2FW0GEl5a5uXDDrfonopiA%2Fimage.png?alt=media&#x26;token=50c4d7a3-423f-4669-a199-bd30f2c92b85" alt="" width="437"><figcaption></figcaption></figure>

2. _**Select the table you want to update**_ and upload the new file to update your existing table.&#x20;
3. At <mark style="color:blue;">**SELECT ID COLUMN**</mark>, choose the same ID column as the existing table, and Presight will notice how many additional new rows and new columns that this new file has.

<figure><img src="https://133649292-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIYMCWeQmo9kVg5C6SOyv%2Fuploads%2FC2OeeCBFKttoxoEBh1u2%2Fimage.png?alt=media&#x26;token=75e2e045-a465-4732-b4ef-8c153a453ec4" alt=""><figcaption><p>Notification for new updates</p></figcaption></figure>

{% hint style="warning" %}
Required format for Updating existing metrics:

* Existing ID column, Date Format, Column Name and Column Format in the new table need to be the same as in the existing table.
* If you need to add new columns in the existing table for updating, you need to add them next to existing columns.
{% endhint %}

{% hint style="danger" %}
<mark style="color:red;">**The new table will overwrite all contents of the existing table.**</mark>
{% endhint %}
