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即学即用
259
处理多余字符
字符串
字符串是非常灵活的数据类型,因此如果用多余字符导入,一般不会引起错误。
唯一的例外是在数据源或
Tableau Prep
允许的字符之外使用了某个字符,例如
某些非英文字母的字符。
数据准备中最常见的多余字符是卑微的空格。字符之间的空格很容易被发现,但
对于前导空格或尾部空格(即字符串开头或结尾处的空格)就不是这样了。在
LEFT()
RIGHT()
MID()
SPLIT()
等字符串函数中,这些空格仍然算作字符,因
此它们会在大多数常见的字符串数据准备步骤中引起问题。
29.2
多余字符引起的问题
多余字符所带来的挑战与数据准备中的许多其他困难问题并没有什么不同。然而,
它们的独特之处在于,它们提出了潜在的难以找到的、需要清理的个别值,而不是
整个数据字段。识别那些带有多余字符的个别值可能是一个挑战,特别是在一个字
符串字段中,它不会简单地在输入时返回一个空值。
多余字符的主要麻烦在于,它们会增加数据准备工作的复杂性,因为它们使你无法
对数据字段中的所有值应用单一规则。例如,一个数字字段中只潜伏着一个隐藏的
非数字字符,不能简单地对其进行汇总,从而使许多常用步骤无法正常工作。幸运
的是,与其试图大海捞针,不如使用
Prep Builder
的一些内置功能来协助完成这项
任务。
29-1
中每个数据字段中至少包括一个多余字符,以展示其潜在的影响。在
Date
(日期)字段中,字母
c
取代了日期。在
Store
(商店)字段中,一个感叹号取代了
Clapham
中的
l
Type
(类型)字段有两个问题:
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