IRPD: Indonesian Retail Pharmacy Sales and Stock Transaction Dataset (2023–2025)

Published: 12 October 2026| Version 2 | DOI: 10.17632/w6zjtdjk9m.2
Contributors:
Davon Perry Nugroho,
,
,

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, personal names anonymized. - raw_dataset/stock_raw.csv: 804,027 rows, 15 columns. Values as exported, personal names anonymized. - 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 and file guide. 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 the supplier name in brackets. - 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), so processed stock levels combine both. PRIVACY: Cashier, patient, doctor and salesperson names, and patient names in stock transaction descriptions, were replaced with anonymized codes (e.g., Cashier_001, Patient_001). The mapping to real names is not included. There is no cost or purchase-price data; PriceTier is a categorical code for the selling-price tier. Version 2: patient names removed from the free-text description in stock_raw.csv; corrections to Unit, transaction type, negative stock levels and ShiftPeriod in the processed files; scripts, README and notebook updated.

Files

Steps to reproduce

1. Install Python 3.13.0 and pandas. 2. The raw CSVs 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. 3. Place generate_processed.py in the same folder as raw_dataset/ and run it. It regenerates sales_processed.csv and stock_processed.csv in processed_dataset/. 4. Open EDA_Analysis.ipynb to reproduce the exploratory figures. Full column definitions are in README.md.

Institutions

Categories

Pharmacy, Time Series

Licence