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即学即用
71
处理日期问题
8.6
输入日期
在图
8-2
和图
8-3
中,你可能已经注意到
1970
1
1
日和
1900
1
1
日这两
个日期被
#
号包围。这是在你使用的许多计算和工具中常见的语法,还有更常见的
转换日期方法。在
Tableau
中,有一些特定于日期的技术会使你的分析变得非常简单。
8.6.1 makedate()
函数
如果把日期的每个部分都以数字的形式放在不同的字段中,则可能要考虑使用
makedate()
函数,如图
8-4
所示。
8
-
4
makedate() 函数
这个函数可以让你将日期的各个组件拼凑起来,按照你想要的方式进行分析。
8.6.2 dateparse()
函数
字符串对于处理日期是非常常见的。这里有一些你可能会看到
September
9
月)的
写法:
S
Sep
Sept
September
再加上不同的方式来分隔日期的不同部分(空格、逗号、斜线、破折号等),日期
的字符串数据可以有许多不同的形式,如:
72
8
25 Sep 19
Sept.25th.2019
25-9-19
dateparse()
函数可以接受上述任意形式的字符串,并分离出日期的各个部分,
只要它们在整个日期字段中的格式一致。那么,
dateparse()
函数的关键是正确
调用你所引用的字符串字段的日期部分。表 ...
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