hello guys ,
So i have a dataset ("mydf") have 3 columns month, reseller name and net sales , I'm trying to see for each client it's highest net sales in every month.
i found a solution but it's really slow , i had first filter for only specific month and as you can see in my code select the top n ...
any solution to speed this up , please ?
mydf <- read.csv("C:/Users/HmissiOm/Downloads/my_df.csv")
mydf202101 <- mydf[mydf$month == 202101,]
mydf202101 %>% group_by(mydf202101$Reseller_name) %>%
top_n(1, Net_Sales)