Hi all, please assist with potential guidance steps for the following.
I have two datasets, A and B. A contains of three variables: business name, product type and quantity sold. In B we have business name, product type, SKU (unique identifier of the purchase).
I would like to create a function that iterates over A and extracts a (sample) list of SKUs related to quantity for each row in A. For instance if business X offered z type of product 10 times (read 10 sales), would like to select say 7 items randomly. The number is provided as quantity in dataset A. That is assuming my POS does not capture specific SKUs when a sale happens.
I can provide more details and real data if not clear enough.
Thanks in advance.
Sample data can be found in the following link: Sample dataset A & B.xlsx - Google Sheets