获取数据透视表中组合的百分比 [英] Get percentage of group total in PivotTable
问题描述
如何添加计算字段以显示每组中死亡人数的百分比(例如22/59的37%)?
在值字段设置中有显示值为:%,但这是所有患者的百分比。
具有如下布局:
在PT中选择一个单元格,并在数据透视表工具>选项>工具 - 公式,计算字段...中添加名称:例如 PerCent
和公式:选择年龄段最大
和插入字段,确定。
然后返回到Σ值
以及值字段设置中的PerCent计数... 和显示值选择%行
:
对于某些格式化PT的顶部可能看起来像这样:
。
I have a few thousands patients, which are grouped by age in a pivot table (from 0-9, 10-19,...). The first group for example has 59 patients in total, of which 22 are dead.
How can I add a Calculated Field to show percentages of dead people within each group total (eg 37% for 22/59)?
In Value Field Settings there is something like "Show Value as: %" but that is percentage of all patients.
With a layout such as:
select a cell in the PT and in PivotTable Tools > Options > Tools - Formulas, Calculated Field... add a Name: such as PerCent
and for Formula: select Age band Max
and Insert Field, OK.
Then return to Σ Values
and for Count of PerCent in Value Field Settings... and Show values as select % of row
:
With some formatting the top of the PT might look something like this:
.
这篇关于获取数据透视表中组合的百分比的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!