Displaying 1 result from an estimated 1 matches for "accumulated_sales".
2017 Sep 08
0
need help for finding related sales with R
...group_by(Sales_department, sales_manager, Client) %>%
summarise("Clients_cost" = sum(Cost,na.rm = TRUE)) %>%
arrange(sales_manager, desc(Clients_cost)) %>%
group_by(sales_manager) %>%
mutate("total_sales_of_a_manager" = sum(Clients_cost),
"Accumulated_sales" = cumsum(`Clients_cost`),
"Accumulated_sales_share" =
Accumulated_sales/total_sales_of_a_manager)
%>%
ungroup() %>%
mutate("managers_ABC = if_else(Accumulated_sales_share < 0.8, "A",
if_else(Accumulat...