[英]Preserve order of row field by another row field in Excel Pivot table
I'm trying to customize an excel pivot table. 我正在尝试自定义Excel数据透视表。
So the situation is as follows: 因此情况如下:
We have two row fields: one containing some measures and the other containing their order. 我们有两个行字段:一个包含一些度量,另一个包含其顺序。
In the pivot table, the order field is put before the measure field to preserve the correct order of the measure field. 在数据透视表中,顺序字段放在度量字段之前,以保留度量字段的正确顺序。
The problem is : -on removing the order field, the order of the measure field is removed. 问题是:-在删除订单字段时,将删除度量字段的订单。 -on not keeping order filed and adding a calculated item to the measure field , it is duplicated for each measure since it doesn't have a value in the order field. -在不保留订单并将计算的项目添加到度量字段的情况下,由于每个度量都没有订单字段中的值,因此将为每个度量复制该项目。
So basically I want to either: 所以基本上我想:
Preserve ordering of measure field while hiding order field before adding the calculated item at the end. 在最后添加计算项目之前,隐藏订单字段时保留度量字段的排序。
Show both fields (order and measure) but on adding the calculated item, a default value to be added for the order field for this new item. 显示两个字段(订单和度量),但是在添加计算项目时,将为此新项目的订单字段添加默认值。
The source of data is from an external query. 数据源来自外部查询。
Sorry, my bad, the last answer I gave did not work. 抱歉,我的回答不好,我给出的最后一个答案无效。
This does: in the pivot table field list panel at the right hand side. 这样做是:在右侧的数据透视表字段列表面板中。 In the rows area, click on the order field drop down arrow, and choose field settings. 在行区域中,单击订单字段下拉箭头,然后选择字段设置。 Then in the layout and print tab click "Show item labels in outline form and uncheck the display labels from the next field in the same column. 然后,在布局和打印选项卡中,单击“以大纲形式显示项目标签,然后取消选中同一列中下一字段的显示标签。
Note that in the same tab you should check "Repeat item labels" this will cause the order to be repeated for every row. 请注意,在同一选项卡中,应选中“重复项目标签”,这将导致每行重复执行该顺序。 (Which I think is what you are asking about for the calculated field) (我认为这是您要查询的计算字段)
This will put the order field in it's own column. 这会将订单字段放在其自己的列中。 You can then hide the column to stop it displaying to the user. 然后,您可以隐藏该列以停止向用户显示。 Note that it is possible to set the sort order for each column independently of the other, but clicking on each column then setting the sort order as usual. 注意,可以为每个列彼此独立地设置排序顺序,但是单击每个列然后照常设置排序顺序。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.