简体   繁体   English

Excel数据透视表小计/行层次结构的问题

[英]Issue with Excel Pivot Table Subtotals / Row Hierarchy

I currently have a pivot table with three row labels. 我目前有一个带有三个行标签的数据透视表。 The data in the row labels is grouped as follows: 行标签中的数据分组如下:

Customer   SKU   Grouping  YTD   PrevYTD    
  123      ABC    Qty       30      20
                  Sales    500     400  

           DEG    Qty      100     150 
                  Sales    1,000   2,000

The YTD and PrevYTD are columns and the values. YTDPrevYTD是列和值。

I can do a custom subtotal on the 'Grouping' field and choose Sum and it gives me the totals at the end of the report: 我可以在“分组”字段中执行自定义小计,然后选择“总和”,它会在报告结尾处显示总计:

                 Qty Sum   130      170
                 Sales Sum 1,500    2.400

This is good to this point, but I also want to have subtotals by customer. 这点很好,但我也希望客户有小计。 What I want to see is the same breakdown under each customer (a total of Qty and a total of Sales) but I cannot get this subtotal to work. 我想看到的是每个客户下的相同细分(总共数量和销售总额),但我无法得到这个小计。 When I put a subtotal on the Customer field, it puts a oneline subtotal and is adding the Qty and the Sales together. 当我在Customer字段上放置一个小计时,它会放置一个oneline小计,并将数量和销售额加在一起。 In this example if I put a subtotal on Customer This is what it will display: 在这个例子中,如果我在客户上放置一个小计这是它将显示的内容:

      123 Total             1630    2570

Is this possible to do what I am looking for? 这有可能做我想要的吗?

Thanks for the help! 谢谢您的帮助!

How about making Grouping a column label instead? 如何组合一个列标签呢? It will change the layout somewhat but will allow you to get the effect you are after. 它会稍微改变布局,但会让你获得你想要的效果。

To do this you need to use a second pivot table. 为此,您需要使用第二个数据透视表。 It's easier to do it with the tables side-by-side, but you can do it with a table underneath by just deleting the second table and inserting a new pivot table after the last row of the first each time the first table is changed. 使用表并排更容易,但是您可以使用下面的表来执行此操作,只需删除第二个表,并在每次更改第一个表时在第一行的最后一行之后插入新的数据透视表。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM