我要为每个项目执行SUM后计算2组分组数据的百分比
我有一个如下表:
project Program hours
1 direct 6
1 indirect 4
2 direct 4
2 indirect 4
1 direct 6
2 indirect 4
2 direct 8
1 indirect 4
我想首先根据每个项目的程序类型(直接或间接)获得小时总数
project Program hours
1 direct 12
1 indirect 8
2 direct 12
2 indirect 12
然后我要计算每个项目的程序百分比
project Program hours
1 direct 60%
indirect 40%
2 direct 50%
indirect 50%
谢谢!