Google Sheet 枢轴 Table 上的小计显示错误的总和
Sub Total on Google Sheet Pivot Table Shows the Wrong Sum
所以,我在 google 表中用计算公式做了一个枢轴 table
但不知何故,每个客户的小计显示错误
我一直使用的总收入代码就是这个;
=IF((business_initiated+user_initiated)>=1000;($C*business_initiated+$D*user_initiated);0)
我一直在使用的 Total Invoice 代码就是这个;
=IF((business_initiated+user_initiated)>=1000;IF(($C*business_initiated+$D*user_initiated)<0;0;($C*business_initiated+$D*user_initiated));500000)
client
month
Total Business Initiated
Total IDR
Total User Initiated
Total IDR
Total Message
Total Income
Total Invoice
A
1
3.880
Rp1.437.462
668
Rp0
4.548
Rp454.800
Rp1.805.397
A
2
3.416
Rp1.265.560
550
Rp0
3.966
Rp396.600
Rp1.568.500
A
3
6.007
Rp2.225.473
699
Rp0
6.706
Rp670.600
Rp2.610.483
A
4
4.473
Rp1.657.157
645
Rp0
5.118
Rp511.800
Rp2.012.423
A
5
15.292
Rp5.665.380
2.380
Rp1.310.904
17.672
Rp1.767.200
Rp6.976.284
A
6
15.898
Rp5.889.891
914
Rp0
16.812
Rp1.681.200
Rp6.393.322
Total
48.966
Rp18.140.924
5.856
Rp3.225.485
54.822
Rp5.482.200
Rp21.366.408
B
5
0
Rp0
569
Rp0
569
Rp0
Rp500.000
B
6
1.749
Rp647.970
1.400
Rp771.120
3.149
Rp314.900
Rp1.419.090
Total
1.749
Rp647.970
1.969
Rp1.084.525
3.718
Rp371.800
Rp1.732.495
C
1
0
Rp0
1
Rp0
1
Rp0
Rp500.000
C
2
0
Rp0
1
Rp0
1
Rp0
Rp500.000
C
3
0
Rp0
1
Rp0
1
Rp0
Rp500.000
C
4
0
Rp0
1
Rp0
1
Rp0
Rp500.000
Total
0
Rp0
4
Rp0
4
Rp0
Rp500.000
这是预期的结果;
client
month
Total Business Initiated
Total IDR
Total User Initiated
Total IDR
Total Message
Total Income
Total Invoice
A
1
3.880
Rp1.437.462
668
Rp0
4.548
Rp454.800
Rp1.805.397
A
2
3.416
Rp1.265.560
550
Rp0
3.966
Rp396.600
Rp1.568.500
A
3
6.007
Rp2.225.473
699
Rp0
6.706
Rp670.600
Rp2.610.483
A
4
4.473
Rp1.657.157
645
Rp0
5.118
Rp511.800
Rp2.012.423
A
5
15.292
Rp5.665.380
2.380
Rp1.310.904
17.672
Rp1.767.200
Rp6.976.284
A
6
15.898
Rp5.889.891
914
Rp0
16.812
Rp1.681.200
Rp6.393.322
Total
48.966
Rp18.140.924
5.856
Rp3.225.485
54.822
Rp5.482.200
Rp21.366.408
B
5
0
Rp0
569
Rp0
569
Rp0
Rp500.000
B
6
1.749
Rp647.970
1.400
Rp771.120
3.149
Rp314.900
Rp1.419.090
Total
1.749
Rp647.970
1.969
Rp1.084.525
3.718
Rp371.800
Rp1.919.090
C
1
0
Rp0
1
Rp0
1
Rp0
Rp500.000
C
2
0
Rp0
1
Rp0
1
Rp0
Rp500.000
C
3
0
Rp0
1
Rp0
1
Rp0
Rp500.000
C
4
0
Rp0
1
Rp0
1
Rp0
Rp500.000
Total
0
Rp0
4
Rp0
4
Rp0
Rp2000.000
所以,基本上如果每个月的消息总数少于1000。收入收入将是Rp0,Total Invoice将是Rp500000。
但是如果总收入为 0 且总发票为 Rp500000,则小计无法正确显示。
有没有人知道如何解决这个问题?非常感谢。
编辑(已解决):
我相信我们无法在 Pivot Table 计算字段中使用更复杂的公式。因此,与其在枢轴内部使用复杂公式 Table,不如在枢轴外部应用它然后解决问题。
没关系。我分别为每个收入和发票创建了一个新列。所以,最后,我可以对公式使用相同的原则。经过一番挖掘,我相信枢轴 Table 计算字段有些不同,因为您不能对计算公式做太多事情。
所以,我在 google 表中用计算公式做了一个枢轴 table 但不知何故,每个客户的小计显示错误
我一直使用的总收入代码就是这个;
=IF((business_initiated+user_initiated)>=1000;($C*business_initiated+$D*user_initiated);0)
我一直在使用的 Total Invoice 代码就是这个;
=IF((business_initiated+user_initiated)>=1000;IF(($C*business_initiated+$D*user_initiated)<0;0;($C*business_initiated+$D*user_initiated));500000)
client | month | Total Business Initiated | Total IDR | Total User Initiated | Total IDR | Total Message | Total Income | Total Invoice |
---|---|---|---|---|---|---|---|---|
A | 1 | 3.880 | Rp1.437.462 | 668 | Rp0 | 4.548 | Rp454.800 | Rp1.805.397 |
A | 2 | 3.416 | Rp1.265.560 | 550 | Rp0 | 3.966 | Rp396.600 | Rp1.568.500 |
A | 3 | 6.007 | Rp2.225.473 | 699 | Rp0 | 6.706 | Rp670.600 | Rp2.610.483 |
A | 4 | 4.473 | Rp1.657.157 | 645 | Rp0 | 5.118 | Rp511.800 | Rp2.012.423 |
A | 5 | 15.292 | Rp5.665.380 | 2.380 | Rp1.310.904 | 17.672 | Rp1.767.200 | Rp6.976.284 |
A | 6 | 15.898 | Rp5.889.891 | 914 | Rp0 | 16.812 | Rp1.681.200 | Rp6.393.322 |
Total | 48.966 | Rp18.140.924 | 5.856 | Rp3.225.485 | 54.822 | Rp5.482.200 | Rp21.366.408 | |
B | 5 | 0 | Rp0 | 569 | Rp0 | 569 | Rp0 | Rp500.000 |
B | 6 | 1.749 | Rp647.970 | 1.400 | Rp771.120 | 3.149 | Rp314.900 | Rp1.419.090 |
Total | 1.749 | Rp647.970 | 1.969 | Rp1.084.525 | 3.718 | Rp371.800 | Rp1.732.495 | |
C | 1 | 0 | Rp0 | 1 | Rp0 | 1 | Rp0 | Rp500.000 |
C | 2 | 0 | Rp0 | 1 | Rp0 | 1 | Rp0 | Rp500.000 |
C | 3 | 0 | Rp0 | 1 | Rp0 | 1 | Rp0 | Rp500.000 |
C | 4 | 0 | Rp0 | 1 | Rp0 | 1 | Rp0 | Rp500.000 |
Total | 0 | Rp0 | 4 | Rp0 | 4 | Rp0 | Rp500.000 |
这是预期的结果;
client | month | Total Business Initiated | Total IDR | Total User Initiated | Total IDR | Total Message | Total Income | Total Invoice |
---|---|---|---|---|---|---|---|---|
A | 1 | 3.880 | Rp1.437.462 | 668 | Rp0 | 4.548 | Rp454.800 | Rp1.805.397 |
A | 2 | 3.416 | Rp1.265.560 | 550 | Rp0 | 3.966 | Rp396.600 | Rp1.568.500 |
A | 3 | 6.007 | Rp2.225.473 | 699 | Rp0 | 6.706 | Rp670.600 | Rp2.610.483 |
A | 4 | 4.473 | Rp1.657.157 | 645 | Rp0 | 5.118 | Rp511.800 | Rp2.012.423 |
A | 5 | 15.292 | Rp5.665.380 | 2.380 | Rp1.310.904 | 17.672 | Rp1.767.200 | Rp6.976.284 |
A | 6 | 15.898 | Rp5.889.891 | 914 | Rp0 | 16.812 | Rp1.681.200 | Rp6.393.322 |
Total | 48.966 | Rp18.140.924 | 5.856 | Rp3.225.485 | 54.822 | Rp5.482.200 | Rp21.366.408 | |
B | 5 | 0 | Rp0 | 569 | Rp0 | 569 | Rp0 | Rp500.000 |
B | 6 | 1.749 | Rp647.970 | 1.400 | Rp771.120 | 3.149 | Rp314.900 | Rp1.419.090 |
Total | 1.749 | Rp647.970 | 1.969 | Rp1.084.525 | 3.718 | Rp371.800 | Rp1.919.090 | |
C | 1 | 0 | Rp0 | 1 | Rp0 | 1 | Rp0 | Rp500.000 |
C | 2 | 0 | Rp0 | 1 | Rp0 | 1 | Rp0 | Rp500.000 |
C | 3 | 0 | Rp0 | 1 | Rp0 | 1 | Rp0 | Rp500.000 |
C | 4 | 0 | Rp0 | 1 | Rp0 | 1 | Rp0 | Rp500.000 |
Total | 0 | Rp0 | 4 | Rp0 | 4 | Rp0 | Rp2000.000 |
所以,基本上如果每个月的消息总数少于1000。收入收入将是Rp0,Total Invoice将是Rp500000。
但是如果总收入为 0 且总发票为 Rp500000,则小计无法正确显示。
有没有人知道如何解决这个问题?非常感谢。
编辑(已解决): 我相信我们无法在 Pivot Table 计算字段中使用更复杂的公式。因此,与其在枢轴内部使用复杂公式 Table,不如在枢轴外部应用它然后解决问题。
没关系。我分别为每个收入和发票创建了一个新列。所以,最后,我可以对公式使用相同的原则。经过一番挖掘,我相信枢轴 Table 计算字段有些不同,因为您不能对计算公式做太多事情。