website logo
Navigate through spaces
ChartHop documentation
⌘K
ChartHop Help Center
Getting around in ChartHop
ChartHop for Employees
Implementing ChartHop
ChartHop for Administrators
Carrot reference
ChartHop for Developers
Partners
Release notes
Resources
Docs powered by
Archbee
website logo
Carrot reference
...
Elements of Carrot expressions
Operators

- (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.
  • 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 18 May 2023
Did this page help you?
PREVIOUS
+ (add)
NEXT
* (multiply)
Docs powered by
Archbee
TABLE OF CONTENTS
Syntax
Sample usage
Supported data types
See also
Docs powered by
Archbee