You could achieve this via a function node.

[{"id":"8f7f9a59772e9c54","type":"inject","z":"23a4d2dd73b6359f","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"30.1","payloadType":"num","x":510,"y":600,"wires":[["4b61f945350d10d6"]]},{"id":"4b61f945350d10d6","type":"function","z":"23a4d2dd73b6359f","name":"Max Value Monitor","func":"let max_value = context.get(\"max_value\") || 0;\nconst current_value = msg.payload;\nif(msg.topic == \"CLEAR\") {\n max_value = 0;\n context.set(\"max_value\", undefined);\n node.status({fill:\"grey\",shape:\"ring\",text:\"---\"});\n} else {\n if (max_value < current_value) {\n max_value = current_value;\n context.set(\"max_value\", max_value);\n msg.payload = max_value;\n node.status({fill:\"blue\",shape:\"dot\",text: max_value + \" kg\"});\n return msg;\n } else {\n node.status({ fill: \"grey\", shape: \"ring\", text: max_value + \" kg\" });\n }\n}\n\n\n\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":750,"y":640,"wires":[["159f9dcabd276f59"]]},{"id":"159f9dcabd276f59","type":"debug","z":"23a4d2dd73b6359f","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":950,"y":640,"wires":[]},{"id":"db507ead0e26e1af","type":"inject","z":"23a4d2dd73b6359f","name":"","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"CLEAR","x":500,"y":540,"wires":[["4b61f945350d10d6"]]},{"id":"bfc7179f7006d97b","type":"inject","z":"23a4d2dd73b6359f","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"37.81","payloadType":"num","x":510,"y":640,"wires":[["4b61f945350d10d6"]]},{"id":"4d2375f2dfe18c0a","type":"inject","z":"23a4d2dd73b6359f","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"44.8","payloadType":"num","x":510,"y":680,"wires":[["4b61f945350d10d6"]]},{"id":"6e47c151fc9cae40","type":"inject","z":"23a4d2dd73b6359f","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"63.45","payloadType":"num","x":510,"y":720,"wires":[["4b61f945350d10d6"]]}]
@henzard - the flow has been updated to fix a slight issue around the CLEAR operation (credit to @UnborN )