---
title: compBetween()
slug: compbetween
docTags: 
createdAt: 2022-11-02T00:31:33.000Z
---

Calculates the base, variable or cash compensation of a person over a specified period of time including all jobs the person has held.

## compBetween()

Returns the compBetween calculation excluding data from Primary.

### Syntax

**baseCompBetween**- Calculates the **Base** compensation of a person over a specific time period, including internal transfers and moves.

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

- `startDate` - The start date of the checked time period.
- `endDate` - The end date of the checked time period.
- `Multiplier`- Optional multiplier. Defaults to `1.0`.
- **Return type:&#x20;**[Comp](docId\:H_73YLW2UsTscC_TjerlF)&#x20;

| **Code sample**                                    | **Result**                                                                           |
| -------------------------------------------------- | ------------------------------------------------------------------------------------ |
| `baseCompBetween('2017-07-01', '2022-08-01", 1.0)` | Returns the `base` comp of a person between January 7th, 2017 and January 8th, 2022. |

***

**variableCompBetween** - Calculates the **Variable** compensation of a person over a specific time period, including internal transfers and moves.

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

- `startDate` - The start date of the checked time period.
- `endDate` - The end date of the checked time period.
- `Multiplier`- Optional multiplier. Defaults to `1.0`.
- **Return type:&#x20;**[Comp](docId\:H_73YLW2UsTscC_TjerlF)

| **Code sample**                                         | **Result**                                                                                                                |
| ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| `variableCompBetween('2017-07-01', '2022-08-01", 2.5)`  | Returns the `variable`comp of a person between January 7th, 2017 and January 8th, 2022 and multiplies the value by `2.5`. |

***

**cashCompBetween** - Returns the **Base** + **Variable** compensation of a person over a specific time period, including internal transfers and moves.

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

- `startDate` - The start date of the checked time period.
- `endDate` - The end date of the checked time period.
- `Multiplier`- Optional multiplier. Defaults to `1.0`.
- **Return type:&#x20;**[Comp](docId\:H_73YLW2UsTscC_TjerlF)&#x20;

| **Code sample**                                    | **Result**                                                                                            |
| -------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| `cashCompBetween('2017-07-01', '2022-08-01", 1.0)` | Returns the **base** + **variable** comp of a person between January 7th, 2017 and January 8th, 2022. |

