从 Tableau 中的多列聚合 [英] Aggregating from multiple columns in Tableau

查看:102
本文介绍了从 Tableau 中的多列聚合的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个看起来像这样的表格:

I have a table that looks like:

id     aff1    aff2    aff3    value
1       a        x      b        5
2       b        c      x        4
3       a        b      g        1

我想聚合 aff 列来计算每个 aff 的价值"总和.例如,上面给出:

I would like to aggregate the aff columns to calculate the sum of "value" for each aff. For example, the above gives:

aff    sum
a       6
b       10
c       4
g       1
x       9

理想情况下,我希望直接在 tableau 中执行此操作,而无需通过沿所有 aff 列展开表格来重新制作表格.

Ideally, I'd like to do this directly in tableau without remaking the table by unfolding it along all the aff columns.

推荐答案

您可以使用 Tableau 的内置数据透视方法如下,而无需在源中重新整形.

You can use Tableau’s inbuilt pivot method as below, without reshaping in source .

  1. CTRL 选择要合并的所有 3 个维度,然后单击枢轴.

  1. 您将获得如下重新整形的新数据,删除其他列:

  1. 最后构建您的视图.

我希望这能回答.上述结果的其他选项包括在 DB 级别加入,或为每个属性值创建多个不可扩展的计算字段.

I hope this answers . Rest other options for the above results include JOIN at DB level, or creating multiple calculated fields for each attribute value which are not scalable.

这篇关于从 Tableau 中的多列聚合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆