IRPD: Indonesian Retail Pharmacy Sales and Stock Transaction Dataset (2023–2025)
Description
Transaction-level sales and stock movement records from a retail pharmacy in Central Java, Indonesia, 2 January 2023 – 31 December 2025 (no records on a few days, e.g. New Year's Day and Eid al-Fitr; see README). Exported from the pharmacy's point-of-sale (POS) system and provided as raw exports and cleaned, analysis-ready versions. Column headers are translated to English; Indonesian terms such as Penjualan (sale), Pembelian (purchase) and Mutasi (stock transfer) remain in the data values. FILES: - raw_dataset/sales_raw.csv: 649,656 rows, 35 columns. Values as exported, apart from the anonymization described under PRIVACY. - raw_dataset/stock_raw.csv: 804,027 rows, 15 columns. Values as exported, apart from the anonymization described under PRIVACY. - processed_dataset/sales_processed.csv: 627,389 rows, 35 columns. - processed_dataset/stock_processed.csv: 775,560 rows, 21 columns. - processed_dataset/EDA Notebook/: exploratory analysis notebook (EDA_Analysis.ipynb) and figures. - processing script/: generate_raw.py and generate_processed.py, which produce the raw and processed CSVs. - README.md: column dictionary, file guide and known data characteristics. PROCESSING (raw to processed): - Date and time split into Date, Year, Month, Day, DayOfWeek, Time and Hour. - Numeric fields converted to numbers (e.g., "8%" becomes 8.0; "17 Fls" becomes 17, with the unit in a separate Unit column). - Batch/expiry text split into BatchNumber and ExpiryDate. - Free-text stock descriptions normalized into nine transaction types in TransactionType (Penjualan, Mutasi, Pembelian, Stokopname, Import Stokopname, Import Data Obat, Retur, Tambah Master Obat, Test Entry). Purchases keep an anonymized supplier code in brackets, e.g. Pembelian (Supplier_012). - Categories Alkes (medical equipment), Baby and Minuman (beverages) excluded from the processed files; they remain in the raw files. - Seven sales columns dropped (near-zero fill rate or privacy): PrescriptionNumber, PatientID, DoctorID, SalespersonID, SalesPromo, PromoName, TaxInvoiceNumber. - Warehouse dropped from stock: it only tags the storage location within the same pharmacy (sales floor or upstairs storage room). Each row's stock level is the balance of its own location; the README shows how to re-attach Warehouse from the raw file. PRIVACY: Cashier, patient and salesperson names (the doctor-name column is empty), and patient names in stock transaction descriptions, were replaced with anonymized codes (e.g., Cashier_001, Patient_001). Supplier names and supplier invoice numbers were replaced with stable codes (Supplier_xxx, PINV_xxxxxx), and a few location-revealing values were generalized. The mapping to the original values is not included. There is no cost or purchase-price data; PriceTier is a categorical code for the selling-price tier.
Files
Steps to reproduce
1. Install Python 3.13 (tested with 3.13.4) with pandas 2.x, plus matplotlib, seaborn and Jupyter for the notebook (pip install "pandas<3" matplotlib seaborn notebook). 2. The raw CSVs (raw_dataset/) are derived from the pharmacy's original POS Excel exports, which are not published because they contain personal data. The raw CSVs are provided as-is; generate_raw.py documents how they were produced. 3. Keep the folder layout as downloaded. From the dataset folder, run: python "processing script/generate_processed.py" This regenerates sales_processed.csv and stock_processed.csv in processed_dataset/ from the raw CSVs. 4. Open processed_dataset/EDA Notebook/EDA_Analysis.ipynb and run all cells to reproduce the exploratory figures. Full column definitions and known data characteristics are in README.md.
Institutions
- Binus UniversityJakarta, Jakarta