对具有特定条件的每列块进行计数
我有 2 个主要栏“员工编号”和“销售代理编号”。每个员工可以有 1 个或多个与其关联的销售代理,并且特定员工下的每个销售代理都有一定的奖金分配。现在,我正在尝试计算第四列Final_bonus_split,该列中的值是每个员工人数各自代理奖金的权重。例如,如下所示:
Emp# Sales_Agent# Bonus_Split Final_bonus_split
1000 123 10% =10/(10+25+30) = 15%
1000 345 25% =25/(10+25+30) = 38%
1000 987 30% =30/(10+25+30) = 47%
2000 123 10% =10/10 = 100%
3000 345 50% =50/(50+15) = 77%
3000 647 15% =15/(50+15) = 23%
4000 634 40% =40/40 = 100%
我目前正在使用 2 个辅助列来执行此操作,但想知道是否可以仅使用单个列来执行此操作。
I have 2 main columns Employee Number and Sales agent number. Each Employee can have 1 or more sales agents associated with them, and each of these sales agents under a particular employee have a certain bonus split. Now, I'm trying to calculate a fourth column Final_bonus_split, with the values in this column being a weight of their respective agents bonuses per every employee number. For example, as follows:
Emp# Sales_Agent# Bonus_Split Final_bonus_split
1000 123 10% =10/(10+25+30) = 15%
1000 345 25% =25/(10+25+30) = 38%
1000 987 30% =30/(10+25+30) = 47%
2000 123 10% =10/10 = 100%
3000 345 50% =50/(50+15) = 77%
3000 647 15% =15/(50+15) = 23%
4000 634 40% =40/40 = 100%
I'm currently doing this using 2 helper columns, but was wondering if it's possible to do this using just a single column.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这就是您正在寻找的吗:
Is that what you are looking for: