Arithmetic nodes
Calculate a number from one or two inputs
Each node calculates a number from the inputs you supply:
-
Add - adds two numbers together, e.g. 2 + 2 = 4
-
Ceiling - rounds one number up to the next whole number, e.g. 10.08 becomes 11
-
Divide - divides the first of two numbers by the second, e.g. 10 ÷ 2 = 5
-
Floor - rounds one number down to the previous whole number, e.g. 9.98 becomes 9
-
Multiply - multiplies two numbers together, e.g. 8 x 8 = 64
-
Power - raises the first of two numbers to the power of the second, e.g. 9² = 81
-
Root - calculates the root of the first of two numbers, using the second as the index, e.g. the cube root of 8 (∛8) = 2
-
Subtract - subtracts the second of two numbers from the first, e.g. 8 - 6 = 2
Usage
These nodes are functions, so you can add them to the segments of these comparison nodes:
as well as the segments of other arithmetic nodes.
Compatibility
Each node's own segments must hold a matching value type. Ceiling and Floor take one input, the rest take two. Unlike comparisons, both inputs can be fixed numbers.
| Node | Accepted Value Type |
|---|---|
| Other Arithmetic nodes | Number |
| Attribute | Number |
| Count | Number |
| Number | Number |
| Value From Item Attribute | Number |
| Length | Number |
Options
Select the node to access its options:
-
Swap - use another function. If any segments are populated, only compatible nodes are listed.
-
Delete - remove the node from the segment.
Examples
Add
Fetch all street lights with a column 2 metres taller than this particular one.
In AQS terms:
Fetch items of the Street Lights design where their Column Height attribute is greater than the Column Height attribute of a particular Street Light item plus 2.
See JSON code
This code may reference designs, interfaces, attributes or items that don't exist in your company project.
{
"type": "Query",
"properties": {
"collectionCode": "Live",
"dodiCode": "designs_streetLights"
},
"children": [
{
"type": "GreaterThan",
"children": [
{
"type": "Attribute",
"properties": {
"attributeCode": "attributes_streetLightsColumnHeight_5e1db714ca31500ad87c5d18"
}
},
{
"type": "Add",
"children": [
{
"type": "ValueFromItemAttribute",
"properties": {
"attributeCode": "attributes_streetLightsColumnHeight_5e1db714ca31500ad87c5d18",
"dodiCode": "designs_streetLights",
"value": ["5d95cc05ca314f0a302da717"]
}
},
{
"type": "Number",
"properties": {
"value": [2]
}
}
]
}
]
}
]
}
Ceiling and Floor
Fetch all Trees with a crown base of 2 metres when rounded up or down.
In AQS terms:
Fetch items of the Trees design where the ceiling of their Crown Base (m) attribute equals 2 OR the floor of their Crown Base (m) attribute equals 2.
See JSON code
This code may reference designs, interfaces, attributes or items that don't exist in your company project.
{
"type": "Query",
"properties": {
"collectionCode": "Live",
"dodiCode": "designs_trees"
},
"children": [
{
"type": "Or",
"children": [
{
"type": "Equals",
"children": [
{
"type": "Number",
"properties": {
"value": [2]
}
},
{
"type": "Ceiling",
"children": [
{
"type": "Attribute",
"properties": {
"attributeCode": "attributes_treesCrownBase"
}
}
]
}
]
},
{
"type": "Equals",
"children": [
{
"type": "Number",
"properties": {
"value": [2]
}
},
{
"type": "Floor",
"children": [
{
"type": "Attribute",
"properties": {
"attributeCode": "attributes_treesCrownBase"
}
}
]
}
]
}
]
}
]
}
Divide
Fetch all street lights with a column that's (16 ÷ 2) metres.
In AQS terms:
Fetch items of the Street Lights design where their Column Height attribute is equal to 16 divided by 2.
See JSON code
This code may reference designs, interfaces, attributes or items that don't exist in your company project.
{
"type": "Query",
"properties": {
"collectionCode": "Live",
"dodiCode": "designs_streetLights"
},
"children": [
{
"type": "Equals",
"children": [
{
"type": "Attribute",
"properties": {
"attributeCode": "attributes_streetLightsColumnHeight_5e1db714ca31500ad87c5d18"
}
},
{
"type": "Divide",
"children": [
{
"type": "Number",
"properties": {
"value": [16]
}
},
{
"type": "Number",
"properties": {
"value": [2]
}
}
]
}
]
}
]
}
Multiply
Fetch all street lights with a column that's (4 x 2) metres.
In AQS terms:
Fetch items of the Street Lights design where their Column Height attribute is equal to 4 multiplied by 2.
See JSON code
This code may reference designs, interfaces, attributes or items that don't exist in your company project.
{
"type": "Query",
"properties": {
"collectionCode": "Live",
"dodiCode": "designs_streetLights"
},
"children": [
{
"type": "Equals",
"children": [
{
"type": "Attribute",
"properties": {
"attributeCode": "attributes_streetLightsColumnHeight_5e1db714ca31500ad87c5d18"
}
},
{
"type": "Multiply",
"children": [
{
"type": "Number",
"properties": {
"value": [4]
}
},
{
"type": "Number",
"properties": {
"value": [2]
}
}
]
}
]
}
]
}
Power
Fetch all street lights with a column that's 2³ metres.
In AQS terms:
Fetch items of the Street Lights design where their Column Height attribute is equal to 2 to the power of 3.
See JSON code
This code may reference designs, interfaces, attributes or items that don't exist in your company project.
{
"type": "Query",
"properties": {
"collectionCode": "Live",
"dodiCode": "designs_streetLights"
},
"children": [
{
"type": "Equals",
"children": [
{
"type": "Attribute",
"properties": {
"attributeCode": "attributes_streetLightsColumnHeight_5e1db714ca31500ad87c5d18"
}
},
{
"type": "Power",
"children": [
{
"type": "Number",
"properties": {
"value": [2]
}
},
{
"type": "Number",
"properties": {
"value": [3]
}
}
]
}
]
}
]
}
Root
Fetch all street lights with a column that's √64 metres.
In AQS terms:
Fetch items of the Street Lights design where their Column Height attribute is equal to the square root of 64.
See JSON code
This code may reference designs, interfaces, attributes or items that don't exist in your company project.
{
"type": "Query",
"properties": {
"collectionCode": "Live",
"dodiCode": "designs_streetLights"
},
"children": [
{
"type": "Equals",
"children": [
{
"type": "Attribute",
"properties": {
"attributeCode": "attributes_streetLightsColumnHeight_5e1db714ca31500ad87c5d18"
}
},
{
"type": "Root",
"children": [
{
"type": "Number",
"properties": {
"value": [64]
}
},
{
"type": "Number",
"properties": {
"value": [2]
}
}
]
}
]
}
]
}
Subtract
Fetch all street lights with a column 4 metres shorter than this particular one.
In AQS terms:
Fetch items of the Street Lights design where their Column Height attribute is less than the Column Height attribute of a particular Street Light item minus 4.
See JSON code
This code may reference designs, interfaces, attributes or items that don't exist in your company project.
{
"type": "Query",
"properties": {
"collectionCode": "Live",
"dodiCode": "designs_streetLights"
},
"children": [
{
"type": "LessThan",
"children": [
{
"type": "Attribute",
"properties": {
"attributeCode": "attributes_streetLightsColumnHeight_5e1db714ca31500ad87c5d18"
}
},
{
"type": "Subtract",
"children": [
{
"type": "ValueFromItemAttribute",
"properties": {
"attributeCode": "attributes_streetLightsColumnHeight_5e1db714ca31500ad87c5d18",
"dodiCode": "designs_streetLights",
"value": ["5d95cc05ca314f0a302da717"]
}
},
{
"type": "Number",
"properties": {
"value": [4]
}
}
]
}
]
}
]
}