excel数据透视

Before you can build a flexible pivot table, you might need to rearrange the data. For example, if the data has a separate column for each month’s sales, that won’t work well in a pivot table. You need to “unpivot” your data first. Here’s what that means, and 2 quick ways to unpivot Excel data.

在构建灵活的数据透视表之前,您可能需要重新排列数据。 例如,如果数据在每个月的销售额中都有一个单独的列,则在数据透视表中将无法正常工作。 您需要先“取消透视”数据。 这就是它的意思,还有2种取消Excel数据透视图的快速方法。

Excel仪表板 (Excel Dashboards)

First, a reminder that today, Thursday August 18th, is the last day to register for Mynda Treacy's highly-rated Excel dashboard course. Don't miss out – it well be a few months before the course opens again! You’ll learn how to create awesome dashboards, quickly and efficiently, and you’ll pick up other key Excel skills too.

首先,提醒一下,今天( 8月18星期四)是Mynda Treacy 备受好评的Excel仪表板课程的最后注册日期。 不要错过-距离课程重新开放还需要几个月的时间! 您将学习如何快速有效地创建出色的仪表板,并且还将学习其他关键的Excel技能。

枢纽是什么意思? (What Does Unpivot Mean?)

If your data has a separate column for each month’s sales, it already looks like a pivot table report. Instead of having a separate row for each month’s sales, each row contains 12 months of sales data. It looks good on the worksheet, but won’t work well in a pivot table.

如果您的数据在每个月的销售额中都有单独的列,则该数据看起来已经像是数据透视表报表。 每行包含12个月的销售数据,而不是每个月的销售都有单独的行。 在工作表上看起来不错,但在数据透视表中效果不佳。

When you build a pivot table from that data, there will be 12 different fields with sales amounts – one for each month. The pivot table won’t be able to automatically calculate an annual total. You would have to create a calculated field to add all the month values together.

当您从该数据构建数据透视表时,将有12个不同的字段,这些字段的销售额分别为每月一个。 数据透视表将无法自动计算年度总数。 您将必须创建一个计算字段以将所有月份值相加。

So, if the data already looks like a pivot table, we need to “unpivot” it, and put each sales amount on a separate row. Instead of a column for each month, all the dates should be in one column, and all the sales amounts in another column. Then, the pivot table can summarize the data, and show it in separate columns, or just show a grand total.

因此,如果数据已经看起来像数据透视表,则需要“取消数据透视”,并将每个销售金额放在单独的行中。 所有日期都应该在一个栏中,而不是每个月都在一个栏中,而所有销售额都应该在另一栏中。 然后,数据透视表可以汇总数据,并将其显示在单独的列中,或仅显示总计。

使用Get&Transform取消Excel数据 (UnPivot Excel Data With Get & Transform)

Do you have a version of Excel where Get & Transform is on the Data tab? Or, do you have Power Query installed? If so, you can use either of those tools to quickly unpivot Excel data.

您是否具有“数据”选项卡上“获取和转换”在其中的Excel版本? 或者,您是否安装了Power Query? 如果是这样,则可以使用这些工具中的任何一个来快速取消透视Excel数据。

To use this technique with Get & Transform:

将此技术与Get&Transform结合使用:

  • Select a cell in a named Excel table. (Or select a cell in a list, and it will be changed to a named Excel table) 在一个命名的Excel表中选择一个单元格。 (或在列表中选择一个单元格,它将被更改为一个命名的Excel表)
  • On the Ribbon, click the Data tab 在功能区上,单击“数据”选项卡
  • In the Get & Transform section, click the From Table command 在“获取和转换”部分中,单击“从表”命令
  • In the Query Editor, select all the columns that you want to group into one value field. In this example, all the month columns are selected. (Tip: Click on the first month column heading, then Shift+Click on the last month heading.) 在查询编辑器中,选择要分组为一个值字段的所有列。 在此示例中,所有月份列均被选中。 (提示:单击第一个月的列标题,然后按住Shift并单击最后一个月的标题。)
  • Right-click on one of the headings, and click Unpivot Columns 右键单击标题之一,然后单击“取消透视列”
  • The unpivotted data will appear in the Query Editor, with the heading names in an Attribute column, and the amounts in a Value column 未分配的数据将显示在“查询编辑器”中,标题名称显示在“属性”列中,金额显示在“值”列中
  • Then, click the Close and Load button, to return the data to a new Excel worksheet. 然后,单击“关闭并加载”按钮,将数据返回到新的Excel工作表。
  • You can use the new data set to create your pivot table. 您可以使用新的数据集来创建数据透视表。

NOTE: The unpivotted data is connected to the original data. If you update the original data, or add new records, they will automatically appear when you refresh the new, unpivotted data set.

注意:未引导的数据已连接到原始数据 。 如果您更新原始数据或添加新记录,则它们将在刷新新的未分配数据集时自动显示。

用宏取消透视Excel数据 (UnPivot Excel Data With a Macro)

If you don’t have Get & Transform or Power Query, or if you prefer not to use them for this task, you can use a macro instead.

如果没有Get&Transform或Power Query,或者不想在此任务中使用它们,则可以改用宏。

I’ve created an UnpivotData macro that you can use, if you don’t want to build your own. This macro is based on a trick that creates a Multiple Consolidation Range pivot table, then uses its Show Details feature to “unpivot” the data. For a simple data set, you could do this manually, and there are instructions here.

我已经创建了一个UnpivotData宏,如果您不想构建自己的宏,可以使用它。 该宏基于一个技巧,该技巧创建了多个合并范围数据透视表,然后使用其“显示详细信息”功能“取消数据透视”。 对于简单的数据集,您可以手动执行此操作,并且此处提供了说明 。

For data with more than one or two label fields, a macro will make the job much quicker. My UnpivotData macro will unpivot Excel data for you, as long as it meets a couple of minimum requirements:

对于具有一个或两个以上标签字段的数据,宏将使工作更快。 只要符合以下几个最低要求,我的UnpivotData宏就会为您取消Excel数据:

  • The data must be in a named Excel table

    数据必须在命名的Excel表中

  • Label columns (for your pivot table row, columns and filters), must be at the left, and value fields at the right. 标签列(对于数据透视表行,列和过滤器)必须在左侧,而值字段在右侧。
  • The macro puts all the value fields into one common field, so don’t use this macro if there are different types of values in the data, such as sales dollars, and unit counts. 该宏将所有值字段放入一个公共字段,因此,如果数据中存在不同类型的值(例如销售金额和单位计数),请不要使用此宏。

运行Unpivot Excel数据宏 (Running the Unpivot Excel Data Macro)

When the macro runs, it will ask you to enter a split character, so it can temporarily combine the label columns. Be sure to enter a character that is not used in your label columns, or the macro won't process the data correctly.

宏运行时,将要求您输入一个拆分字符,以便它可以临时组合标签列。 确保输入标签列中未使用的字符,否则宏将无法正确处理数据。

Next, you will asked to enter the number of label columns in your data.

接下来,将要求您在数据中输入标签列数。

This macro will leave the original data untouched, and it creates a new workbook with an unpivotted data set that you can copy to another location.

该宏将保持原始数据不变,并创建一个具有未分配数据集的新工作簿,您可以将其复制到另一个位置。

NOTE: The new data is meant to replace the old data, moving forward. The two data sets are not connected, and if you update one, it will not automatically update the other.

注意:新数据将替换旧数据,并向前发展。 这两个数据集未连接 ,并且如果更新其中一个,它将不会自动更新另一个。

下载样本文件 (Download the Sample File)

To test the Unpivot Excel Data macro, you can download the sample file from my website.

要测试Unpivot Excel Data宏,可以从我的网站下载示例文件 。

That link takes you to the Unpivot Excel Data Macro page, where there are a few more details on how the macro works. Then, scroll down to the Download Sample File section, and you'll see the link for the sample file.

该链接将带您到Unpivot Excel数据宏页面,该页面提供了有关宏如何工作的更多详细信息。 然后,向下滚动到“下载示例文件”部分,您将看到示例文件的链接。

The zipped file is in xlsm format, and be sure to enable macros when you open the file. It has an “unpivotted” table that you can use for your test.

压缩文件为xlsm格式,打开文件时请确保启用宏。 它具有一个“未分配”表,可用于测试。

翻译自: https://contexturesblog.com/archives/2016/08/18/quick-ways-unpivot-excel-data/

excel数据透视


http://www.taodudu.cc/news/show-5682062.html

相关文章:

  • C#使用NPOI实现Excel数据透视
  • 简单实现POI操作Excel生成数据透视图
  • 比较Excel数据透视图中的年度数据
  • 80行python代码查询你想要的英雄信息
  • pyecharts制图笔记
  • 手机必备epub阅读软件
  • 2016.03.20
  • 酷狗音乐html5韩国,韩国SHOFAR MUSIC独家入驻酷狗 脸红的思春期掀收听热
  • 年底了是时候学新技术了「GitHub 热点速览 v.21.52」
  • 你的电脑适合升级 Win11 吗?「GitHub 热点速览 v.21.26」
  • 《暗黑破坏神2》重置版 采访记录(一)
  • 远程文件拷贝(fastcopy为例)
  • 一个复制也能玩出花来
  • 鼠标灵敏度怎么调?Mac系统调整鼠标灵敏度教程
  • C#修改系统的鼠标移动速度
  • win7玩游戏时不能全屏该怎么解决
  • openni.utils.InitializationError: OpenNI2 could not be loaded:
  • java使用bytebuddy动态生成带泛型的DTO
  • 编码解码与文件操作
  • TGY_Windows 8.1 x64 企业版(集成Office2013)
  • 理解volatile关键字
  • 酷狗小试页面和简写代码
  • 由酷狗官网界面改造成的焦点新闻插件
  • 仿酷狗官网新闻焦点图插件
  • 一个90后做游戏的女生自白
  • 十年前的java游戏_十年前那些你玩过的手机游戏,现在都去哪儿了?
  • 最新游戏上线(女生版)
  • java打飞机小游戏(跟着网上视频写到)
  • 创意低俗?摸腿游戏
  • android打不出字母来,英雄联盟游戏里打不了字-不能打字解决方法

excel数据透视_取消透视Excel数据的快速方法相关推荐

  1. excel 重复方差分析_如何在Excel中运行方差方差分析的两种方法

    excel 重复方差分析 Recently, we looked at how to Perform a One-Way Analysis of Variance in Excel. In today ...

  2. html表格里的超链接点不了,Excel如何添加和取消超链接 Excel超链接打不开是怎么回事...

    很多用户在制作excel表格的时候都会添加一些超链接,在制作完成后发布到网页,阅读者可以通过超链接打开指引的网页或者文件,超链接对制作excel表格的用户有非常大的帮助,虽然添加超链接的步骤非常简单, ...

  3. c#后台如何导出excel到本地_小程序导出数据到excel表,借助云开发后台实现excel数据的保存...

    我们在做小程序开发的过程中,可能会有这样的需求,就是把我们云数据库里的数据批量导出到excel表里.如果直接在小程序里写是实现不了的,所以我们要借助小程序的云开发功能了.这里需要用到云函数,云存储和云 ...

  4. lisp倒入excel数据画图_如何将EXCEL中的数据导入到CAD中,绘制成曲线|

    如何将EXCEL中的数据导入到CAD中,绘制成曲线 如果不用软件,只用CAD自身功能的话可以通过多段线生成你需要的曲线.你给出你的曲线函数,我给你生成曲线坐标以及CAD能自动绘制的文件格式 怎样将ca ...

  5. excel mysql插件_智分析Excel插件

          智分析Excel插件官方版是一款好用的自助分析云平台,智分析Excel插件官方版是一款面向业务用户的EXCEL插件工具,智分析Excel插件官方版支持各类云端数据库.本地excel数据导入 ...

  6. 如何让图片充满excel单元格_如何在Excel单元格建立下拉菜单

    对于一些常用的数据我们往往会希望能够尽量快速的输入,下拉菜单就是一个最简单的解决办法.那么如何实现下拉菜单呢?跟随以下步骤,建立属于自己的下拉菜单吧! 如何建立下拉菜单? 一.确定内容:在单元格中,输 ...

  7. react 数据可视化_使用d3创建数据可视化并在2020年做出React

    react 数据可视化 Data visualisation and application technologies have evolved greatly over the past decad ...

  8. excel切片器_不喜欢Excel自带的切片器样式,我一秒设置个性化切片器

    一般在excel中插入的切片器都是默认样式的,即使根据自带模板修改之后也不是很满意的话,小编来教大家设置自己的切片器吧! 库存切片器 第一步:插入切片器 第二步:选择产品名称确定,更改产品名称后实时显 ...

  9. excel冻结窗口_你会Excel吗?14个Excel神奇功能+8个Excel小技巧+Excel常见快捷键,提升办公效率...

    14个Excel神奇功能+8个Excel小技巧+Excel常见的一些快捷键,让你的Excel技能6得飞起,每天都能提前2小时下班. 14个Excel神奇功能 一.<Excel如何快速还原隐藏行& ...

最新文章

  1. 来客推开源商城与你浅析:B2B2C多商户商城系统
  2. 黄学东出任微软全球人工智能首席技术官,从负责语音技术到微软Azure云的转身
  3. php 实现查询百度排名,PHP实现获取百度top50的搜索排行关键字
  4. CIW《操作系统安全》目录
  5. 番茄花园 Ghost XP SP3 金秋国庆版 2013.AA0
  6. mysql事务的 四个特征(ACID)
  7. 将Centos的yum源更换为阿里云源
  8. 沟通艺术-善于揣摩对方心思,才能把话说到心坎上
  9. Pytorch——搭建深度神经网络的基本流程
  10. operator 模块详解
  11. 卧槽,又来一个 Java 神器!!
  12. BinaryViewer(二进制查看器)使用教程(附下载)
  13. X79寨板远程启动计算机,X79旗舰主板评测
  14. 最完整的国内手机号段
  15. (基于matlab)蒙特卡罗法 之 布丰投针实验 (1/10)
  16. Python faker模块
  17. 【爬虫实战】01利用python爬虫并进行数据分析(链家 爬虫)
  18. uniapp之小程序端生成分享海报(带自定义参数的二维码)
  19. 广东迅视资管 别让“顺风车”再度行驶至安全边缘
  20. APP加固案例:慈溪农村商业银行

热门文章

  1. 突破百度云大文件下载限制
  2. 英雄连2一直显示连接relic服务器,《英雄连2》修复please wait导致无法进入游戏的解决办法...
  3. asp.net早餐订购系统
  4. 9E技术员家园注册码;a266
  5. html 重置画布坐标系,html5实现清空画布的三种方法
  6. 软考排序算法时间复杂度和稳定性助记
  7. 服务器如何设置不进入休眠状态吗,WIN7如何设置不进入休眠状态
  8. Mysql安装部署及语法汇总
  9. 出行神器“微图APP”主界面功能概述
  10. python中的double 型数据_Python的基本数据类型