website logo
ChartHop documentation
Carrot reference
Release notes
Navigate through spaces
ChartHop documentation
Carrot reference
Release notes
⌘K
Getting started
Getting started with Carrot
Operator precedence
Filtering with Carrot
Data categories
Basic Org Information
Compensation
Job Changes
Permissions
Personal
Recruiting
Structure
Time off
Data types
Address
Boolean
Comp
Comp Band
Currency
Date
DateTime
DaysOff
Enum
EnumList
File
Group
Image
Job
List
Money
Name
Number
Null
Percent
Person
PersonList
Shares
StockGrant
String
TimeOff
User
Operators
+ (add)
- (subtract)
* (multiply)
/ (divide)
% (modulus)
&& (and)
|| (or)
if
: (match)
= (equals)
!= (not-equals)
! (not)
> (greater-than)
>= (greater-than-equals)
< (less-than)
<= (less-than-equals)
[ ](array)
. (dot)
? (ternary)
?: (elvis)
Functions
abs()
asOf()
boolean()
compHistory()
compBetween()
costBetween()
date()
day()
daysOffBetween()
diffYears()
diffMonths()
distance()
monthEnd()
formatMoney()
formatRound()
formatNumber()
formatPercent()
formatDate()
grantedShares()
length()
max()
mean()
money()
month()
min()
nextAnniversary()
number()
pluralize()
percent()
random()
round()
roundUp()
roundDown()
string()
subString()
stockPrice()
monthStart()
split()
vestValue()
vestShares()
year()
Aggregators
count{}
max{}
mean{}
min{}
sum{}
Docs powered by archbee 
10min

- (subtract)

An operator used to subtract an expression from another expression.

Syntax

valueOne - valueTwo

Sample usage

(1 - 2) - 3 returns -4

('2021-01-02') - 1 returns 2021-01-01

Supported data types

  • If a Number, Money value, or Percent is subtracted from an expression of the same type, the difference between the two values will be returned.
  • If the left side is a Date, and the right side is a Number, it will return the date minus that many days.
  • If a Date is subtracted from another Datethe number of days between them will be returned.

  • If a Number value is subtracted from a Money value, the Money value will decrease by the value of the Number.
  • If a Percent value is subtracted from a Number value, the Number value will decrease by the value of the Percent; the reverse operation will also work, however the returned value will still be of type Number.

See also

  • Number
  • Money
  • Percent
  • String
  • Date
  • + (add)
Updated 07 Apr 2022
Did this page help you?
Yes
No
UP NEXT
* (multiply)
Docs powered by archbee 
TABLE OF CONTENTS
Syntax
Sample usage
Supported data types
See also