The importance of power quality has increased in recent years due to ever-increasing nonlinear load demands. In addition, real distribution networks are inherently unbalanced, and load demands are not distributed equally among phases. Voltage harmonic distortion and unbalancing can undesirably damage/affect equipment operating and protective and measurement devices performance. On the other hand, uncertainties arising from renewable energy sources (RESs) and load demands increase the complexity of any action to improve the network operating performance. A soft open point (SOP) is a new power electronic device that is capable of being installed in a distribution system's end feeders, to improve network operating performance. This paper focuses on the optimal determination of the location and hourly control of SOP in a 4 -wire distribution network to achieve minimum harmonic distortion, voltage unbalance, and active power losses by active and reactive power control, as well as selective harmonic current injection. To efficiently encounter uncertainties, the K-medoids data clustering method has been used to select appropriate scenarios. Also, the multi-objective particle swarm optimization (MOPSO) algorithm is applied to solve the main optimization problem, and the technique for order of preference by similarity to ideal solution (TOPSIS) is applied to select a preferred result. To show the efficiency and applicability of the proposed technique, the method is implemented on a modified 4 -wire IEEE 33 -bus distribution network.