# Calculating statistical key figures using an aggregation node

You can calculate various statistical key figures based on the payload of a message.

1. Open Node-RED.
2. Add an aggregation node from the Weidmüller category to the workspace.
3. Double-click the aggregation node to open the Edit node dialogue.
4. In the Computation drop-down list, select the key figure you want to calculate.
5. Click Done to apply your changes.
6. Connect the input of the aggregation node to the node that outputs the payload you want to use for the calculation.

7. The aggregation node takes arrays of numbers as input. Single plain numbers will be automatically converted into arrays with one element. Other data types in the input payload will result in an error. You can use a join node to aggregate values to an array.