completejourney
completejourney copied to clipboard
Some product-store-week combinations are associated with 2 rows in "promotions" table
Some product-store-week combinations are associated with 2 rows in "promotions" table instead of 1 making it unclear whether these two promotional strategies were both applied simultaneously during this week or one after the other. Therefore, it is not possible to uniquely merge "promotions" with "transactions".
# count the number of different promotions for each product-store-week combination
promotions_agg<-promotions%>%
group_by(product_id,store_id,week)%>%
summarise(n=n())
# identify products for which there were several different promotions that week
promotions_agg$product_id[promotions_agg$n>1]
Yeah, we had to aggregate the promotion data to make it of reasonable size. This required the data to be bucketed by weeks rather than days. So, for these promotions, you can assume that for part of the week they were on display in one location and then moved to the alternative display location later that week.