# Salesforce: Opportunity Daily History

## Description

* Each record is a daily record in an opportunity, starting with its first active date and updating up toward either the current date (if still active) or its last active date.

## Supported Data Sources

* <img src="https://fivetran.com/integrations/salesforce/resources/salesforce.svg" alt="" data-size="line"> Salesforce

## Columns

| Type     | Name                         | Description                                                                                                                                                                                         |
| -------- | ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| STRING   | opportunity\_day\_id         | Surrogate key hashed on `date_day` and `opportunity_id`                                                                                                                                             |
| DATE     | date\_day                    | Date on which the opportunity had these field values.                                                                                                                                               |
| STRING   | opportunity\_id              | The unique, system-generated ID assigned during creation.                                                                                                                                           |
| DATETIME | \_fivetran\_start            | The time when the record was first created or modified in the source, based on a timestamp value in the source table that monotonically increases over time with data change or update.             |
| DATETIME | \_fivetran\_end              | The time until which the record was active minus epsilon, where epsilon is the smallest time difference that can be stored in the timestamp type value.                                             |
| DATE     | \_fivetran\_date             |                                                                                                                                                                                                     |
| STRING   | history\_unique\_key         | Surrogate key hashed on `_fivetran_start` and `opportunity_id`.                                                                                                                                     |
| BOOLEAN  | \_fivetran\_active           | true if it is the currently active record. false if it is a historical version of the record. Only one version of the record can be true.                                                           |
| DATETIME | \_fivetran\_synced           | The time at which fivetran last synced this record.                                                                                                                                                 |
| STRING   | account\_id                  | ID of the account associated with this opportunity.                                                                                                                                                 |
| DECIMAL  | amount                       | Estimated total sale amount. For opportunities with products, the amount is the sum of the related products.                                                                                        |
| INTEGER  | campaign\_id                 | ID of a related Campaign. This field is defined only for those organizations that have the campaign feature Campaigns enabled.                                                                      |
| DATETIME | close\_date                  | Required. Date when the opportunity is expected to close.                                                                                                                                           |
| DATETIME | created\_date                | Date when the opportunity is was created.                                                                                                                                                           |
| INTEGER  | description                  |                                                                                                                                                                                                     |
| DECIMAL  | expected\_revenue            | Read-only field that is equal to the product of the opportunity Amount field and the Probability.                                                                                                   |
| STRING   | fiscal                       | If fiscal years are not enabled, the name of the fiscal quarter or period in which the opportunity CloseDate falls.                                                                                 |
| INTEGER  | fiscal\_quarter              | Represents the fiscal quarter. Valid values are 1, 2, 3, or 4.                                                                                                                                      |
| INTEGER  | fiscal\_year                 | Represents the fiscal year, for example, 2006.                                                                                                                                                      |
| STRING   | forecast\_category           | Restricted picklist field.                                                                                                                                                                          |
| STRING   | forecast\_category\_name     | The name of the forecast category.                                                                                                                                                                  |
| BOOLEAN  | has\_open\_activity          | Indicates whether an opportunity has an open event or task (true) or not (false).                                                                                                                   |
| BOOLEAN  | has\_opportunity\_line\_item | Read-only field that indicates whether the opportunity has associated line items. A value of true means that Opportunity line items have been created for the opportunity.                          |
| BOOLEAN  | has\_overdue\_task           | Indicates whether an opportunity has an overdue task (true) or not (false).                                                                                                                         |
| BOOLEAN  | is\_closed                   | True, if Stage Name Label is Closed.                                                                                                                                                                |
| BOOLEAN  | is\_deleted                  | Indicates whether the object has been moved to the Recycle Bin (true) or not (false).                                                                                                               |
| BOOLEAN  | is\_won                      | True, if Stage Name Label is Won.                                                                                                                                                                   |
| DATETIME | last\_activity\_date         | Value is one of the following, whichever is the most recent:Due date of the most recent event logged against the record or Due date of the most recently closed task associated with the record.    |
| DATETIME | last\_referenced\_date       | The timestamp when the current user last accessed this record, a record related to this record, or a list view.                                                                                     |
| DATETIME | last\_viewed\_date           | The timestamp when the current user last viewed this record or list view. If this value is null, the user might have only accessed this record or list view (LastReferencedDate) but not viewed it. |
| STRING   | lead\_source                 | Source of this opportunity, such as Advertisement or Trade Show.                                                                                                                                    |
| STRING   | name                         |                                                                                                                                                                                                     |
| INTEGER  | next\_step                   | Description of next task in closing opportunity.                                                                                                                                                    |
| STRING   | owner\_id                    | ID of the User who has been assigned to work this opportunity.                                                                                                                                      |
| INTEGER  | probability                  | Percentage of estimated confidence in closing the opportunity.                                                                                                                                      |
| STRING   | record\_type\_id             | ID of the record type assigned to this object.                                                                                                                                                      |
| STRING   | stage\_name                  | Required. Current stage of this record. The StageName field controls several other fields on an opportunity.                                                                                        |
| INTEGER  | synced\_quote\_id            | The ID of the Quote that syncs with the opportunity.                                                                                                                                                |
| STRING   | type                         | Type of opportunity. For example, Existing Business or New Business.                                                                                                                                |
| INTEGER  | row\_num                     |                                                                                                                                                                                                     |


---

# 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://endash-guidance-docs.gitbook.io/cigro-data-templates/data-model-templates/salesforce-opportunity-daily-history.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.
