Applies to:  CELONIS 4.0 CELONIS 4.2 CELONIS 4.3 CELONIS 4.4 CELONIS 4.5 CELONIS 4.6 CELONIS 4.7 

Description

The addition operator computes the sum of two values.

The addition operator can be applied to INT or FLOAT columns or constants. The resulting column is of type INT if both input columns or constants are of type INT. In all other cases, the resulting column is of type FLOAT.

Syntax

ADD ( table.column1 , table.column2 )
table.column1 + table.column2

NULL handling

If one of the input values is NULL, the result is NULL as well.

Examples


[1] Add a constant INT value to a column of type INT:

Query
Column1
"Table1"."Column1" + 10
Input
Table1
Column1 : INT
1
2
3
4
Output
Result
Column1 : INT
11
12
13
14



[2] Add a constant FLOAT value to a column of type FLOAT:

Query
Column1
"Table1"."Column1" + 10.0
Input
Table1
Column1 : FLOAT
1.0
2.0
3.0
4.0
Output
Result
Column1 : FLOAT
11.0
12.0
13.0
14.0



[3] Add a constant FLOAT value to a column of type INT:

Query
Column1
"Table1"."Column1" + 10.0
Input
Table1
Column1 : INT
1
2
3
4
Output
Result
Column1 : FLOAT
11.0
12.0
13.0
14.0



[4] Add values of multiple INT and FLOAT columns together:

Query
Column1
"Table1"."IntColumn1" + "Table1"."IntColumn2"
Column2
ADD ( "Table1"."IntColumn1" , "Table1"."FloatColumn1" )
Column3
"Table1"."FloatColumn1" + "Table1"."FloatColumn2"
Column4
ADD ( "Table1"."IntColumn1" , "Table1"."IntColumn2" + "Table1"."FloatColumn1" )
Input
Table1
IntColumn1 : INTIntColumn2 : INTFloatColumn1 : FLOATFloatColumn2 : FLOAT
20
5
10.0
20.0
30
15
14.0
7.0
40
null
12.0
22.0
50
30
null
23.0
null
45
14.0
null
Output
Result
Column1 : INTColumn2 : FLOATColumn3 : FLOATColumn4 : FLOAT
25
30.0
30.0
35.0
45
44.0
21.0
59.0
null
52.0
34.0
null
80
null
null
null
null
null
null
null


  • No labels