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

# Compare Schedule with Baselines

> Display a visual overlay comparing the current Nextedy GANTT schedule against a historical snapshot, helping you identify schedule drift and newly added tasks.

export const LastReviewed = ({date}) => {
  if (!date) return null;
  const formatted = new Date(`${date}T00:00:00Z`).toLocaleDateString("en-US", {
    year: "numeric",
    month: "long",
    day: "numeric",
    timeZone: "UTC"
  });
  return <p className="mt-10 text-sm text-gray-400 dark:text-zinc-500 not-prose">
      Last reviewed on {formatted}
    </p>;
};

## Option 1: One-Time Comparison from the Toolbar

Use the toolbar Compare button for an ad-hoc comparison against any historical point in time.

1. Open your Gantt chart page in Polarion.
2. Click the **Compare** button in the Gantt toolbar.
3. In the comparison dialog, select one of three modes:

| Mode         | What You Enter                              | When to Use                                       |
| ------------ | ------------------------------------------- | ------------------------------------------------- |
| **Date**     | A specific calendar date                    | Compare against a known date (e.g., sprint start) |
| **Baseline** | A named Polarion baseline from the dropdown | Compare against a formal project baseline         |
| **Revision** | A Polarion SVN revision number              | Compare against a specific repository revision    |

4. Click **Compare**. The Gantt reloads and displays baseline bars behind each task bar, showing where tasks were scheduled at the selected point in time.

<Warning title="Save Before Comparing">
  The Compare dialog does not open if you have unsaved changes. Save your work first, then initiate the comparison.
</Warning>

Since version **25.3.0**, the comparison dialog supports all three modes (date, baseline, and revision) in a single improved interface. Tasks created after the comparison point are marked with a **NEW** badge, making it easy to spot recently added work items.

## Option 2: Always-On Baseline Display

To show baseline bars every time the Gantt loads, configure the widget to display baselines automatically.

1. Open the page in edit mode and select the Gantt widget.

2. Navigate to **Widget Properties > Baselines**.

3. Set **Show Baselines** to **Yes**.

4. In **Compare to date**, choose one of:
   * A **relative date** (T-minus, e.g., 30 days ago)
   * A **specific date** in the past
   * A **page parameter** to let users pick the date dynamically

5. Save the page. The Gantt now loads with baseline overlay bars visible by default.

<Tip title="Combine with Page Parameters">
  Create a page parameter called `baselineRevision` of type **string** on your Gantt report page. Users can then select different baselines without editing widget properties. See [Configure Page Parameters](/gantt/guides/layout/page-parameters) for setup details.
</Tip>

## Option 3: API Approach with Item Script

For item-specific baselines (where each work item stores its own approved schedule), use the Item Script to populate baseline fields from custom fields.

Add the following to **Widget Properties > Advanced > Item Script**:

```javascript theme={null}
task.planned_start_date = util.getDate(wi, "gantt_initial_start");
task.planned_duration = util.getDuration(wi, "gantt_initial_duration");
```

This reads the approved start date and duration from custom fields on each work item. The baseline bars reflect per-item approved schedules rather than a single historical snapshot.

<Note title="Field Names Must Match Data Mapping">
  The field names passed to `util.getDate()` and `util.getDuration()` must match your Data Mapping configuration. If your mapping uses `start` and `initialEstimate`, use those exact names in the script.
</Note>

## Browsing Baselines with a Portal Page

You can create a Polarion wiki page that lists all project baselines and links each one directly to your Gantt with the comparison pre-applied. This approach uses a Velocity script that iterates through `$project.baselinesManager.baselines` and constructs links with the `baselineRevision` page parameter.

<Info title="Verify in application">
  The Velocity-based baseline portal page requires Polarion wiki scripting permissions. Consult your Polarion administrator for access.
</Info>

## Exiting Compare Mode

To stop the baseline comparison and return to the normal view, click the **Compare** button again in the toolbar (it appears in a toggled/active state during comparison). The baseline overlay bars are removed and the Gantt returns to its current-schedule-only display.

## Verification

You should now see secondary bars behind each task bar in the Gantt chart. These baseline bars represent the historical schedule. If a task has moved since the comparison date, you will see the current task bar offset from the baseline bar. Tasks added after the comparison date display a **NEW** badge.

## See Also

* [Configure Page Parameters](/gantt/guides/layout/page-parameters)
* [Configure Item Colors](/gantt/guides/visualization/configure-colors)
* [Perform What-If Analysis Without Saving](/gantt/guides/scheduling/what-if-analysis)
* [Write Item Scripts](/gantt/guides/scripting/item-script-basics)

<LastReviewed date="2026-07-02" />
