简体   繁体   English

通过Excel Pivot表中的另一个行字段保留行字段的顺序

[英]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: 因此情况如下:

  1. We have two row fields: one containing some measures and the other containing their order. 我们有两个行字段:一个包含一些度量,另一个包含其顺序。

  2. In the pivot table, the order field is put before the measure field to preserve the correct order of the measure field. 在数据透视表中,顺序字段放在度量字段之前,以保留度量字段的正确顺序。

  3. 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: 所以基本上我想:

  1. Preserve ordering of measure field while hiding order field before adding the calculated item at the end. 在最后添加计算项目之前,隐藏订单字段时保留度量字段的排序。

  2. 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.

相关问题 在 Excel Pivot 表中使用 Count 字段作为一行 - Use a Count field as a row in Excel Pivot table Excel Pivot表:仅基于组的第一行的计算字段 - Excel Pivot table: Calculated field based on only the first row of a group Excel数据透视表在计算字段中排除一行 - Excel Pivot Table Exclude one Row in Calculated Field Excel数据透视表问题-如何获取行区域字段的小计? - Excel pivot table question - How to get subtotals for a row area field? Excel Pivot表Column and Row字段列表中的dax公式 - Dax formula in Excel Pivot table Column and Row field list 为什么我的Excel Power Pivot无法在ROW字段中保持手动重新排列的项目的顺序? - Why is my Excel Power Pivot not maintaining the order of the manually re-arranged items in my ROW field? 列出第二行字段(多个行字段)的excel枢纽项目,并在第一行字段中给出特定的枢纽项目 - List excel pivot items of the second row field (multiple row fields) given a particular pivot item in the first row field Excel数据透视表 - 使用与行和列标签相同的字段 - Excel Pivot Tables - Use same field as row and column label 使用 VBA 控制 Excel 数据透视表字段列表中元素的顺序 - Using VBA to control the order of elements in an Excel Pivot Table Field List Excel 数据透视表行标签 - Excel Pivot Table Row labels
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM