Skip to Content
Tableau Prep即学即用
book

Tableau Prep即学即用

by Carl Allchin
August 2022
Beginner to intermediate
463 pages
9h 22m
Chinese
China Electric Power Press Ltd.
Content preview from Tableau Prep即学即用
110
13
将列转为行
我是在
20
世纪
90
年代长大的,所以当我听到
pivot
(转换)这个词时,我脑海中立
刻跳出的画面,是
Friends
(老友记)中的角色们,正在试图把
Ross
的沙发搬上蜿
蜒的公寓楼梯。
我们在第
4
章中首次讨论了转换数据(不是楼梯间的沙发)。本章将在该讨论的基
础上,探讨何时以及如何在
Prep Builder
中将列数据转换为行数据。这种类型的数
据转换也被称为转置。
13.1
何时在
Tableau Prep Builder
中进行数据
转换
Tableau Desktop
需要将数据放在结构化的列中。每一列可以容纳一种类型的数据,
并且可以在
Desktop
功能区或卡片上使用,以改变屏幕上显示的视图。相应地,转换
的一个常见场景是当你要为数据集中的每个新日期添加一个新列时(见图
13-1
)。
13
-
1
:每个月为数据集添加新列
111
将列转为行
13-2
中的数据结构不是很好,有两个原因。第一,如果想让日期显示在
x
时间轴
上,就不能用这个结构来做,因为你需要用一列来存放所有不同的日期,另一列来
存放每个日期的所有相关值。第二,如果文件更新了,
Tableau Desktop
不会自动将
新列添加到你的分析中。如果新数据以附加行的形式出现,反而会被包含在视图中
(只要
Desktop
能够读取它)。图
13-2 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

深度学习:核心原理与案例分析

深度学习:核心原理与案例分析

Posts & Telecom Press, Ahmed Menshawy
Python金融实战

Python金融实战

Posts & Telecom Press, Yuxing Yan
Python机器学习案例精解

Python机器学习案例精解

Posts & Telecom Press, Yuxi (Hayden) Liu
HBase管理指南

HBase管理指南

Posts & Telecom Press, Yifeng Jiang

Publisher Resources

ISBN: 9787519864439