2024: Week 44 - MiniBytes Returns Analysis
Challenge by: Jessica Kirk
MiniBytes were really happy with the analysis last week on worst performing products. This week they'd like us to look into the returns data so that they can better prepare for how much needs to be set aside for each month for returned items.
They have warned that there has been an issue with the returns systems that means some of the return and sale dates for particular items are in the wrong order (i.e. the sales date has been input as the return date).
Input
We've been provided with a small subset of data to build the logic from again:
Requirements
- Input the data
- For all cases where the Date Sold is after the Date Returned, swap the values in these fields
- Calculate the number of days between the Date Sold and Date Returned
- For returns within 60 days, customers get a full refund. For returns between 60 and 100 days, customers will be refunded half (rounded to the nearest penny). Returns after 100 days are not refunded
- MiniBytes want one output to be able to see, for each month:
- Revenue (i.e. total amount through sales)
- Total Returns Value (Refunds are counted in the month the return happens)
- Number of Returns (in that month, regardless of Date Sold)
- Avg Days to Return (for items returned that month)
- All values should be rounded to 2 decimal places
- Output the data
Output
- 5 fields
- Date
- Revenue
- Total Returns
- Number of Returns
- Avg Days to Return
- 12 rows
After you finish the challenge make sure to fill in the participation tracker, then share your solution on Twitter using #PreppinData and tagging @Datajedininja, @JennyMartinDS14 & @TomProwse1
You can also post your solution on the Tableau Forum where we have a Preppin' Data community page. Post your solutions and ask questions if you need any help!