# Import and Export Forecast

Moselle allows you to export your forecast data, make modifications externally, and re-upload it to update your projections. This is useful for bulk editing forecasts outside of the application or integrating data from external planning tools.

## Exporting a Forecast

To export your forecast:

1. Navigate to the **Forecasting** tab and select your scenario plan
2. Click on the **Gear Icon** next to the Done Planning button
3. Select **Export and Download**
4. A CSV file will be sent to your email

The exported file contains all items across your channels with projection data for each month in your forecast timeframe.

<figure><img src="/files/jg7nMaygMqB5Yz4Jpq0X" alt="" width="335"><figcaption></figcaption></figure>

## Understanding the Export Template

The exported CSV file contains the following columns:

| Column           | Description                                            |
| ---------------- | ------------------------------------------------------ |
| `channelId`      | The unique identifier for the sales channel            |
| `itemId`         | The unique identifier for the product/item             |
| `scenarioPlanId` | The unique identifier for the forecast scenario        |
| Date columns     | Monthly projection values (e.g., `2024-01`, `2024-02`) |

## Importing a Forecast

To upload your modified forecast:

1. Navigate to the **Forecasting** tab and select your scenario plan
2. Click on the **Gear Icon** next to the Done Planning button
3. Select **Upload & Replace**
4. Drag and drop your file or click to browse
5. Click **Upload** to process the file

<figure><img src="/files/GB3KT7IWGgUX1UsCD8Kj" alt="" width="261"><figcaption></figcaption></figure>

{% hint style="info" %}
You will receive a notification once your forecast upload has been processed, confirming whether it was successful or if there were any errors.
{% endhint %}

## File Format Requirements

### Supported File Types

* **CSV** (.csv)
* **Excel** (.xlsx)

### Required Columns

The following columns are **required** and must not be removed from the file:

| Column           | Required | Notes                                             |
| ---------------- | -------- | ------------------------------------------------- |
| `channelId`      | Yes      | Must match an existing channel in your account    |
| `itemId`         | Yes      | Must match an existing item in your catalog       |
| `scenarioPlanId` | Yes      | Must match the scenario plan you are uploading to |

{% hint style="danger" %}
Removing any of the required columns (`channelId`, `itemId`, or `scenarioPlanId`) will cause the import to fail.
{% endhint %}

### Date Column Formats

Date columns represent the monthly projection periods. The following date formats are supported:

| Format       | Example      |
| ------------ | ------------ |
| `YYYY-MM`    | `2024-01`    |
| `YYYY-M`     | `2024-1`     |
| `MM-YYYY`    | `01-2024`    |
| `MM/D/YYYY`  | `01/1/2024`  |
| `M/D/YYYY`   | `1/1/2024`   |
| `YYYY-MM-DD` | `2024-01-01` |

{% hint style="warning" %}
All dates are processed as the beginning of the month regardless of the day specified. For example, `2024-01-15` will be treated as `2024-01-01`.
{% endhint %}

{% hint style="warning" %}
Date columns **must be in chronological order** (e.g., `2024-01`, `2024-02`, `2024-03`). Uploading out-of-order dates will result in an error.
{% endhint %}

### Adding or Removing Date Columns

You can modify the date columns in your template:

* **Add new months** by adding columns with properly formatted date headers
* **Remove months** by deleting the corresponding date columns
* **Dates must use one of the supported formats** listed above

## Modifying Rows

### Removing Rows

You can delete any number of rows from the template to limit your upload to specific item and channel combinations. This is useful when you only want to update projections for a subset of your catalog.

{% hint style="info" %}
Rows that are removed from the upload file will retain their existing projections in Moselle. Only rows included in the upload will be updated.
{% endhint %}

### Empty Rows

Empty rows (where all values are blank) are automatically ignored during processing.

### Skipping Specific Items

If a row is missing both `itemId` and `channelId` and `scenarioPlanId`, that row will be skipped during processing.

## Projection Values

### Numeric Format

* Projection values should be numeric
* Commas in numbers are automatically removed (e.g., `1,000` becomes `1000`)
* Values are stored with decimal precision

### Empty Values

If a date column cell is left blank for a row, no projection will be created or updated for that item/channel/month combination.

## Validation Rules

The import process validates the following:

| Validation              | Behavior                                                                                                                                                             |
| ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Channel exists          | Rows with invalid `channelId` values are skipped                                                                                                                     |
| Item exists             | Items must exist in your catalog                                                                                                                                     |
| Scenario plan exists    | Must be an active (non-archived) scenario plan                                                                                                                       |
| Scenario plan ownership | Must belong to your company                                                                                                                                          |
| Valid dates             | The file must contain at least one valid date column formatted as `YYYY-MM` or `MM/DD/YYYY`                                                                          |
| Chronological order     | Date columns must be in chronological order                                                                                                                          |
| Unrecognized columns    | The file cannot contain any columns that are not recognized system headers (`channelId`, `channel`, `itemId`, `sku`, `name`, `scenarioPlanId`) or valid date headers |

{% hint style="warning" %}
When exporting and uploading a forecast, you must use the template from the same scenario plan you intend to upload to. Each exported forecast contains specific scenario IDs tied to that forecast.
{% endhint %}

## Best Practices

1. **Always start with an export** - Use the exported file as your template to ensure all IDs are correct
2. **Keep required columns intact** - Never remove `channelId`, `itemId`, or `scenarioPlanId`
3. **Use consistent date formats** - Stick to one date format throughout your file
4. **Validate before uploading** - Check that your file opens correctly and data appears as expected
5. **Upload to the correct scenario** - Ensure you're uploading to the same scenario plan you exported from

## Troubleshooting

| Issue                       | Solution                                                                                  |
| --------------------------- | ----------------------------------------------------------------------------------------- |
| Import fails immediately    | Verify all required columns are present                                                   |
| Some rows not imported      | Check that `channelId` and `itemId` match existing records                                |
| Date columns not recognized | Ensure date format matches one of the supported formats (e.g., `YYYY-MM` or `MM/DD/YYYY`) |
| Dates out of order          | Ensure all date columns are arranged chronologically                                      |
| Unrecognized columns        | Remove any extra columns that aren't system headers or valid dates                        |
| Notification shows error    | Review the file format and try re-exporting a fresh template                              |

## Exporting with Financials (Amount Mode)

For advanced financial planning, you can export a detailed financial breakdown of your forecast. This report is generated when you export while viewing your forecast in **Amount** mode.

### How to Generate

1. Navigate to your **Scenario Plan**.
2. Locate the toggle in the header and switch from **Quantity** to **Amount**.
3. Click the **Gear Icon** and select **Export and Download**.

### Report Structure

The CSV file is organized into three distinct sections, repeating the date columns for each financial metric:

| Section                         | Description                                                  | Data Source                                                                        |
| ------------------------------- | ------------------------------------------------------------ | ---------------------------------------------------------------------------------- |
| **ASP** (Average Selling Price) | Projected revenue based on historical average selling price. | Calculated from your historical sales data (`Analytics::AverageMonthlyItemPrice`). |
| **MSRP** (Retail Value)         | Projected revenue based on the item's current list price.    | Pulls directly from the `Unit Price` field in your item catalog.                   |
| **COGS** (Cost of Goods Sold)   | Projected inventory cost.                                    | Pulls directly from the `Unit Cost` field in your item catalog.                    |

### Column Layout

The export follows this sequence:

1. **Item Details:** Channel, SKU, Name
2. **ASP Section:** Monthly columns showing `Forecast Units * ASP`
3. **Separator:** Blank column
4. **MSRP Section:** Monthly columns showing `Forecast Units * Unit Price`
5. **Separator:** Blank column
6. **COGS Section:** Monthly columns showing `Forecast Units * Unit Cost`

{% hint style="info" %}
**Currency Note:** ASP values are automatically converted to your company's operating currency if the sales channel uses a different currency.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://learn.moselle.io/planning-and-execution/forecasting/import-and-export-forecast.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
