Many contemporary IoT systems do produce a large scale of data. While a new portions of data come to data storage (database etc.) all the previously stored data become obsolete. Most of such obsolete data become excessive and can be needed only to see general trends or anomalies. This research offers an algorithm of data aggregation to minimize the amount of stored obsolete data according to defined business rules. Some modifications of algorithm are discussed to fit different kind of business requirements. There is also a comparison of two methods of data merge in algorithm, quantization and clustering, was made.