Here are two examples, one using function node, and one using change node and JSONata. They both store the last 24 readings and output the median value.
[{"id":"d914b791.136a4","type":"inject","z":"5a245aa1.510164","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"$ceil($random()*100)","payloadType":"jsonata","x":120,"y":2580,"wires":[["c2187bd9.e074e8","9b77f2bf.9941a"]]},{"id":"c2187bd9.e074e8","type":"change","z":"5a245aa1.510164","name":"","rules":[{"t":"set","p":"medArray","pt":"flow","to":"$append([payload],$flowContext(\"medArray\"))[[0..23]]","tot":"jsonata"},{"t":"set","p":"payload","pt":"msg","to":"$sort(\t $flowContext(\"medArray\"),\t function($l, $r) {\t $l > $r\t}\t)[$floor($count($flowContext(\"medArray\"))/2)]","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":290,"y":2560,"wires":[["30cdf41d.35342c"]]},{"id":"30cdf41d.35342c","type":"debug","z":"5a245aa1.510164","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":530,"y":2520,"wires":[]},{"id":"3b163090.9f8058","type":"debug","z":"5a245aa1.510164","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":510,"y":2580,"wires":[]},{"id":"9b77f2bf.9941a","type":"function","z":"5a245aa1.510164","name":"","func":"let fMedArray = (flow.get(\"fMedArray\") || []);\nfMedArray.unshift(msg.payload)\nfMedArray= fMedArray.slice(0,24);\nflow.set(\"fMedArray\", fMedArray.concat([]));\nmsg.payload = fMedArray.sort((a, b) => a - b)[Math.floor(fMedArray.length/2)];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":280,"y":2620,"wires":[["3b163090.9f8058"]]}]