The purpose of the work is to develop an algorithm for analyzing the customer base of a trade organization, which allows customers to be divided into groups depending on their activity. In the future, by taking into account the preferences of each group of clients, it will be possible to increase the efficiency of working with clients. The authors use ABC-XYZ analysis and clustering methods in the algorithm, which make it possible to determine the most active customers who bring in the most profit. The ABC-XYZ analysis method divides buyers into groups depending on the amount and frequency of purchases, clustering methods combine the original objects into clusters based on similar characteristics. According to the algorithm presented in the work, RapidMiner Studio system has developed scenarios for analyzing the client base of a trade organization. The ABC-XYZ analysis method showed buyers who are worth paying special attention to, since their absence will lead to losses. The cluster analysis used the k-means methods, which divided the initial data set into 3 clusters, g-means and Expectation-Maximization algorithm, in which the number of clusters was not specified. The following characteristics were used: the average amount of purchases per year, the average number of unique products purchased per year, the average number of purchases per year, the number of years that the buyer cooperates with the store, the year of the last purchase. The g-means method divided the buyers into 3 clusters, and the EM algorithm into 10. The combined ABC-XYZ analysis and k-means algorithm showed the best results of customer separation, allowing an individual approach to work with customers of each group.