Skip to Content
实用 Tableau
book

实用 Tableau

by Ryan Sleeper
May 2025
Intermediate to advanced
624 pages
7h 35m
Chinese
O'Reilly Media, Inc.
Content preview from 实用 Tableau

第 57 章 如何有条件地格式化单个行或列

本作品已使用人工智能进行翻译。欢迎您提供反馈和意见:translation-feedback@oreilly.com

几乎每个 Tableau 用户都曾经是或仍然是 Excel 的忠实用户。由于我们几乎都是先学习 Excel,所以在第一次接触 Tableau 这样的工具时,自然会对它的工作方式有一些先入为主的想法。虽然这两个软件程序的报告输出之间有一些重叠,但我们需要一些时间来了解这两个程序的不同之处以及它们之间的最佳契合点。

虽然使用这两个程序都有巨大的优势,但我还是亲眼目睹了 Excel 的习得行为是如何成为 Tableau 的使用障碍的。其中一个例子与条件格式化以及修改单个行或列的能力有关。这在 Excel 中非常容易实现,因为您可以完全按照自己的意愿修改每个单元格。 Tableau 当然可以通过标记卡片 提供许多编码选项,但这似乎有点 "全有或全无"。例如,如果将一个测量值放在 "彩色标记卡 "上,则视图上的所有标记都会着色。

本章将向您介绍如何使用每个测量值的图例功能,以及在 Tableau 中像在 Excel 中一样进行条件格式化的技巧。

如何使用每次测量的传说

Tableau 10.2 版发布的功能之一有助于解决 "全有或全无 "编码的限制。 有了每个度量值的图例,如果用多个度量值创建高亮显示表,然后根据度量值字段为标记着色,就可以在视图上为每个度量值创建一个颜色图例。

在 Tableau 中使用每个度量的图例的第一步是设置一个使用度量名称字段的表。然后,将 "度量值 "字段放在 "颜色标记卡 "上。在过去,这将为度量值生成一个颜色图例,在整个不同度量名称的表中应用相同的颜色。如果按测量值绘制图例,只需单击颜色标记卡上的测量值字段 并选择 "使用单独图例",即可为表格中的每个测量值绘制独立的图例:

prta 5701

下面是高亮表在应用了每个测量图例后的效果:

prta 5702

请注意,您也可以通过再次单击颜色标记卡上的测量值字段并选择合并图例来重新组合图例。

如何像 Excel 一样在 Tableau 中使用条件格式

每个测量值的图例是为高亮表格提供灵活格式化的一个很好的步骤,但它仍然不允许您有条件地格式化测量值名称的各个列。 例如,如果您想根据是否满足每个措施的条件来为每个措施名称的单元格着色,该怎么办?幸运的是,有一种技巧可以利用占位符字段在 Tableau 中实现类似 Excel 的条件格式化。

为了说明这个技巧的必要性并提供如何使用的教程,我们将使用这个 Tableau 仪表盘,该仪表盘用于评估公司网站上 A-B 拆分测试的结果:

prta 5703

我们将重点关注中间的 100 点索引表。该表有一列代表拆分测试中的每个变体配方,有几行代表常见的网络关键绩效指标,如线索/访问率、购买/线索率、购买/访问率和每次访问收入。每个圆圈上的标签都是 ...

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

Python深度学习从原理到应用

Python深度学习从原理到应用

Posts & Telecom Press, Valentino Zocca
数据科学实战手册(R+Python)(第2版)

数据科学实战手册(R+Python)(第2版)

Posts & Telecom Press, Prabhanjan Narayanachar Tattar, Tony Ojeda, Sean Patrick Murphy, Sean P Murphy, Benjamin Bengfort, Bengfort Benjamin, ABHIJIT DASGUPTA
C++语言导学(原书第2版)

C++语言导学(原书第2版)

本贾尼 斯特劳斯特鲁普
程序设计导论:Python语言实践

程序设计导论:Python语言实践

罗伯特 塞奇威克, 凯文 韦恩, 罗伯特 唐德罗

Publisher Resources

ISBN: 9798341657137