---
title: costBetween()
slug: costbetween
docTags: 
createdAt: 2022-11-01T23:53:35.000Z
---

Calculates the cost of a job over a specified period of time where the cost of a job includes if multiple people have held that job.&#x20;

## costBetweenPrimary()

Returns the costBetween calculation only using data from Primary.

### Syntax

**baseCostBetweenPrimary** -  Calculates the **Base cost&#x20;**(Base \* Org Multiplier) of a job over a specific time period, including future roles with announced start dates, based on data in Primary only.

`baseCostBetweenPrimary( startDate: Date, endDate: Date, Multiplier: BigDecimal)`

- `startDate` - The current, or announced starting date for the current, or future filled role, respectively.
- `endDate` - The end date for the role.
- `Multiplier`- Optional multiplier. Defaults to `1.0`.
- **Return type:&#x20;**[Money](https://docs.charthop.com/_kS5-money)****

***

**variableCostBetweenPrimary** - Calculates the **Variable cost** of a job over a specific time period, including future filled roles with announced start dates, based on data in Primary only.

`variableCostBetweenPrimary( startDate: Date, endDate: Date, Multiplier: BigDecimal)`

- `startDate` - The current, or announced starting date for the current, or future filled role, respectively.
- `endDate` - The end date for the role.
- `Multiplier`- Optional multiplier. Defaults to `1.0`.
- **Return type:&#x20;**[Money](https://docs.charthop.com/_kS5-money)

***

**fullyLoadedCostBetweenPrimary** - Calculates the **Base cost** (Base \* Org Multiplier) plus the **Variable cost** of a job over a specific time period, including future roles with announced start dates, based on data in Primary only.

`fullyLoadedCostBetweenPrimary( startDate: Date, endDate: Date, Multiplier: BigDecimal)`

- `startDate` - The current, or announced starting date for the current, or future filled role, respectively.
- `endDate` - The end date for the role.
- `Multiplier`- Optional multiplier. Defaults to `1.0`.
- **Return type:&#x20;**[Money](https://docs.charthop.com/_kS5-money)

### Sample usages

| **Code sample**                                                   | **Result**                                                                                                                                       |
| ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| `baseCostBetweenPrimary('2017-07-01', '2022-08-01", 1.0)`         | Returns the calculated `base` cost of a job between January 7th, 2017 and January 8th, 2022.                                                     |
| `variableCostBetweenPrimary('2017-07-01', '2022-08-01", 2.5)`     | Returns the calculated `variable` cost of a job between January 7th, 2017 and January 8th, 2022 and multiplies that value by `2.5`               |
| `fullyLoadedCostBetweenPrimary('2017-07-01', '2022-08-01", 1.0)`  | Returns the calculated fully loaded cost of a job: ((`base`\* `Org Multiplier`) + `variable`)), between January 7th, 2017 and January 8th, 2022. |

