The annual growth rate of pharmaceutical industry in Pakistan is 10% and is continuously expanding to fulfill the increasing demand of the rapidly growing population. But inability of the pharmaceutical sector to comply with the environmental standards leads to the introduction of large quantities of various pollutants in the natural environment which presents serious ecological challenges. In this study, effluent wastewater samples from 14 manufacturing units of the pharmaceutical industries of the National Industrial Zone, Rawat, Pakistan, were collected and characterized for physicochemical parameters including color, odor, pH, electric conductivity, temperature, total dissolved solids, total suspended solids, salinity, dissolved oxygen (DO), chemical oxygen demand (COD), nitrates, sulfates and phosphates according to the standard methods. The detection and quantification of diclofenac (DCF)—one of the commonly prescribed drugs in Pakistan—were carried out in the pharmaceutical wastewater samples (PWWSs) using HPLC-PAD. Exceptionally high concentration of the diclofenac was detected in the industrial disposal of MB-12 (311,495 µg L−1). PWWSs were analyzed using chemometric techniques including principal factor analysis (PFA) and cluster analysis (CA). PFA explained almost 81.48% of the total variance by the newly extracted four components and complemented the strong Pearson’s correlation coefficient (r) of DCF concentrations to that of the levels of COD, r = 0.752, and DO, r = − 0.609, in PWWSs. Six clusters were generated during similar wastewater characteristics-based CA dendrogram, in which reverse osmosis-treated PWWSs were observed to cluster with the untreated PWWSs, suggesting the need to adopt an advance and better wastewater treatment methods by the pharmaceutical industries.