使用SUM和COUNT个字段数据透视表创建计算字段 [英] Creating Calculated Field with SUM and COUNT of Fields Pivot Table
问题描述
这是我的数据透视表的快照.
Here's a snapshot of my pivot table.
我想创建一个计算字段,以显示 与在G列中一样,在 Ticket#列(B)上的 Responded 列(C).
I want to create a calculated field that displays the percentage from the Responded column (C) over the Ticket # column (B) as in column G.
Ticket#列是一列值文本字符串(例如413456、464313),而 Responded 列是1和0的列表.在我的数据透视表中,我将计算所有票证编号和被响应者的总和.
The Ticket # column is a column of value text strings (e.g. 413456, 464313) and the Responded column is a list of 1's and 0's. In my pivot table I am taking the count of all Ticket # and the sum of the Responded.
我尝试使用以下公式创建计算字段
I tried to create a calculated field with the following formula
=Responded/COUNT('Ticket #')
但这给了我与响应总数相同的信息.如何创建一个计算字段,该字段为我提供G列中的%?
but this gave me the same as Sum of Responded. How can I create a calculated field that gives me the % in column G?
推荐答案
根据我的经验以及另一位SO成员发布的内容,COUNT
在数据透视表字段计算中似乎效果不佳.通过在数据源中创建一个1和0的帮助器列,我设法计算出不同的故障单. (感谢Siddarth Rout的此响应.)
From my experience and what another SO member posted, COUNT
doesn't seem to work well in pivot table field calculations. I managed to count the distinct tickets by creating a helper column of 1's and 0's in my data source. (Thanks to this response from Siddarth Rout.)
一旦您将1与每个不同的票证相关联,我只需使用Responded/Ticket #
创建计算所得.
Once you have 1's associated with each distinct tickets, I simply created the calculated with Responded/Ticket #
.
这篇关于使用SUM和COUNT个字段数据透视表创建计算字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!