---
title: compHistory()
slug: comphistory
docTags: 
createdAt: 2021-09-14T17:44:38.000Z
---

Returns the value of `base` or `variable` compensation on a given date.

### Syntax

`compHistory([date]).comp`

- `date` - (optional) the date to be evaluated. The default value is the current date.
- `comp` - the type of compensation to be returned.&#x20;
  - Accepted values are `base` and `variable`
- **Return type:&#x20;**[Comp](docId\:H_73YLW2UsTscC_TjerlF)&#x20;

### Sample usage

`compHistory('2017-07-01').base` returns the value of `base` compensation on the given date.

`compHistory().variable` returns the value of `variable` compensation on the current date.

### Supported data types

| **Input type**                            | **Return type**                         | **Logic**                                                                            |
| ----------------------------------------- | --------------------------------------- | ------------------------------------------------------------------------------------ |
| ****[Date](docId\:xTAQdzvLBTAKjxRnpFwe9)  | [Money](docId:_kS5D2xbfoR9d8WfRIVnY)    | Function will return the value of the specified compensation type on the input date. |
| *Unsupported data types*                  | **[Null](docId\:N9trVqonnBknqL9DrNBP6)  | Unsupported data types return `Null`.                                                |

