Links
Comment on page

Subtraction -

Operator: -
The subtraction operator - is used to subtract several values. The values can be of the following type:
  • number
  • duration
  • datetime
  • concept-set
This function is SQL compatible. For more information about SQL compatibility, see our documentation.
Returns a new value that is the result of subtracting value2 from value1. The type of the resulting value depends on the types of value1 and value2:
  • number - number returns a number
  • duration - duration returns a duration
  • datetime - duration returns a datetime
  • concept-set - concept-set returns a concept-set
value1 - value2
37 - 7 => 30
'1d' - '12h' => 12 hours
Today() - '2d' => day before yesterday
{ 'concept1', 'concept2', 'concept3'} - { 'concept1', 'concept3' } => { 'concept2' }
'1d' - 12 => expression type mismatch